@felix-hz/seamount 0.0.0-stage → 0.1.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 (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +150 -2
  3. package/THIRD_PARTY_NOTICES.md +37 -0
  4. package/dist/css/base.css +75 -0
  5. package/dist/css/components.css +1107 -0
  6. package/dist/css/fonts.css +136 -0
  7. package/dist/css/seamount.css +1483 -0
  8. package/dist/css/tailwind.css +64 -0
  9. package/dist/css/tokens.css +159 -0
  10. package/dist/fonts/DepartureMono-OFL.txt +93 -0
  11. package/dist/fonts/InstrumentSans-OFL.txt +93 -0
  12. package/dist/fonts/JetBrainsMono-OFL.txt +93 -0
  13. package/dist/fonts/Newsreader-OFL.txt +93 -0
  14. package/dist/fonts/departure-mono.woff2 +0 -0
  15. package/dist/fonts/instrument-sans.woff2 +0 -0
  16. package/dist/fonts/jetbrains-mono.woff2 +0 -0
  17. package/dist/fonts/newsreader-display.woff2 +0 -0
  18. package/dist/fonts/newsreader-italic.woff2 +0 -0
  19. package/dist/fonts/newsreader-semibold.woff2 +0 -0
  20. package/dist/fonts/newsreader.woff2 +0 -0
  21. package/dist/lib/format.d.ts +23 -0
  22. package/dist/lib/format.js +88 -0
  23. package/dist/lib/format.js.map +1 -0
  24. package/dist/lib/theme.d.ts +20 -0
  25. package/dist/lib/theme.js +53 -0
  26. package/dist/lib/theme.js.map +1 -0
  27. package/dist/react/button.d.ts +12 -0
  28. package/dist/react/button.js +19 -0
  29. package/dist/react/button.js.map +1 -0
  30. package/dist/react/cn.d.ts +4 -0
  31. package/dist/react/cn.js +10 -0
  32. package/dist/react/cn.js.map +1 -0
  33. package/dist/react/controls.d.ts +23 -0
  34. package/dist/react/controls.js +50 -0
  35. package/dist/react/controls.js.map +1 -0
  36. package/dist/react/dialog.d.ts +40 -0
  37. package/dist/react/dialog.js +102 -0
  38. package/dist/react/dialog.js.map +1 -0
  39. package/dist/react/feedback.d.ts +31 -0
  40. package/dist/react/feedback.js +86 -0
  41. package/dist/react/feedback.js.map +1 -0
  42. package/dist/react/field.d.ts +38 -0
  43. package/dist/react/field.js +81 -0
  44. package/dist/react/field.js.map +1 -0
  45. package/dist/react/hooks.d.ts +24 -0
  46. package/dist/react/hooks.js +58 -0
  47. package/dist/react/hooks.js.map +1 -0
  48. package/dist/react/index.d.ts +19 -0
  49. package/dist/react/index.js +19 -0
  50. package/dist/react/label.d.ts +28 -0
  51. package/dist/react/label.js +91 -0
  52. package/dist/react/label.js.map +1 -0
  53. package/dist/react/menu.d.ts +21 -0
  54. package/dist/react/menu.js +72 -0
  55. package/dist/react/menu.js.map +1 -0
  56. package/dist/react/overlay.d.ts +19 -0
  57. package/dist/react/overlay.js +47 -0
  58. package/dist/react/overlay.js.map +1 -0
  59. package/dist/react/row.d.ts +14 -0
  60. package/dist/react/row.js +35 -0
  61. package/dist/react/row.js.map +1 -0
  62. package/dist/react/section.d.ts +20 -0
  63. package/dist/react/section.js +72 -0
  64. package/dist/react/section.js.map +1 -0
  65. package/dist/react/select.d.ts +11 -0
  66. package/dist/react/select.js +59 -0
  67. package/dist/react/select.js.map +1 -0
  68. package/dist/react/spec.d.ts +10 -0
  69. package/dist/react/spec.js +25 -0
  70. package/dist/react/spec.js.map +1 -0
  71. package/dist/react/stat.d.ts +37 -0
  72. package/dist/react/stat.js +115 -0
  73. package/dist/react/stat.js.map +1 -0
  74. package/dist/react/tabs.d.ts +7 -0
  75. package/dist/react/tabs.js +30 -0
  76. package/dist/react/tabs.js.map +1 -0
  77. package/dist/react/toast.d.ts +51 -0
  78. package/dist/react/toast.js +122 -0
  79. package/dist/react/toast.js.map +1 -0
  80. package/package.json +100 -4
@@ -0,0 +1,38 @@
1
+
2
+ import * as React from "react";
3
+ type FieldContextValue = {
4
+ id: string;
5
+ helpId: string;
6
+ errorId: string;
7
+ hasHelp: boolean;
8
+ invalid: boolean;
9
+ };
10
+ /** The id and descriptions of the enclosing Field; inputs read it to wire label, help and error. */
11
+ export declare function useField(): FieldContextValue | null;
12
+ export type FieldProps = Omit<React.ComponentProps<"div">, "children"> & {
13
+ label: React.ReactNode;
14
+ help?: React.ReactNode;
15
+ /** The fix, not just the fault: "Enter 1 to 3,600 seconds". Validate on blur or submit. */
16
+ error?: React.ReactNode;
17
+ /** Use an id the app already owns. */
18
+ id?: string;
19
+ children: React.ReactNode;
20
+ };
21
+ export declare function Field({ label, help, error, id, className, children, ...props }: FieldProps): React.JSX.Element;
22
+ /** The aria wiring a control inside a Field needs; props the caller passes win. */
23
+ export declare function useFieldControlProps(props: {
24
+ id?: string;
25
+ "aria-describedby"?: string;
26
+ "aria-invalid"?: React.AriaAttributes["aria-invalid"];
27
+ }): {
28
+ id?: string;
29
+ "aria-describedby"?: string;
30
+ "aria-invalid"?: React.AriaAttributes["aria-invalid"];
31
+ };
32
+ export type InputProps = React.ComponentProps<"input"> & {
33
+ /** Mono tabular figures, for amounts and codes. */
34
+ figures?: boolean;
35
+ };
36
+ export declare function Input({ className, figures, ...props }: InputProps): React.JSX.Element;
37
+ export declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
38
+ export {};
@@ -0,0 +1,81 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import { cn } from "./cn.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ // src/react/field.tsx
6
+ const FieldContext = React.createContext(null);
7
+ /** The id and descriptions of the enclosing Field; inputs read it to wire label, help and error. */
8
+ function useField() {
9
+ return React.useContext(FieldContext);
10
+ }
11
+ function Field({ label, help, error, id, className, children, ...props }) {
12
+ const auto = React.useId();
13
+ const fieldId = id ?? `sm-field-${auto}`;
14
+ const value = {
15
+ id: fieldId,
16
+ helpId: `${fieldId}-help`,
17
+ errorId: `${fieldId}-error`,
18
+ hasHelp: Boolean(help),
19
+ invalid: Boolean(error)
20
+ };
21
+ return /* @__PURE__ */ jsx(FieldContext.Provider, {
22
+ value,
23
+ children: /* @__PURE__ */ jsxs("div", {
24
+ "data-slot": "field",
25
+ className: cn("sm-field", className),
26
+ ...props,
27
+ children: [
28
+ /* @__PURE__ */ jsx("label", {
29
+ className: "sm-field-label",
30
+ htmlFor: fieldId,
31
+ children: label
32
+ }),
33
+ children,
34
+ help && !error && /* @__PURE__ */ jsx("p", {
35
+ id: value.helpId,
36
+ className: "sm-field-help",
37
+ children: help
38
+ }),
39
+ error && /* @__PURE__ */ jsx("p", {
40
+ id: value.errorId,
41
+ className: "sm-field-error",
42
+ role: "alert",
43
+ children: error
44
+ })
45
+ ]
46
+ })
47
+ });
48
+ }
49
+ /** The aria wiring a control inside a Field needs; props the caller passes win. */
50
+ function useFieldControlProps(props) {
51
+ const field = useField();
52
+ if (!field) return props;
53
+ const describedBy = field.invalid ? field.errorId : field.hasHelp ? field.helpId : void 0;
54
+ return {
55
+ id: props.id ?? field.id,
56
+ "aria-describedby": props["aria-describedby"] ?? describedBy,
57
+ "aria-invalid": props["aria-invalid"] ?? (field.invalid || void 0)
58
+ };
59
+ }
60
+ function Input({ className, figures, ...props }) {
61
+ const wired = useFieldControlProps(props);
62
+ return /* @__PURE__ */ jsx("input", {
63
+ "data-slot": "input",
64
+ "data-figures": figures || void 0,
65
+ className: cn("sm-input", className),
66
+ ...props,
67
+ ...wired
68
+ });
69
+ }
70
+ function Textarea({ className, ...props }) {
71
+ const wired = useFieldControlProps(props);
72
+ return /* @__PURE__ */ jsx("textarea", {
73
+ "data-slot": "textarea",
74
+ className: cn("sm-textarea", className),
75
+ ...props,
76
+ ...wired
77
+ });
78
+ }
79
+ export { Field, Input, Textarea, useField, useFieldControlProps };
80
+
81
+ //# sourceMappingURL=field.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field.js","names":[],"sources":["../../src/react/field.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"./cn\";\n\ntype FieldContextValue = {\n id: string;\n helpId: string;\n errorId: string;\n hasHelp: boolean;\n invalid: boolean;\n};\n\nconst FieldContext = React.createContext<FieldContextValue | null>(null);\n\n/** The id and descriptions of the enclosing Field; inputs read it to wire label, help and error. */\nexport function useField(): FieldContextValue | null {\n return React.useContext(FieldContext);\n}\n\nexport type FieldProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n label: React.ReactNode;\n help?: React.ReactNode;\n /** The fix, not just the fault: \"Enter 1 to 3,600 seconds\". Validate on blur or submit. */\n error?: React.ReactNode;\n /** Use an id the app already owns. */\n id?: string;\n children: React.ReactNode;\n};\n\nexport function Field({ label, help, error, id, className, children, ...props }: FieldProps): React.JSX.Element {\n const auto = React.useId();\n const fieldId = id ?? `sm-field-${auto}`;\n const value: FieldContextValue = {\n id: fieldId,\n helpId: `${fieldId}-help`,\n errorId: `${fieldId}-error`,\n hasHelp: Boolean(help),\n invalid: Boolean(error),\n };\n return (\n <FieldContext.Provider value={value}>\n <div data-slot=\"field\" className={cn(\"sm-field\", className)} {...props}>\n <label className=\"sm-field-label\" htmlFor={fieldId}>\n {label}\n </label>\n {children}\n {help && !error && (\n <p id={value.helpId} className=\"sm-field-help\">\n {help}\n </p>\n )}\n {error && (\n <p id={value.errorId} className=\"sm-field-error\" role=\"alert\">\n {error}\n </p>\n )}\n </div>\n </FieldContext.Provider>\n );\n}\n\n/** The aria wiring a control inside a Field needs; props the caller passes win. */\nexport function useFieldControlProps(props: {\n id?: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: React.AriaAttributes[\"aria-invalid\"];\n}): { id?: string; \"aria-describedby\"?: string; \"aria-invalid\"?: React.AriaAttributes[\"aria-invalid\"] } {\n const field = useField();\n if (!field) return props;\n const describedBy = field.invalid ? field.errorId : field.hasHelp ? field.helpId : undefined;\n return {\n id: props.id ?? field.id,\n \"aria-describedby\": props[\"aria-describedby\"] ?? describedBy,\n \"aria-invalid\": props[\"aria-invalid\"] ?? (field.invalid || undefined),\n };\n}\n\nexport type InputProps = React.ComponentProps<\"input\"> & {\n /** Mono tabular figures, for amounts and codes. */\n figures?: boolean;\n};\n\nexport function Input({ className, figures, ...props }: InputProps): React.JSX.Element {\n const wired = useFieldControlProps(props);\n return (\n <input\n data-slot=\"input\"\n data-figures={figures || undefined}\n className={cn(\"sm-input\", className)}\n {...props}\n {...wired}\n />\n );\n}\n\nexport function Textarea({ className, ...props }: React.ComponentProps<\"textarea\">): React.JSX.Element {\n const wired = useFieldControlProps(props);\n return <textarea data-slot=\"textarea\" className={cn(\"sm-textarea\", className)} {...props} {...wired} />;\n}\n"],"mappings":";;;;;AAWA,MAAM,eAAe,MAAM,cAAwC,IAAI;;AAGvE,SAAgB,WAAqC;CACnD,OAAO,MAAM,WAAW,YAAY;AACtC;AAYA,SAAgB,MAAM,EAAE,OAAO,MAAM,OAAO,IAAI,WAAW,UAAU,GAAG,SAAwC;CAC9G,MAAM,OAAO,MAAM,MAAM;CACzB,MAAM,UAAU,MAAM,YAAY;CAClC,MAAM,QAA2B;EAC/B,IAAI;EACJ,QAAQ,GAAG,QAAQ;EACnB,SAAS,GAAG,QAAQ;EACpB,SAAS,QAAQ,IAAI;EACrB,SAAS,QAAQ,KAAK;CACxB;CACA,OACE,oBAAC,aAAa,UAAd;EAA8B;EAC5B,UAAA,qBAAC,OAAD;GAAK,aAAU;GAAQ,WAAW,GAAG,YAAY,SAAS;GAAG,GAAI;GAAjE,UAAA;IACE,oBAAC,SAAD;KAAO,WAAU;KAAiB,SAAS;KACxC,UAAA;IACI,CAAA;IACN;IACA,QAAQ,CAAC,SACR,oBAAC,KAAD;KAAG,IAAI,MAAM;KAAQ,WAAU;KAC5B,UAAA;IACA,CAAA;IAEJ,SACC,oBAAC,KAAD;KAAG,IAAI,MAAM;KAAS,WAAU;KAAiB,MAAK;KACnD,UAAA;IACA,CAAA;GAEF;;CACgB,CAAA;AAE3B;;AAGA,SAAgB,qBAAqB,OAImE;CACtG,MAAM,QAAQ,SAAS;CACvB,IAAI,CAAC,OAAO,OAAO;CACnB,MAAM,cAAc,MAAM,UAAU,MAAM,UAAU,MAAM,UAAU,MAAM,SAAS,KAAA;CACnF,OAAO;EACL,IAAI,MAAM,MAAM,MAAM;EACtB,oBAAoB,MAAM,uBAAuB;EACjD,gBAAgB,MAAM,oBAAoB,MAAM,WAAW,KAAA;CAC7D;AACF;AAOA,SAAgB,MAAM,EAAE,WAAW,SAAS,GAAG,SAAwC;CACrF,MAAM,QAAQ,qBAAqB,KAAK;CACxC,OACE,oBAAC,SAAD;EACE,aAAU;EACV,gBAAc,WAAW,KAAA;EACzB,WAAW,GAAG,YAAY,SAAS;EACnC,GAAI;EACJ,GAAI;CACL,CAAA;AAEL;AAEA,SAAgB,SAAS,EAAE,WAAW,GAAG,SAA8D;CACrG,MAAM,QAAQ,qBAAqB,KAAK;CACxC,OAAO,oBAAC,YAAD;EAAU,aAAU;EAAW,WAAW,GAAG,eAAe,SAAS;EAAG,GAAI;EAAO,GAAI;CAAQ,CAAA;AACxG"}
@@ -0,0 +1,24 @@
1
+
2
+ import { ResolvedTheme, ThemeChoice } from "../lib/theme.js";
3
+ export type HotkeyOptions = {
4
+ enabled?: boolean;
5
+ /** Also fire while focus is in a text field (default false, so typing a letter never triggers it). */
6
+ inFields?: boolean;
7
+ };
8
+ /**
9
+ * Binds a single key ("t", "Escape", "?") with no modifiers held, so the letter shown in a label works.
10
+ * Combinations with Ctrl, Alt or Meta are left to the browser and the app's command menu.
11
+ */
12
+ export declare function useHotkey(key: string, handler: (event: KeyboardEvent) => void, options?: HotkeyOptions): void;
13
+ export type UseThemeOptions = {
14
+ storageKey?: string;
15
+ /** Also toggle .dark and .light on <html>, for apps whose CSS keys off a class. */
16
+ classes?: boolean;
17
+ };
18
+ export type UseThemeResult = {
19
+ choice: ThemeChoice;
20
+ resolved: ResolvedTheme;
21
+ setChoice: (choice: ThemeChoice) => void;
22
+ };
23
+ /** System, Light or Dark, persisted and applied to <html>; System follows the OS live. */
24
+ export declare function useTheme({ storageKey, classes }?: UseThemeOptions): UseThemeResult;
@@ -0,0 +1,58 @@
1
+ "use client";
2
+ import * as React from "react";
3
+ import { applyTheme, readThemeChoice, storeThemeChoice, watchSystemTheme } from "../lib/theme.js";
4
+ // src/react/hooks.ts
5
+ const isTyping = (target) => {
6
+ if (!(target instanceof HTMLElement)) return false;
7
+ return target.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(target.tagName);
8
+ };
9
+ /**
10
+ * Binds a single key ("t", "Escape", "?") with no modifiers held, so the letter shown in a label works.
11
+ * Combinations with Ctrl, Alt or Meta are left to the browser and the app's command menu.
12
+ */
13
+ function useHotkey(key, handler, options = {}) {
14
+ const { enabled = true, inFields = false } = options;
15
+ const saved = React.useRef(handler);
16
+ React.useEffect(() => {
17
+ saved.current = handler;
18
+ });
19
+ React.useEffect(() => {
20
+ if (!enabled) return;
21
+ const onKey = (event) => {
22
+ if (event.ctrlKey || event.metaKey || event.altKey || event.defaultPrevented) return;
23
+ if (!inFields && isTyping(event.target)) return;
24
+ if (event.key.toLowerCase() !== key.toLowerCase()) return;
25
+ saved.current(event);
26
+ };
27
+ window.addEventListener("keydown", onKey);
28
+ return () => window.removeEventListener("keydown", onKey);
29
+ }, [
30
+ key,
31
+ enabled,
32
+ inFields
33
+ ]);
34
+ }
35
+ /** System, Light or Dark, persisted and applied to <html>; System follows the OS live. */
36
+ function useTheme({ storageKey, classes = false } = {}) {
37
+ const [choice, setChoiceState] = React.useState("system");
38
+ const [resolved, setResolved] = React.useState("light");
39
+ React.useEffect(() => {
40
+ setChoiceState(readThemeChoice(storageKey));
41
+ }, [storageKey]);
42
+ React.useEffect(() => {
43
+ setResolved(applyTheme(choice, { classes }));
44
+ if (choice !== "system") return;
45
+ return watchSystemTheme(() => setResolved(applyTheme("system", { classes })));
46
+ }, [choice, classes]);
47
+ return {
48
+ choice,
49
+ resolved,
50
+ setChoice: React.useCallback((next) => {
51
+ storeThemeChoice(next, storageKey);
52
+ setChoiceState(next);
53
+ }, [storageKey])
54
+ };
55
+ }
56
+ export { useHotkey, useTheme };
57
+
58
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.js","names":[],"sources":["../../src/react/hooks.ts"],"sourcesContent":["import * as React from \"react\";\nimport {\n applyTheme,\n type ResolvedTheme,\n readThemeChoice,\n storeThemeChoice,\n type ThemeChoice,\n watchSystemTheme,\n} from \"../lib/theme\";\n\nconst isTyping = (target: EventTarget | null): boolean => {\n if (!(target instanceof HTMLElement)) return false;\n return target.isContentEditable || /^(INPUT|TEXTAREA|SELECT)$/.test(target.tagName);\n};\n\nexport type HotkeyOptions = {\n enabled?: boolean;\n /** Also fire while focus is in a text field (default false, so typing a letter never triggers it). */\n inFields?: boolean;\n};\n\n/**\n * Binds a single key (\"t\", \"Escape\", \"?\") with no modifiers held, so the letter shown in a label works.\n * Combinations with Ctrl, Alt or Meta are left to the browser and the app's command menu.\n */\nexport function useHotkey(key: string, handler: (event: KeyboardEvent) => void, options: HotkeyOptions = {}): void {\n const { enabled = true, inFields = false } = options;\n const saved = React.useRef(handler);\n React.useEffect(() => {\n saved.current = handler;\n });\n React.useEffect(() => {\n if (!enabled) return;\n const onKey = (event: KeyboardEvent): void => {\n if (event.ctrlKey || event.metaKey || event.altKey || event.defaultPrevented) return;\n if (!inFields && isTyping(event.target)) return;\n if (event.key.toLowerCase() !== key.toLowerCase()) return;\n saved.current(event);\n };\n window.addEventListener(\"keydown\", onKey);\n return () => window.removeEventListener(\"keydown\", onKey);\n }, [key, enabled, inFields]);\n}\n\nexport type UseThemeOptions = {\n storageKey?: string;\n /** Also toggle .dark and .light on <html>, for apps whose CSS keys off a class. */\n classes?: boolean;\n};\n\nexport type UseThemeResult = {\n choice: ThemeChoice;\n resolved: ResolvedTheme;\n setChoice: (choice: ThemeChoice) => void;\n};\n\n/** System, Light or Dark, persisted and applied to <html>; System follows the OS live. */\nexport function useTheme({ storageKey, classes = false }: UseThemeOptions = {}): UseThemeResult {\n const [choice, setChoiceState] = React.useState<ThemeChoice>(\"system\");\n const [resolved, setResolved] = React.useState<ResolvedTheme>(\"light\");\n\n React.useEffect(() => {\n setChoiceState(readThemeChoice(storageKey));\n }, [storageKey]);\n\n React.useEffect(() => {\n setResolved(applyTheme(choice, { classes }));\n if (choice !== \"system\") return;\n return watchSystemTheme(() => setResolved(applyTheme(\"system\", { classes })));\n }, [choice, classes]);\n\n const setChoice = React.useCallback(\n (next: ThemeChoice) => {\n storeThemeChoice(next, storageKey);\n setChoiceState(next);\n },\n [storageKey],\n );\n\n return { choice, resolved, setChoice };\n}\n"],"mappings":";;;;AAUA,MAAM,YAAY,WAAwC;CACxD,IAAI,EAAE,kBAAkB,cAAc,OAAO;CAC7C,OAAO,OAAO,qBAAqB,4BAA4B,KAAK,OAAO,OAAO;AACpF;;;;;AAYA,SAAgB,UAAU,KAAa,SAAyC,UAAyB,CAAC,GAAS;CACjH,MAAM,EAAE,UAAU,MAAM,WAAW,UAAU;CAC7C,MAAM,QAAQ,MAAM,OAAO,OAAO;CAClC,MAAM,gBAAgB;EACpB,MAAM,UAAU;CAClB,CAAC;CACD,MAAM,gBAAgB;EACpB,IAAI,CAAC,SAAS;EACd,MAAM,SAAS,UAA+B;GAC5C,IAAI,MAAM,WAAW,MAAM,WAAW,MAAM,UAAU,MAAM,kBAAkB;GAC9E,IAAI,CAAC,YAAY,SAAS,MAAM,MAAM,GAAG;GACzC,IAAI,MAAM,IAAI,YAAY,MAAM,IAAI,YAAY,GAAG;GACnD,MAAM,QAAQ,KAAK;EACrB;EACA,OAAO,iBAAiB,WAAW,KAAK;EACxC,aAAa,OAAO,oBAAoB,WAAW,KAAK;CAC1D,GAAG;EAAC;EAAK;EAAS;CAAQ,CAAC;AAC7B;;AAeA,SAAgB,SAAS,EAAE,YAAY,UAAU,UAA2B,CAAC,GAAmB;CAC9F,MAAM,CAAC,QAAQ,kBAAkB,MAAM,SAAsB,QAAQ;CACrE,MAAM,CAAC,UAAU,eAAe,MAAM,SAAwB,OAAO;CAErE,MAAM,gBAAgB;EACpB,eAAe,gBAAgB,UAAU,CAAC;CAC5C,GAAG,CAAC,UAAU,CAAC;CAEf,MAAM,gBAAgB;EACpB,YAAY,WAAW,QAAQ,EAAE,QAAQ,CAAC,CAAC;EAC3C,IAAI,WAAW,UAAU;EACzB,OAAO,uBAAuB,YAAY,WAAW,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;CAC9E,GAAG,CAAC,QAAQ,OAAO,CAAC;CAUpB,OAAO;EAAE;EAAQ;EAAU,WART,MAAM,aACrB,SAAsB;GACrB,iBAAiB,MAAM,UAAU;GACjC,eAAe,IAAI;EACrB,GACA,CAAC,UAAU,CAGsB;CAAE;AACvC"}
@@ -0,0 +1,19 @@
1
+
2
+ import { Button, ButtonProps, ButtonSize, ButtonVariant } from "./button.js";
3
+ import { cn } from "./cn.js";
4
+ import { Checkbox, SegmentedControl, SegmentedControlProps, SegmentedOption, Switch } from "./controls.js";
5
+ import { ConfirmDialog, ConfirmDialogProps, Dialog, DialogClose, DialogContent, DialogContentProps, DialogDescription, DialogFooter, DialogTitle, DialogTrigger } from "./dialog.js";
6
+ import { Banner, BannerProps, EmptyState, EmptyStateProps, LoadingState, LoadingStateProps, Skeleton, Table } from "./feedback.js";
7
+ import { Field, FieldProps, Input, InputProps, Textarea, useField, useFieldControlProps } from "./field.js";
8
+ import { HotkeyOptions, UseThemeOptions, UseThemeResult, useHotkey, useTheme } from "./hooks.js";
9
+ import { Kbd, Label, Live, ShortcutLabel, Square, Tag, Tone } from "./label.js";
10
+ import { Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuItem, MenuItemProps, MenuLabel, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuTrigger } from "./menu.js";
11
+ import { Popover, PopoverClose, PopoverContent, PopoverTrigger, Separator, Tooltip, TooltipProps, TooltipProvider } from "./overlay.js";
12
+ import { Row, RowProps } from "./row.js";
13
+ import { Section, SectionProps } from "./section.js";
14
+ import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "./select.js";
15
+ import { SpecItem, SpecList } from "./spec.js";
16
+ import { Meter, MeterProps, Sparkline, SparklineProps, StatTile, StatTileProps, sparklineGeometry } from "./stat.js";
17
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
18
+ import { ToastApi, ToastInput, ToastKind, ToastRecord, Toaster, ToasterProps, defaultDuration, toast, useToastState } from "./toast.js";
19
+ export { Banner, type BannerProps, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Checkbox, ConfirmDialog, type ConfirmDialogProps, Dialog, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, EmptyState, type EmptyStateProps, Field, type FieldProps, type HotkeyOptions, Input, type InputProps, Kbd, Label, Live, LoadingState, type LoadingStateProps, Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuItem, type MenuItemProps, MenuLabel, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuTrigger, Meter, type MeterProps, Popover, PopoverClose, PopoverContent, PopoverTrigger, Row, type RowProps, Section, type SectionProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, ShortcutLabel, Skeleton, Sparkline, type SparklineProps, SpecItem, SpecList, Square, StatTile, type StatTileProps, Switch, Table, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, type ToastApi, type ToastInput, type ToastKind, type ToastRecord, Toaster, type ToasterProps, type Tone, Tooltip, type TooltipProps, TooltipProvider, type UseThemeOptions, type UseThemeResult, cn, defaultDuration, sparklineGeometry, toast, useField, useFieldControlProps, useHotkey, useTheme, useToastState };
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import { Button } from "./button.js";
3
+ import { cn } from "./cn.js";
4
+ import { Checkbox, SegmentedControl, Switch } from "./controls.js";
5
+ import { ConfirmDialog, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger } from "./dialog.js";
6
+ import { Banner, EmptyState, LoadingState, Skeleton, Table } from "./feedback.js";
7
+ import { Field, Input, Textarea, useField, useFieldControlProps } from "./field.js";
8
+ import { useHotkey, useTheme } from "./hooks.js";
9
+ import { Kbd, Label, Live, ShortcutLabel, Square, Tag } from "./label.js";
10
+ import { Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuItem, MenuLabel, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuTrigger } from "./menu.js";
11
+ import { Popover, PopoverClose, PopoverContent, PopoverTrigger, Separator, Tooltip, TooltipProvider } from "./overlay.js";
12
+ import { Row } from "./row.js";
13
+ import { Section } from "./section.js";
14
+ import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue } from "./select.js";
15
+ import { SpecItem, SpecList } from "./spec.js";
16
+ import { Meter, Sparkline, StatTile, sparklineGeometry } from "./stat.js";
17
+ import { Tabs, TabsContent, TabsList, TabsTrigger } from "./tabs.js";
18
+ import { Toaster, defaultDuration, toast, useToastState } from "./toast.js";
19
+ export { Banner, Button, Checkbox, ConfirmDialog, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogTitle, DialogTrigger, EmptyState, Field, Input, Kbd, Label, Live, LoadingState, Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuItem, MenuLabel, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuTrigger, Meter, Popover, PopoverClose, PopoverContent, PopoverTrigger, Row, Section, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, ShortcutLabel, Skeleton, Sparkline, SpecItem, SpecList, Square, StatTile, Switch, Table, Tabs, TabsContent, TabsList, TabsTrigger, Tag, Textarea, Toaster, Tooltip, TooltipProvider, cn, defaultDuration, sparklineGeometry, toast, useField, useFieldControlProps, useHotkey, useTheme, useToastState };
@@ -0,0 +1,28 @@
1
+
2
+ import * as React from "react";
3
+ export type Tone = "ink" | "accent" | "ember";
4
+ /** Mono caps instrument label: section numbers, field names, nav. */
5
+ export declare function Label({ className, tone, ...props }: React.ComponentProps<"span"> & {
6
+ tone?: Exclude<Tone, "ember">;
7
+ }): React.JSX.Element;
8
+ /** Bracketed tag: `[ OK ]`, `[ ERROR ]`, `[ 01 ]`. The brackets are drawn by CSS, not read aloud. */
9
+ export declare function Tag({ className, tone, ...props }: React.ComponentProps<"span"> & {
10
+ tone?: Tone;
11
+ }): React.JSX.Element;
12
+ export declare function Kbd({ className, ...props }: React.ComponentProps<"kbd">): React.JSX.Element;
13
+ /** The 6 px square: bullets, live state, keys beside a name. Decorative unless given a label. */
14
+ export declare function Square({ className, tone, color, style, ...props }: React.ComponentProps<"span"> & {
15
+ tone?: Tone;
16
+ color?: string;
17
+ }): React.JSX.Element;
18
+ /** `■ Live · every 5 s` */
19
+ export declare function Live({ className, children, ...props }: React.ComponentProps<"span">): React.JSX.Element;
20
+ /**
21
+ * `[ T ]ype`: the shortcut letter shown in place. The first occurrence of `shortcut` (case-insensitive) is
22
+ * bracketed; the shortcut itself must be bound by the app (see useHotkey).
23
+ */
24
+ export declare function ShortcutLabel({ label, shortcut, className }: {
25
+ label: string;
26
+ shortcut: string;
27
+ className?: string;
28
+ }): React.JSX.Element;
@@ -0,0 +1,91 @@
1
+ "use client";
2
+ import { cn } from "./cn.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ // src/react/label.tsx
5
+ /** Mono caps instrument label: section numbers, field names, nav. */
6
+ function Label({ className, tone, ...props }) {
7
+ return /* @__PURE__ */ jsx("span", {
8
+ "data-slot": "label",
9
+ "data-tone": tone,
10
+ className: cn("sm-label", className),
11
+ ...props
12
+ });
13
+ }
14
+ /** Bracketed tag: `[ OK ]`, `[ ERROR ]`, `[ 01 ]`. The brackets are drawn by CSS, not read aloud. */
15
+ function Tag({ className, tone, ...props }) {
16
+ return /* @__PURE__ */ jsx("span", {
17
+ "data-slot": "tag",
18
+ "data-tone": tone,
19
+ className: cn("sm-tag", className),
20
+ ...props
21
+ });
22
+ }
23
+ function Kbd({ className, ...props }) {
24
+ return /* @__PURE__ */ jsx("kbd", {
25
+ "data-slot": "kbd",
26
+ className: cn("sm-kbd", className),
27
+ ...props
28
+ });
29
+ }
30
+ /** The 6 px square: bullets, live state, keys beside a name. Decorative unless given a label. */
31
+ function Square({ className, tone, color, style, ...props }) {
32
+ return /* @__PURE__ */ jsx("span", {
33
+ "aria-hidden": props["aria-label"] ? void 0 : true,
34
+ "data-slot": "square",
35
+ "data-tone": tone,
36
+ className: cn("sm-square", className),
37
+ style: color ? {
38
+ background: color,
39
+ ...style
40
+ } : style,
41
+ ...props
42
+ });
43
+ }
44
+ /** `■ Live · every 5 s` */
45
+ function Live({ className, children, ...props }) {
46
+ return /* @__PURE__ */ jsxs("span", {
47
+ "data-slot": "live",
48
+ className: cn("sm-live sm-label", className),
49
+ ...props,
50
+ children: [/* @__PURE__ */ jsx(Square, {}), children]
51
+ });
52
+ }
53
+ /**
54
+ * `[ T ]ype`: the shortcut letter shown in place. The first occurrence of `shortcut` (case-insensitive) is
55
+ * bracketed; the shortcut itself must be bound by the app (see useHotkey).
56
+ */
57
+ function ShortcutLabel({ label, shortcut, className }) {
58
+ const i = label.toLowerCase().indexOf(shortcut.toLowerCase());
59
+ if (i < 0) return /* @__PURE__ */ jsxs("span", {
60
+ className: cn("sm-label", className),
61
+ children: [
62
+ label,
63
+ " ",
64
+ /* @__PURE__ */ jsx(Kbd, { children: shortcut })
65
+ ]
66
+ });
67
+ return /* @__PURE__ */ jsxs("span", {
68
+ className: cn("sm-label", className),
69
+ "aria-keyshortcuts": shortcut,
70
+ children: [
71
+ label.slice(0, i),
72
+ /* @__PURE__ */ jsx("span", {
73
+ "aria-hidden": "true",
74
+ children: "[\xA0"
75
+ }),
76
+ /* @__PURE__ */ jsx("span", {
77
+ "data-tone": "accent",
78
+ className: "sm-label",
79
+ children: label.slice(i, i + shortcut.length)
80
+ }),
81
+ /* @__PURE__ */ jsx("span", {
82
+ "aria-hidden": "true",
83
+ children: "\xA0]"
84
+ }),
85
+ label.slice(i + shortcut.length)
86
+ ]
87
+ });
88
+ }
89
+ export { Kbd, Label, Live, ShortcutLabel, Square, Tag };
90
+
91
+ //# sourceMappingURL=label.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"label.js","names":[],"sources":["../../src/react/label.tsx"],"sourcesContent":["import type * as React from \"react\";\nimport { cn } from \"./cn\";\n\nexport type Tone = \"ink\" | \"accent\" | \"ember\";\n\n/** Mono caps instrument label: section numbers, field names, nav. */\nexport function Label({\n className,\n tone,\n ...props\n}: React.ComponentProps<\"span\"> & { tone?: Exclude<Tone, \"ember\"> }): React.JSX.Element {\n return <span data-slot=\"label\" data-tone={tone} className={cn(\"sm-label\", className)} {...props} />;\n}\n\n/** Bracketed tag: `[ OK ]`, `[ ERROR ]`, `[ 01 ]`. The brackets are drawn by CSS, not read aloud. */\nexport function Tag({ className, tone, ...props }: React.ComponentProps<\"span\"> & { tone?: Tone }): React.JSX.Element {\n return <span data-slot=\"tag\" data-tone={tone} className={cn(\"sm-tag\", className)} {...props} />;\n}\n\nexport function Kbd({ className, ...props }: React.ComponentProps<\"kbd\">): React.JSX.Element {\n return <kbd data-slot=\"kbd\" className={cn(\"sm-kbd\", className)} {...props} />;\n}\n\n/** The 6 px square: bullets, live state, keys beside a name. Decorative unless given a label. */\nexport function Square({\n className,\n tone,\n color,\n style,\n ...props\n}: React.ComponentProps<\"span\"> & { tone?: Tone; color?: string }): React.JSX.Element {\n return (\n <span\n aria-hidden={props[\"aria-label\"] ? undefined : true}\n data-slot=\"square\"\n data-tone={tone}\n className={cn(\"sm-square\", className)}\n style={color ? { background: color, ...style } : style}\n {...props}\n />\n );\n}\n\n/** `■ Live · every 5 s` */\nexport function Live({ className, children, ...props }: React.ComponentProps<\"span\">): React.JSX.Element {\n return (\n <span data-slot=\"live\" className={cn(\"sm-live sm-label\", className)} {...props}>\n <Square />\n {children}\n </span>\n );\n}\n\n/**\n * `[ T ]ype`: the shortcut letter shown in place. The first occurrence of `shortcut` (case-insensitive) is\n * bracketed; the shortcut itself must be bound by the app (see useHotkey).\n */\nexport function ShortcutLabel({\n label,\n shortcut,\n className,\n}: {\n label: string;\n shortcut: string;\n className?: string;\n}): React.JSX.Element {\n const i = label.toLowerCase().indexOf(shortcut.toLowerCase());\n if (i < 0)\n return (\n <span className={cn(\"sm-label\", className)}>\n {label} <Kbd>{shortcut}</Kbd>\n </span>\n );\n return (\n <span className={cn(\"sm-label\", className)} aria-keyshortcuts={shortcut}>\n {label.slice(0, i)}\n <span aria-hidden=\"true\">[&nbsp;</span>\n <span data-tone=\"accent\" className=\"sm-label\">\n {label.slice(i, i + shortcut.length)}\n </span>\n <span aria-hidden=\"true\">&nbsp;]</span>\n {label.slice(i + shortcut.length)}\n </span>\n );\n}\n"],"mappings":";;;;;AAMA,SAAgB,MAAM,EACpB,WACA,MACA,GAAG,SACmF;CACtF,OAAO,oBAAC,QAAD;EAAM,aAAU;EAAQ,aAAW;EAAM,WAAW,GAAG,YAAY,SAAS;EAAG,GAAI;CAAQ,CAAA;AACpG;;AAGA,SAAgB,IAAI,EAAE,WAAW,MAAM,GAAG,SAA4E;CACpH,OAAO,oBAAC,QAAD;EAAM,aAAU;EAAM,aAAW;EAAM,WAAW,GAAG,UAAU,SAAS;EAAG,GAAI;CAAQ,CAAA;AAChG;AAEA,SAAgB,IAAI,EAAE,WAAW,GAAG,SAAyD;CAC3F,OAAO,oBAAC,OAAD;EAAK,aAAU;EAAM,WAAW,GAAG,UAAU,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC9E;;AAGA,SAAgB,OAAO,EACrB,WACA,MACA,OACA,OACA,GAAG,SACiF;CACpF,OACE,oBAAC,QAAD;EACE,eAAa,MAAM,gBAAgB,KAAA,IAAY;EAC/C,aAAU;EACV,aAAW;EACX,WAAW,GAAG,aAAa,SAAS;EACpC,OAAO,QAAQ;GAAE,YAAY;GAAO,GAAG;EAAM,IAAI;EACjD,GAAI;CACL,CAAA;AAEL;;AAGA,SAAgB,KAAK,EAAE,WAAW,UAAU,GAAG,SAA0D;CACvG,OACE,qBAAC,QAAD;EAAM,aAAU;EAAO,WAAW,GAAG,oBAAoB,SAAS;EAAG,GAAI;EAAzE,UAAA,CACE,oBAAC,QAAD,CAAS,CAAA,GACR,QACG;;AAEV;;;;;AAMA,SAAgB,cAAc,EAC5B,OACA,UACA,aAKoB;CACpB,MAAM,IAAI,MAAM,YAAY,CAAC,CAAC,QAAQ,SAAS,YAAY,CAAC;CAC5D,IAAI,IAAI,GACN,OACE,qBAAC,QAAD;EAAM,WAAW,GAAG,YAAY,SAAS;EAAzC,UAAA;GACG;GAAM;GAAC,oBAAC,KAAD,EAAA,UAAM,SAAc,CAAA;EACxB;;CAEV,OACE,qBAAC,QAAD;EAAM,WAAW,GAAG,YAAY,SAAS;EAAG,qBAAmB;EAA/D,UAAA;GACG,MAAM,MAAM,GAAG,CAAC;GACjB,oBAAC,QAAD;IAAM,eAAY;IAAO,UAAA;GAAa,CAAA;GACtC,oBAAC,QAAD;IAAM,aAAU;IAAS,WAAU;IAChC,UAAA,MAAM,MAAM,GAAG,IAAI,SAAS,MAAM;GAC/B,CAAA;GACN,oBAAC,QAAD;IAAM,eAAY;IAAO,UAAA;GAAa,CAAA;GACrC,MAAM,MAAM,IAAI,SAAS,MAAM;EAC5B;;AAEV"}
@@ -0,0 +1,21 @@
1
+
2
+ import { DropdownMenu } from "radix-ui";
3
+ import * as React from "react";
4
+ export declare const Menu: typeof DropdownMenu.Root;
5
+ export declare const MenuTrigger: typeof DropdownMenu.Trigger;
6
+ export declare const MenuGroup: typeof DropdownMenu.Group;
7
+ export declare const MenuRadioGroup: typeof DropdownMenu.RadioGroup;
8
+ export declare function MenuContent({ className, sideOffset, align, ...props }: React.ComponentProps<typeof DropdownMenu.Content>): React.JSX.Element;
9
+ export type MenuItemProps = React.ComponentProps<typeof DropdownMenu.Item> & {
10
+ /** Printed right-aligned in mono; the app binds it. */
11
+ shortcut?: string;
12
+ variant?: "default" | "destructive";
13
+ };
14
+ export declare function MenuItem({ className, shortcut, variant, children, ...props }: MenuItemProps): React.JSX.Element;
15
+ export declare function MenuCheckboxItem({ className, children, shortcut, ...props }: React.ComponentProps<typeof DropdownMenu.CheckboxItem> & {
16
+ shortcut?: string;
17
+ }): React.JSX.Element;
18
+ /** The current choice carries a cobalt ✓. */
19
+ export declare function MenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenu.RadioItem>): React.JSX.Element;
20
+ export declare function MenuLabel({ className, ...props }: React.ComponentProps<typeof DropdownMenu.Label>): React.JSX.Element;
21
+ export declare function MenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenu.Separator>): React.JSX.Element;
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import { DropdownMenu } from "radix-ui";
3
+ import { cn } from "./cn.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ // src/react/menu.tsx
6
+ const Menu = DropdownMenu.Root;
7
+ const MenuTrigger = DropdownMenu.Trigger;
8
+ const MenuGroup = DropdownMenu.Group;
9
+ const MenuRadioGroup = DropdownMenu.RadioGroup;
10
+ function MenuContent({ className, sideOffset = 4, align = "start", ...props }) {
11
+ return /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(DropdownMenu.Content, {
12
+ "data-slot": "menu",
13
+ className: cn("sm-menu", className),
14
+ sideOffset,
15
+ align,
16
+ ...props
17
+ }) });
18
+ }
19
+ function MenuItem({ className, shortcut, variant = "default", children, ...props }) {
20
+ return /* @__PURE__ */ jsxs(DropdownMenu.Item, {
21
+ "data-variant": variant,
22
+ className: cn("sm-menu-item", className),
23
+ ...props,
24
+ children: [children, shortcut && /* @__PURE__ */ jsx("span", {
25
+ className: "sm-menu-shortcut",
26
+ children: shortcut
27
+ })]
28
+ });
29
+ }
30
+ function MenuCheckboxItem({ className, children, shortcut, ...props }) {
31
+ return /* @__PURE__ */ jsxs(DropdownMenu.CheckboxItem, {
32
+ className: cn("sm-menu-item", className),
33
+ ...props,
34
+ children: [
35
+ /* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, {
36
+ className: "sm-menu-indicator",
37
+ children: "✓"
38
+ }),
39
+ children,
40
+ shortcut && /* @__PURE__ */ jsx("span", {
41
+ className: "sm-menu-shortcut",
42
+ children: shortcut
43
+ })
44
+ ]
45
+ });
46
+ }
47
+ /** The current choice carries a cobalt ✓. */
48
+ function MenuRadioItem({ className, children, ...props }) {
49
+ return /* @__PURE__ */ jsxs(DropdownMenu.RadioItem, {
50
+ className: cn("sm-menu-item", className),
51
+ ...props,
52
+ children: [/* @__PURE__ */ jsx(DropdownMenu.ItemIndicator, {
53
+ className: "sm-menu-indicator",
54
+ children: "✓"
55
+ }), children]
56
+ });
57
+ }
58
+ function MenuLabel({ className, ...props }) {
59
+ return /* @__PURE__ */ jsx(DropdownMenu.Label, {
60
+ className: cn("sm-menu-label", className),
61
+ ...props
62
+ });
63
+ }
64
+ function MenuSeparator({ className, ...props }) {
65
+ return /* @__PURE__ */ jsx(DropdownMenu.Separator, {
66
+ className: cn("sm-menu-separator", className),
67
+ ...props
68
+ });
69
+ }
70
+ export { Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuItem, MenuLabel, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuTrigger };
71
+
72
+ //# sourceMappingURL=menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.js","names":["MenuPrimitive"],"sources":["../../src/react/menu.tsx"],"sourcesContent":["import { DropdownMenu as MenuPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { cn } from \"./cn\";\n\nexport const Menu: typeof MenuPrimitive.Root = MenuPrimitive.Root;\nexport const MenuTrigger: typeof MenuPrimitive.Trigger = MenuPrimitive.Trigger;\nexport const MenuGroup: typeof MenuPrimitive.Group = MenuPrimitive.Group;\nexport const MenuRadioGroup: typeof MenuPrimitive.RadioGroup = MenuPrimitive.RadioGroup;\n\nexport function MenuContent({\n className,\n sideOffset = 4,\n align = \"start\",\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.Content>): React.JSX.Element {\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.Content\n data-slot=\"menu\"\n className={cn(\"sm-menu\", className)}\n sideOffset={sideOffset}\n align={align}\n {...props}\n />\n </MenuPrimitive.Portal>\n );\n}\n\nexport type MenuItemProps = React.ComponentProps<typeof MenuPrimitive.Item> & {\n /** Printed right-aligned in mono; the app binds it. */\n shortcut?: string;\n variant?: \"default\" | \"destructive\";\n};\n\nexport function MenuItem({\n className,\n shortcut,\n variant = \"default\",\n children,\n ...props\n}: MenuItemProps): React.JSX.Element {\n return (\n <MenuPrimitive.Item data-variant={variant} className={cn(\"sm-menu-item\", className)} {...props}>\n {children}\n {shortcut && <span className=\"sm-menu-shortcut\">{shortcut}</span>}\n </MenuPrimitive.Item>\n );\n}\n\nexport function MenuCheckboxItem({\n className,\n children,\n shortcut,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.CheckboxItem> & { shortcut?: string }): React.JSX.Element {\n return (\n <MenuPrimitive.CheckboxItem className={cn(\"sm-menu-item\", className)} {...props}>\n <MenuPrimitive.ItemIndicator className=\"sm-menu-indicator\">✓</MenuPrimitive.ItemIndicator>\n {children}\n {shortcut && <span className=\"sm-menu-shortcut\">{shortcut}</span>}\n </MenuPrimitive.CheckboxItem>\n );\n}\n\n/** The current choice carries a cobalt ✓. */\nexport function MenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.RadioItem>): React.JSX.Element {\n return (\n <MenuPrimitive.RadioItem className={cn(\"sm-menu-item\", className)} {...props}>\n <MenuPrimitive.ItemIndicator className=\"sm-menu-indicator\">✓</MenuPrimitive.ItemIndicator>\n {children}\n </MenuPrimitive.RadioItem>\n );\n}\n\nexport function MenuLabel({\n className,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.Label>): React.JSX.Element {\n return <MenuPrimitive.Label className={cn(\"sm-menu-label\", className)} {...props} />;\n}\n\nexport function MenuSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.Separator>): React.JSX.Element {\n return <MenuPrimitive.Separator className={cn(\"sm-menu-separator\", className)} {...props} />;\n}\n"],"mappings":";;;;;AAIA,MAAa,OAAkCA,aAAc;AAC7D,MAAa,cAA4CA,aAAc;AACvE,MAAa,YAAwCA,aAAc;AACnE,MAAa,iBAAkDA,aAAc;AAE7E,SAAgB,YAAY,EAC1B,WACA,aAAa,GACb,QAAQ,SACR,GAAG,SACqE;CACxE,OACE,oBAACA,aAAc,QAAf,EAAA,UACE,oBAACA,aAAc,SAAf;EACE,aAAU;EACV,WAAW,GAAG,WAAW,SAAS;EACtB;EACL;EACP,GAAI;CACL,CAAA,EACmB,CAAA;AAE1B;AAQA,SAAgB,SAAS,EACvB,WACA,UACA,UAAU,WACV,UACA,GAAG,SACgC;CACnC,OACE,qBAACA,aAAc,MAAf;EAAoB,gBAAc;EAAS,WAAW,GAAG,gBAAgB,SAAS;EAAG,GAAI;EAAzF,UAAA,CACG,UACA,YAAY,oBAAC,QAAD;GAAM,WAAU;GAAoB,UAAA;EAAe,CAAA,CAC9C;;AAExB;AAEA,SAAgB,iBAAiB,EAC/B,WACA,UACA,UACA,GAAG,SACkG;CACrG,OACE,qBAACA,aAAc,cAAf;EAA4B,WAAW,GAAG,gBAAgB,SAAS;EAAG,GAAI;EAA1E,UAAA;GACE,oBAACA,aAAc,eAAf;IAA6B,WAAU;IAAoB,UAAA;GAA8B,CAAA;GACxF;GACA,YAAY,oBAAC,QAAD;IAAM,WAAU;IAAoB,UAAA;GAAe,CAAA;EACtC;;AAEhC;;AAGA,SAAgB,cAAc,EAC5B,WACA,UACA,GAAG,SACuE;CAC1E,OACE,qBAACA,aAAc,WAAf;EAAyB,WAAW,GAAG,gBAAgB,SAAS;EAAG,GAAI;EAAvE,UAAA,CACE,oBAACA,aAAc,eAAf;GAA6B,WAAU;GAAoB,UAAA;EAA8B,CAAA,GACxF,QACsB;;AAE7B;AAEA,SAAgB,UAAU,EACxB,WACA,GAAG,SACmE;CACtE,OAAO,oBAACA,aAAc,OAAf;EAAqB,WAAW,GAAG,iBAAiB,SAAS;EAAG,GAAI;CAAQ,CAAA;AACrF;AAEA,SAAgB,cAAc,EAC5B,WACA,GAAG,SACuE;CAC1E,OAAO,oBAACA,aAAc,WAAf;EAAyB,WAAW,GAAG,qBAAqB,SAAS;EAAG,GAAI;CAAQ,CAAA;AAC7F"}
@@ -0,0 +1,19 @@
1
+
2
+ import { Popover as Popover$1, Separator as Separator$1, Tooltip as Tooltip$1 } from "radix-ui";
3
+ import * as React from "react";
4
+ export declare const TooltipProvider: typeof Tooltip$1.Provider;
5
+ export type TooltipProps = {
6
+ content: React.ReactNode;
7
+ children: React.ReactElement;
8
+ side?: "top" | "right" | "bottom" | "left";
9
+ delayDuration?: number;
10
+ };
11
+ /** Help for a control with no room for it; never the only place essential information lives. Needs a TooltipProvider. */
12
+ export declare function Tooltip({ content, children, side, delayDuration }: TooltipProps): React.JSX.Element;
13
+ export declare const Popover: typeof Popover$1.Root;
14
+ export declare const PopoverTrigger: typeof Popover$1.Trigger;
15
+ export declare const PopoverClose: typeof Popover$1.Close;
16
+ export declare function PopoverContent({ className, sideOffset, align, ...props }: React.ComponentProps<typeof Popover$1.Content>): React.JSX.Element;
17
+ export declare function Separator({ className, orientation, decorative, tone, ...props }: React.ComponentProps<typeof Separator$1.Root> & {
18
+ tone?: "ink";
19
+ }): React.JSX.Element;
@@ -0,0 +1,47 @@
1
+ "use client";
2
+ import { Popover as Popover$1, Separator as Separator$1, Tooltip as Tooltip$1 } from "radix-ui";
3
+ import { cn } from "./cn.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ // src/react/overlay.tsx
6
+ const TooltipProvider = Tooltip$1.Provider;
7
+ /** Help for a control with no room for it; never the only place essential information lives. Needs a TooltipProvider. */
8
+ function Tooltip({ content, children, side = "top", delayDuration = 300 }) {
9
+ return /* @__PURE__ */ jsxs(Tooltip$1.Root, {
10
+ delayDuration,
11
+ children: [/* @__PURE__ */ jsx(Tooltip$1.Trigger, {
12
+ asChild: true,
13
+ children
14
+ }), /* @__PURE__ */ jsx(Tooltip$1.Portal, { children: /* @__PURE__ */ jsx(Tooltip$1.Content, {
15
+ "data-slot": "tooltip",
16
+ side,
17
+ sideOffset: 6,
18
+ className: "sm-tooltip",
19
+ children: content
20
+ }) })]
21
+ });
22
+ }
23
+ const Popover = Popover$1.Root;
24
+ const PopoverTrigger = Popover$1.Trigger;
25
+ const PopoverClose = Popover$1.Close;
26
+ function PopoverContent({ className, sideOffset = 6, align = "start", ...props }) {
27
+ return /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Content, {
28
+ "data-slot": "popover",
29
+ className: cn("sm-popover", className),
30
+ sideOffset,
31
+ align,
32
+ ...props
33
+ }) });
34
+ }
35
+ function Separator({ className, orientation = "horizontal", decorative = true, tone, ...props }) {
36
+ return /* @__PURE__ */ jsx(Separator$1.Root, {
37
+ "data-slot": "separator",
38
+ "data-tone": tone,
39
+ orientation,
40
+ decorative,
41
+ className: cn("sm-separator", className),
42
+ ...props
43
+ });
44
+ }
45
+ export { Popover, PopoverClose, PopoverContent, PopoverTrigger, Separator, Tooltip, TooltipProvider };
46
+
47
+ //# sourceMappingURL=overlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay.js","names":["TooltipPrimitive","PopoverPrimitive","SeparatorPrimitive"],"sources":["../../src/react/overlay.tsx"],"sourcesContent":["import { Popover as PopoverPrimitive, Separator as SeparatorPrimitive, Tooltip as TooltipPrimitive } from \"radix-ui\";\nimport type * as React from \"react\";\nimport { cn } from \"./cn\";\n\nexport const TooltipProvider: typeof TooltipPrimitive.Provider = TooltipPrimitive.Provider;\n\nexport type TooltipProps = {\n content: React.ReactNode;\n children: React.ReactElement;\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n delayDuration?: number;\n};\n\n/** Help for a control with no room for it; never the only place essential information lives. Needs a TooltipProvider. */\nexport function Tooltip({ content, children, side = \"top\", delayDuration = 300 }: TooltipProps): React.JSX.Element {\n return (\n <TooltipPrimitive.Root delayDuration={delayDuration}>\n <TooltipPrimitive.Trigger asChild>{children}</TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content data-slot=\"tooltip\" side={side} sideOffset={6} className=\"sm-tooltip\">\n {content}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n}\n\nexport const Popover: typeof PopoverPrimitive.Root = PopoverPrimitive.Root;\nexport const PopoverTrigger: typeof PopoverPrimitive.Trigger = PopoverPrimitive.Trigger;\nexport const PopoverClose: typeof PopoverPrimitive.Close = PopoverPrimitive.Close;\n\nexport function PopoverContent({\n className,\n sideOffset = 6,\n align = \"start\",\n ...props\n}: React.ComponentProps<typeof PopoverPrimitive.Content>): React.JSX.Element {\n return (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n data-slot=\"popover\"\n className={cn(\"sm-popover\", className)}\n sideOffset={sideOffset}\n align={align}\n {...props}\n />\n </PopoverPrimitive.Portal>\n );\n}\n\nexport function Separator({\n className,\n orientation = \"horizontal\",\n decorative = true,\n tone,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root> & { tone?: \"ink\" }): React.JSX.Element {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n data-tone={tone}\n orientation={orientation}\n decorative={decorative}\n className={cn(\"sm-separator\", className)}\n {...props}\n />\n );\n}\n"],"mappings":";;;;;AAIA,MAAa,kBAAoDA,UAAiB;;AAUlF,SAAgB,QAAQ,EAAE,SAAS,UAAU,OAAO,OAAO,gBAAgB,OAAwC;CACjH,OACE,qBAACA,UAAiB,MAAlB;EAAsC;EAAtC,UAAA,CACE,oBAACA,UAAiB,SAAlB;GAA0B,SAAA;GAAS;EAAmC,CAAA,GACtE,oBAACA,UAAiB,QAAlB,EAAA,UACE,oBAACA,UAAiB,SAAlB;GAA0B,aAAU;GAAgB;GAAM,YAAY;GAAG,WAAU;GAChF,UAAA;EACuB,CAAA,EACH,CAAA,CACJ;;AAE3B;AAEA,MAAa,UAAwCC,UAAiB;AACtE,MAAa,iBAAkDA,UAAiB;AAChF,MAAa,eAA8CA,UAAiB;AAE5E,SAAgB,eAAe,EAC7B,WACA,aAAa,GACb,QAAQ,SACR,GAAG,SACwE;CAC3E,OACE,oBAACA,UAAiB,QAAlB,EAAA,UACE,oBAACA,UAAiB,SAAlB;EACE,aAAU;EACV,WAAW,GAAG,cAAc,SAAS;EACzB;EACL;EACP,GAAI;CACL,CAAA,EACsB,CAAA;AAE7B;AAEA,SAAgB,UAAU,EACxB,WACA,cAAc,cACd,aAAa,MACb,MACA,GAAG,SAC0F;CAC7F,OACE,oBAACC,YAAmB,MAApB;EACE,aAAU;EACV,aAAW;EACE;EACD;EACZ,WAAW,GAAG,gBAAgB,SAAS;EACvC,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,14 @@
1
+
2
+ import * as React from "react";
3
+ export type RowProps = Omit<React.ComponentProps<"div">, "children"> & {
4
+ name: React.ReactNode;
5
+ help?: React.ReactNode;
6
+ /** Third line in mono for live state ("Reading…", "Reverted by MSI Center"); accent when it is a warning. */
7
+ state?: React.ReactNode;
8
+ warning?: boolean;
9
+ /** The id of the control, so the name labels it. */
10
+ htmlFor?: string;
11
+ children?: React.ReactNode;
12
+ };
13
+ /** A setting: name in the sans 500, one line of help, control on the right, rule under. */
14
+ export declare function Row({ name, help, state, warning, htmlFor, className, children, ...props }: RowProps): React.JSX.Element;
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { cn } from "./cn.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ // src/react/row.tsx
5
+ /** A setting: name in the sans 500, one line of help, control on the right, rule under. */
6
+ function Row({ name, help, state, warning, htmlFor, className, children, ...props }) {
7
+ const Name = htmlFor ? "label" : "div";
8
+ return /* @__PURE__ */ jsxs("div", {
9
+ "data-slot": "row",
10
+ className: cn("sm-row", className),
11
+ ...props,
12
+ children: [/* @__PURE__ */ jsxs("div", {
13
+ className: "sm-row-text",
14
+ children: [
15
+ /* @__PURE__ */ jsx(Name, {
16
+ className: "sm-row-name",
17
+ htmlFor,
18
+ children: name
19
+ }),
20
+ help && /* @__PURE__ */ jsx("p", {
21
+ className: "sm-row-help",
22
+ children: help
23
+ }),
24
+ state && /* @__PURE__ */ jsx("p", {
25
+ className: "sm-row-state",
26
+ "data-tone": warning ? "accent" : void 0,
27
+ children: state
28
+ })
29
+ ]
30
+ }), children]
31
+ });
32
+ }
33
+ export { Row };
34
+
35
+ //# sourceMappingURL=row.js.map