@rexezuge/web 1.3.0 → 1.5.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 (109) hide show
  1. package/dist/AppPage.d.ts +6 -2
  2. package/dist/AppPage.d.ts.map +1 -1
  3. package/dist/AppPage.js +1 -7
  4. package/dist/AppPage.js.map +7 -1
  5. package/dist/Badge.d.ts +9 -3
  6. package/dist/Badge.d.ts.map +1 -1
  7. package/dist/Badge.js +1 -25
  8. package/dist/Badge.js.map +7 -1
  9. package/dist/Button.d.ts +6 -2
  10. package/dist/Button.d.ts.map +1 -1
  11. package/dist/Button.js +1 -39
  12. package/dist/Button.js.map +7 -1
  13. package/dist/Card.d.ts +12 -9
  14. package/dist/Card.d.ts.map +1 -1
  15. package/dist/Card.js +1 -42
  16. package/dist/Card.js.map +7 -1
  17. package/dist/ContextBar.d.ts +9 -3
  18. package/dist/ContextBar.d.ts.map +1 -1
  19. package/dist/ContextBar.js +1 -7
  20. package/dist/ContextBar.js.map +7 -1
  21. package/dist/FocusInput.d.ts +1 -2
  22. package/dist/FocusInput.d.ts.map +1 -1
  23. package/dist/FocusInput.js +1 -19
  24. package/dist/FocusInput.js.map +7 -1
  25. package/dist/Input.d.ts +9 -8
  26. package/dist/Input.d.ts.map +1 -1
  27. package/dist/Input.js +1 -49
  28. package/dist/Input.js.map +7 -1
  29. package/dist/LanguageSelector.d.ts +6 -2
  30. package/dist/LanguageSelector.d.ts.map +1 -1
  31. package/dist/LanguageSelector.js +1 -12
  32. package/dist/LanguageSelector.js.map +7 -1
  33. package/dist/LoadingButton.d.ts +18 -6
  34. package/dist/LoadingButton.d.ts.map +1 -1
  35. package/dist/LoadingButton.js +1 -30
  36. package/dist/LoadingButton.js.map +7 -1
  37. package/dist/ModalShell.d.ts +12 -4
  38. package/dist/ModalShell.d.ts.map +1 -1
  39. package/dist/ModalShell.js +1 -22
  40. package/dist/ModalShell.js.map +7 -1
  41. package/dist/NoticeBar.d.ts +6 -2
  42. package/dist/NoticeBar.d.ts.map +1 -1
  43. package/dist/NoticeBar.js +1 -12
  44. package/dist/NoticeBar.js.map +7 -1
  45. package/dist/PageHeaderCard.d.ts +6 -2
  46. package/dist/PageHeaderCard.d.ts.map +1 -1
  47. package/dist/PageHeaderCard.js +1 -7
  48. package/dist/PageHeaderCard.js.map +7 -1
  49. package/dist/PageState.d.ts +9 -3
  50. package/dist/PageState.d.ts.map +1 -1
  51. package/dist/PageState.js +1 -47
  52. package/dist/PageState.js.map +7 -1
  53. package/dist/Pagination.d.ts +36 -12
  54. package/dist/Pagination.d.ts.map +1 -1
  55. package/dist/Pagination.js +1 -75
  56. package/dist/Pagination.js.map +7 -1
  57. package/dist/ReadOnlyField.d.ts +12 -4
  58. package/dist/ReadOnlyField.d.ts.map +1 -1
  59. package/dist/ReadOnlyField.js +1 -17
  60. package/dist/ReadOnlyField.js.map +7 -1
  61. package/dist/RefreshButton.d.ts +6 -2
  62. package/dist/RefreshButton.d.ts.map +1 -1
  63. package/dist/RefreshButton.js +1 -8
  64. package/dist/RefreshButton.js.map +7 -1
  65. package/dist/Spinner.d.ts +15 -5
  66. package/dist/Spinner.d.ts.map +1 -1
  67. package/dist/Spinner.js +1 -14
  68. package/dist/Spinner.js.map +7 -1
  69. package/dist/TypeToConfirmModal.d.ts +15 -5
  70. package/dist/TypeToConfirmModal.d.ts.map +1 -1
  71. package/dist/TypeToConfirmModal.js +1 -24
  72. package/dist/TypeToConfirmModal.js.map +7 -1
  73. package/dist/Unauthorized.d.ts +6 -2
  74. package/dist/Unauthorized.d.ts.map +1 -1
  75. package/dist/Unauthorized.js +1 -11
  76. package/dist/Unauthorized.js.map +7 -1
  77. package/dist/api.d.ts +27 -9
  78. package/dist/api.d.ts.map +1 -1
  79. package/dist/api.js +1 -258
  80. package/dist/api.js.map +7 -1
  81. package/dist/constants.js +1 -49
  82. package/dist/constants.js.map +7 -1
  83. package/dist/index.js +1 -89
  84. package/dist/index.js.map +7 -1
  85. package/dist/theme.d.ts +24 -8
  86. package/dist/theme.d.ts.map +1 -1
  87. package/dist/theme.js +1 -134
  88. package/dist/theme.js.map +7 -1
  89. package/dist/useCopyToClipboard.d.ts +3 -1
  90. package/dist/useCopyToClipboard.d.ts.map +1 -1
  91. package/dist/useCopyToClipboard.js +1 -40
  92. package/dist/useCopyToClipboard.js.map +7 -1
  93. package/dist/useCurrentUser.d.ts +21 -7
  94. package/dist/useCurrentUser.d.ts.map +1 -1
  95. package/dist/useCurrentUser.js +1 -49
  96. package/dist/useCurrentUser.js.map +7 -1
  97. package/dist/useNotice.d.ts +21 -7
  98. package/dist/useNotice.d.ts.map +1 -1
  99. package/dist/useNotice.js +1 -34
  100. package/dist/useNotice.js.map +7 -1
  101. package/dist/useSpaLanguage.d.ts +27 -11
  102. package/dist/useSpaLanguage.d.ts.map +1 -1
  103. package/dist/useSpaLanguage.js +1 -149
  104. package/dist/useSpaLanguage.js.map +7 -1
  105. package/dist/utils.d.ts +6 -2
  106. package/dist/utils.d.ts.map +1 -1
  107. package/dist/utils.js +1 -346
  108. package/dist/utils.js.map +7 -1
  109. package/package.json +4 -4
package/dist/AppPage.d.ts CHANGED
@@ -19,11 +19,15 @@ import type { ReactNode } from 'react';
19
19
  * `hero` follows `wide` rather than carrying its own width: a hero that is
20
20
  * wider than the page it introduces is a layout bug, not a style.
21
21
  */
22
- /** `wide` is the default for every view. `narrow` is for centered forms. */
22
+ /**
23
+ `wide` is the default for every view. `narrow` is for centered forms.
24
+ */
23
25
  type AppPageVariant = 'wide' | 'narrow' | 'hero';
24
26
  interface AppPageProps {
25
27
  variant?: AppPageVariant;
26
- /** Merged last, so it wins over the variant's own classes. */
28
+ /**
29
+ Merged last, so it wins over the variant's own classes.
30
+ */
27
31
  className?: string;
28
32
  children: ReactNode;
29
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AppPage.d.ts","sourceRoot":"","sources":["../src/AppPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,4EAA4E;AAC5E,KAAK,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjD,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,OAAO,CAAC,EAAE,OAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,YAAY,CAAC,+BAcjF;AAED,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"AppPage.d.ts","sourceRoot":"","sources":["../src/AppPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;EAEE;AACF,KAAK,cAAc,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjD,UAAU,YAAY;IACpB,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB;;MAEE;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,OAAO,CAAC,EAAE,OAAgB,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,QAAQ,CAAC,YAAY,CAAC,+BAcjF;AAED,OAAO,EAAE,OAAO,EAAE,CAAC;AACnB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC"}
package/dist/AppPage.js CHANGED
@@ -1,7 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "./utils.js";
3
- function AppPage({ variant = 'wide', className, children }) {
4
- return (_jsx("div", { className: cn('mx-auto w-full px-6', variant === 'wide' && 'max-w-5xl py-8 space-y-4', variant === 'narrow' && 'max-w-2xl py-8 space-y-4', variant === 'hero' && 'max-w-5xl py-16', className), children: children }));
5
- }
6
- export { AppPage };
7
- //# sourceMappingURL=AppPage.js.map
1
+ import{jsx as m}from"react/jsx-runtime";import{cn as o}from"./utils.js";function r({variant:p="wide",className:x,children:e}){return m("div",{className:o("mx-auto w-full px-6",p==="wide"&&"max-w-5xl py-8 space-y-4",p==="narrow"&&"max-w-2xl py-8 space-y-4",p==="hero"&&"max-w-5xl py-16",x),children:e})}export{r as AppPage};
@@ -1 +1,7 @@
1
- {"version":3,"file":"AppPage.js","sourceRoot":"","sources":["../src/AppPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAiChC,SAAS,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,SAAS,EAAE,QAAQ,EAA0B;IAChF,OAAO,CACL,cACE,SAAS,EAAE,EAAE,CACX,qBAAqB,EACrB,OAAO,KAAK,MAAM,IAAI,0BAA0B,EAChD,OAAO,KAAK,QAAQ,IAAI,0BAA0B,EAClD,OAAO,KAAK,MAAM,IAAI,iBAAiB,EACvC,SAAS,CACV,YAEA,QAAQ,GACL,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { cn } from './utils.ts';\n\n/**\n * The one page container.\n *\n * ## Provenance\n *\n * `components/layout/AppPage.tsx` in **Durable-DAV**, **Durable-DAV-Router**,\n * **Edge-Git** and **Edge-Sonic** — four copies, three of them identical.\n *\n * ## The divergence, and which side won\n *\n * Three copies used `max-w-7xl`; Edge-Sonic's used `max-w-5xl` and recorded\n * why: the operator surface is two lists and two forms, and the wider measure\n * only adds line length to prose already at its readable limit. That is the\n * better answer, so it is the one here — with `className` as the documented\n * escape hatch for a repo that genuinely wants the wider measure, because the\n * decision is per-app and a vendored copy would freeze ours.\n *\n * `hero` follows `wide` rather than carrying its own width: a hero that is\n * wider than the page it introduces is a layout bug, not a style.\n */\n\n/** `wide` is the default for every view. `narrow` is for centered forms. */\ntype AppPageVariant = 'wide' | 'narrow' | 'hero';\n\ninterface AppPageProps {\n variant?: AppPageVariant;\n /** Merged last, so it wins over the variant's own classes. */\n className?: string;\n children: ReactNode;\n}\n\nfunction AppPage({ variant = 'wide', className, children }: Readonly<AppPageProps>) {\n return (\n <div\n className={cn(\n 'mx-auto w-full px-6',\n variant === 'wide' && 'max-w-5xl py-8 space-y-4',\n variant === 'narrow' && 'max-w-2xl py-8 space-y-4',\n variant === 'hero' && 'max-w-5xl py-16',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\nexport { AppPage };\nexport type { AppPageProps, AppPageVariant };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/AppPage.tsx"],
4
+ "sourcesContent": ["import type { ReactNode } from 'react';\nimport { cn } from './utils.ts';\n\n/**\n * The one page container.\n *\n * ## Provenance\n *\n * `components/layout/AppPage.tsx` in **Durable-DAV**, **Durable-DAV-Router**,\n * **Edge-Git** and **Edge-Sonic** — four copies, three of them identical.\n *\n * ## The divergence, and which side won\n *\n * Three copies used `max-w-7xl`; Edge-Sonic's used `max-w-5xl` and recorded\n * why: the operator surface is two lists and two forms, and the wider measure\n * only adds line length to prose already at its readable limit. That is the\n * better answer, so it is the one here — with `className` as the documented\n * escape hatch for a repo that genuinely wants the wider measure, because the\n * decision is per-app and a vendored copy would freeze ours.\n *\n * `hero` follows `wide` rather than carrying its own width: a hero that is\n * wider than the page it introduces is a layout bug, not a style.\n */\n\n/**\n`wide` is the default for every view. `narrow` is for centered forms.\n*/\ntype AppPageVariant = 'wide' | 'narrow' | 'hero';\n\ninterface AppPageProps {\n variant?: AppPageVariant;\n /**\n Merged last, so it wins over the variant's own classes.\n */\n className?: string;\n children: ReactNode;\n}\n\nfunction AppPage({ variant = 'wide', className, children }: Readonly<AppPageProps>) {\n return (\n <div\n className={cn(\n 'mx-auto w-full px-6',\n variant === 'wide' && 'max-w-5xl py-8 space-y-4',\n variant === 'narrow' && 'max-w-2xl py-8 space-y-4',\n variant === 'hero' && 'max-w-5xl py-16',\n className,\n )}\n >\n {children}\n </div>\n );\n}\n\nexport { AppPage };\nexport type { AppPageProps, AppPageVariant };\n"],
5
+ "mappings": "wCACA,OAAS,MAAAA,MAAU,aAqCnB,SAASC,EAAQ,CAAE,QAAAC,EAAU,OAAQ,UAAAC,EAAW,SAAAC,CAAQ,EAA0B,CAChF,OACEC,EAAA,MAAA,CACE,UAAWL,EACT,sBACAE,IAAY,QAAU,2BACtBA,IAAY,UAAY,2BACxBA,IAAY,QAAU,kBACtBC,CAAS,EACV,SAEAC,CAAQ,CAAA,CAGf",
6
+ "names": ["cn", "AppPage", "variant", "className", "children", "_jsx"]
7
+ }
package/dist/Badge.d.ts CHANGED
@@ -22,12 +22,18 @@ import type { HTMLAttributes, ReactElement } from 'react';
22
22
  * which all six consuming apps already define.
23
23
  */
24
24
  type BadgeVariant = 'success' | 'error' | 'warning' | 'info' | 'neutral';
25
- /** Layout and type scale, shared by every variant. */
25
+ /**
26
+ Layout and type scale, shared by every variant.
27
+ */
26
28
  declare const badgeBaseClass = "inline-flex shrink-0 items-center rounded-md px-2 py-0.5 text-xs font-medium";
27
- /** The tone palette. `neutral` is the default: an unknown verdict is not a failure. */
29
+ /**
30
+ The tone palette. `neutral` is the default: an unknown verdict is not a failure.
31
+ */
28
32
  declare const badgeVariantClass: Record<BadgeVariant, string>;
29
33
  interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
30
- /** Tone; defaults to `neutral`. */
34
+ /**
35
+ Tone; defaults to `neutral`.
36
+ */
31
37
  variant?: BadgeVariant;
32
38
  }
33
39
  declare function Badge({ className, variant, ...rest }: Readonly<BadgeProps>): ReactElement;
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../src/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,KAAK,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAEzE,sDAAsD;AACtD,QAAA,MAAM,cAAc,iFAAiF,CAAC;AAEtG,uFAAuF;AACvF,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAMnD,CAAC;AAEF,UAAU,UAAW,SAAQ,cAAc,CAAC,eAAe,CAAC;IAC1D,mCAAmC;IACnC,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAmB,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,YAAY,CAE9F;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,OAAO,GAAE,YAAwB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;AAChE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC"}
1
+ {"version":3,"file":"Badge.d.ts","sourceRoot":"","sources":["../src/Badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,KAAK,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAEzE;;EAEE;AACF,QAAA,MAAM,cAAc,iFAAiF,CAAC;AAEtG;;EAEE;AACF,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAMnD,CAAC;AAEF,UAAU,UAAW,SAAQ,cAAc,CAAC,eAAe,CAAC;IAC1D;;MAEE;IACF,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAmB,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,YAAY,CAE9F;AAED;;;;GAIG;AACH,iBAAS,UAAU,CAAC,OAAO,GAAE,YAAwB,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjF;AAED,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC;AAChE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC"}
package/dist/Badge.js CHANGED
@@ -1,25 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "./utils.js";
3
- /** Layout and type scale, shared by every variant. */
4
- const badgeBaseClass = 'inline-flex shrink-0 items-center rounded-md px-2 py-0.5 text-xs font-medium';
5
- /** The tone palette. `neutral` is the default: an unknown verdict is not a failure. */
6
- const badgeVariantClass = {
7
- neutral: 'bg-[var(--color-neutral-bg)] text-[var(--color-neutral-text)]',
8
- success: 'bg-[var(--color-success-bg)] text-[var(--color-success-text)]',
9
- warning: 'bg-[var(--color-warning-bg)] text-[var(--color-warning-text)]',
10
- error: 'bg-[var(--color-error-bg)] text-[var(--color-error-text)]',
11
- info: 'bg-[var(--color-info-bg)] text-[var(--color-info-text)]',
12
- };
13
- function Badge({ className, variant = 'neutral', ...rest }) {
14
- return _jsx("span", { className: cn(badgeBaseClass, badgeVariantClass[variant], className), ...rest });
15
- }
16
- /**
17
- * The class string for a badge, for callers building the element themselves —
18
- * a `<button>` that looks like a badge, or a domain badge wrapper that adds
19
- * `t()`-translated children.
20
- */
21
- function badgeClass(variant = 'neutral', className) {
22
- return cn(badgeBaseClass, badgeVariantClass[variant], className);
23
- }
24
- export { Badge, badgeBaseClass, badgeClass, badgeVariantClass };
25
- //# sourceMappingURL=Badge.js.map
1
+ import{jsx as s}from"react/jsx-runtime";import{cn as a}from"./utils.js";const e="inline-flex shrink-0 items-center rounded-md px-2 py-0.5 text-xs font-medium",o={neutral:"bg-[var(--color-neutral-bg)] text-[var(--color-neutral-text)]",success:"bg-[var(--color-success-bg)] text-[var(--color-success-text)]",warning:"bg-[var(--color-warning-bg)] text-[var(--color-warning-text)]",error:"bg-[var(--color-error-bg)] text-[var(--color-error-text)]",info:"bg-[var(--color-info-bg)] text-[var(--color-info-text)]"};function c({className:r,variant:t="neutral",...n}){return s("span",{className:a(e,o[t],r),...n})}function l(r="neutral",t){return a(e,o[r],t)}export{c as Badge,e as badgeBaseClass,l as badgeClass,o as badgeVariantClass};
package/dist/Badge.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"Badge.js","sourceRoot":"","sources":["../src/Badge.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AA2BhC,sDAAsD;AACtD,MAAM,cAAc,GAAG,8EAA8E,CAAC;AAEtG,uFAAuF;AACvF,MAAM,iBAAiB,GAAiC;IACtD,OAAO,EAAE,+DAA+D;IACxE,OAAO,EAAE,+DAA+D;IACxE,OAAO,EAAE,+DAA+D;IACxE,KAAK,EAAE,2DAA2D;IAClE,IAAI,EAAE,yDAAyD;CAChE,CAAC;AAOF,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,SAAS,EAAE,GAAG,IAAI,EAAwB;IAC9E,OAAO,eAAM,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,KAAM,IAAI,GAAI,CAAC;AAClG,CAAC;AAED;;;;GAIG;AACH,SAAS,UAAU,CAAC,UAAwB,SAAS,EAAE,SAAkB;IACvE,OAAO,EAAE,CAAC,cAAc,EAAE,iBAAiB,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC;AACnE,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC","sourcesContent":["import type { HTMLAttributes, ReactElement } from 'react';\nimport { cn } from './utils.ts';\n\n/**\n * A status pill.\n *\n * ## Provenance\n *\n * `components/ui/Badge.tsx` in **CalDAV-Bridge**, **Durable-DAV**,\n * **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** — six\n * copies that agree on the base classes, the five variants, and the `neutral`\n * default. Edge-Sonic's is the best of them (its props spread onto the DOM\n * element, so a badge can carry `id`/`role`/`data-*`), so it is the shape here.\n *\n * The variants are *tones*, not statuses: every repo additionally carries a\n * stack of domain badges (`ConnectionBadge`, `VisibilityBadge`,\n * `TaskRunStatusBadge`, …) that map its own status vocabulary onto a tone and\n * translate a label with `t()`. Those are product vocabularies with\n * product-specific translation keys, so they stay with their apps — the kit\n * ships the tone layer and `badgeClass()` so a consumer's own\n * `variantFor(status)` maps onto it without re-deriving the classes.\n *\n * Requires the CSS variables `--color-{success,error,warning,info,neutral}-{bg,text}`,\n * which all six consuming apps already define.\n */\n\ntype BadgeVariant = 'success' | 'error' | 'warning' | 'info' | 'neutral';\n\n/** Layout and type scale, shared by every variant. */\nconst badgeBaseClass = 'inline-flex shrink-0 items-center rounded-md px-2 py-0.5 text-xs font-medium';\n\n/** The tone palette. `neutral` is the default: an unknown verdict is not a failure. */\nconst badgeVariantClass: Record<BadgeVariant, string> = {\n neutral: 'bg-[var(--color-neutral-bg)] text-[var(--color-neutral-text)]',\n success: 'bg-[var(--color-success-bg)] text-[var(--color-success-text)]',\n warning: 'bg-[var(--color-warning-bg)] text-[var(--color-warning-text)]',\n error: 'bg-[var(--color-error-bg)] text-[var(--color-error-text)]',\n info: 'bg-[var(--color-info-bg)] text-[var(--color-info-text)]',\n};\n\ninterface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n /** Tone; defaults to `neutral`. */\n variant?: BadgeVariant;\n}\n\nfunction Badge({ className, variant = 'neutral', ...rest }: Readonly<BadgeProps>): ReactElement {\n return <span className={cn(badgeBaseClass, badgeVariantClass[variant], className)} {...rest} />;\n}\n\n/**\n * The class string for a badge, for callers building the element themselves —\n * a `<button>` that looks like a badge, or a domain badge wrapper that adds\n * `t()`-translated children.\n */\nfunction badgeClass(variant: BadgeVariant = 'neutral', className?: string): string {\n return cn(badgeBaseClass, badgeVariantClass[variant], className);\n}\n\nexport { Badge, badgeBaseClass, badgeClass, badgeVariantClass };\nexport type { BadgeProps, BadgeVariant };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Badge.tsx"],
4
+ "sourcesContent": ["import type { HTMLAttributes, ReactElement } from 'react';\nimport { cn } from './utils.ts';\n\n/**\n * A status pill.\n *\n * ## Provenance\n *\n * `components/ui/Badge.tsx` in **CalDAV-Bridge**, **Durable-DAV**,\n * **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** — six\n * copies that agree on the base classes, the five variants, and the `neutral`\n * default. Edge-Sonic's is the best of them (its props spread onto the DOM\n * element, so a badge can carry `id`/`role`/`data-*`), so it is the shape here.\n *\n * The variants are *tones*, not statuses: every repo additionally carries a\n * stack of domain badges (`ConnectionBadge`, `VisibilityBadge`,\n * `TaskRunStatusBadge`, …) that map its own status vocabulary onto a tone and\n * translate a label with `t()`. Those are product vocabularies with\n * product-specific translation keys, so they stay with their apps — the kit\n * ships the tone layer and `badgeClass()` so a consumer's own\n * `variantFor(status)` maps onto it without re-deriving the classes.\n *\n * Requires the CSS variables `--color-{success,error,warning,info,neutral}-{bg,text}`,\n * which all six consuming apps already define.\n */\n\ntype BadgeVariant = 'success' | 'error' | 'warning' | 'info' | 'neutral';\n\n/**\nLayout and type scale, shared by every variant.\n*/\nconst badgeBaseClass = 'inline-flex shrink-0 items-center rounded-md px-2 py-0.5 text-xs font-medium';\n\n/**\nThe tone palette. `neutral` is the default: an unknown verdict is not a failure.\n*/\nconst badgeVariantClass: Record<BadgeVariant, string> = {\n neutral: 'bg-[var(--color-neutral-bg)] text-[var(--color-neutral-text)]',\n success: 'bg-[var(--color-success-bg)] text-[var(--color-success-text)]',\n warning: 'bg-[var(--color-warning-bg)] text-[var(--color-warning-text)]',\n error: 'bg-[var(--color-error-bg)] text-[var(--color-error-text)]',\n info: 'bg-[var(--color-info-bg)] text-[var(--color-info-text)]',\n};\n\ninterface BadgeProps extends HTMLAttributes<HTMLSpanElement> {\n /**\n Tone; defaults to `neutral`.\n */\n variant?: BadgeVariant;\n}\n\nfunction Badge({ className, variant = 'neutral', ...rest }: Readonly<BadgeProps>): ReactElement {\n return <span className={cn(badgeBaseClass, badgeVariantClass[variant], className)} {...rest} />;\n}\n\n/**\n * The class string for a badge, for callers building the element themselves —\n * a `<button>` that looks like a badge, or a domain badge wrapper that adds\n * `t()`-translated children.\n */\nfunction badgeClass(variant: BadgeVariant = 'neutral', className?: string): string {\n return cn(badgeBaseClass, badgeVariantClass[variant], className);\n}\n\nexport { Badge, badgeBaseClass, badgeClass, badgeVariantClass };\nexport type { BadgeProps, BadgeVariant };\n"],
5
+ "mappings": "wCACA,OAAS,MAAAA,MAAU,aA8BnB,MAAMC,EAAiB,+EAKjBC,EAAkD,CACtD,QAAS,gEACT,QAAS,gEACT,QAAS,gEACT,MAAO,4DACP,KAAM,2DAUR,SAASC,EAAM,CAAE,UAAAC,EAAW,QAAAC,EAAU,UAAW,GAAGC,CAAI,EAAwB,CAC9E,OAAOC,EAAA,OAAA,CAAM,UAAWP,EAAGC,EAAgBC,EAAkBG,CAAO,EAAGD,CAAS,EAAC,GAAME,CAAI,CAAA,CAC7F,CAOA,SAASE,EAAWH,EAAwB,UAAWD,EAAkB,CACvE,OAAOJ,EAAGC,EAAgBC,EAAkBG,CAAO,EAAGD,CAAS,CACjE",
6
+ "names": ["cn", "badgeBaseClass", "badgeVariantClass", "Badge", "className", "variant", "rest", "_jsx", "badgeClass"]
7
+ }
package/dist/Button.d.ts CHANGED
@@ -44,9 +44,13 @@ declare const buttonBaseClass = "inline-flex items-center justify-center gap-2 r
44
44
  declare const buttonVariantClass: Record<ButtonVariant, string>;
45
45
  declare const buttonSizeClass: Record<ButtonSize, string>;
46
46
  interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
47
- /** Visual weight; defaults to `secondary`. */
47
+ /**
48
+ Visual weight; defaults to `secondary`.
49
+ */
48
50
  variant?: ButtonVariant;
49
- /** Control size; defaults to `md`. */
51
+ /**
52
+ Control size; defaults to `md`.
53
+ */
50
54
  size?: ButtonSize;
51
55
  /**
52
56
  * Shows the spinner and blocks activation until it clears. A busy button is
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAc,YAAY,EAAE,MAAM,OAAO,CAAC;AAI5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,KAAK,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAClE,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC;;;GAGG;AACH,QAAA,MAAM,eAAe,0PACoO,CAAC;AAE1P,QAAA,MAAM,kBAAkB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAKrD,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAI/C,CAAC;AAEF,UAAU,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACnE,8CAA8C;IAC9C,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,sCAAsC;IACtC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAqB,EACrB,IAAW,EACX,OAAe,EACf,QAAgB,EAChB,QAAQ,EACR,OAAO,EACP,IAAe,EACf,GAAG,IAAI,EACR,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,YAAY,CAuBtC;AAED;;;GAGG;AACH,iBAAS,WAAW,CAClB,EAAE,OAAqB,EAAE,IAAW,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,aAAa,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAA;CAAO,EAC3F,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAER;AAED,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AACrF,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAc,YAAY,EAAE,MAAM,OAAO,CAAC;AAI5E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,KAAK,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAClE,KAAK,UAAU,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAErC;;;GAGG;AACH,QAAA,MAAM,eAAe,0PACoO,CAAC;AAE1P,QAAA,MAAM,kBAAkB,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAKrD,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAI/C,CAAC;AAEF,UAAU,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;IACnE;;MAEE;IACF,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;MAEE;IACF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAqB,EACrB,IAAW,EACX,OAAe,EACf,QAAgB,EAChB,QAAQ,EACR,OAAO,EACP,IAAe,EACf,GAAG,IAAI,EACR,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,YAAY,CAuBtC;AAED;;;GAGG;AACH,iBAAS,WAAW,CAClB,EAAE,OAAqB,EAAE,IAAW,EAAE,GAAE;IAAE,OAAO,CAAC,EAAE,aAAa,CAAC;IAAC,IAAI,CAAC,EAAE,UAAU,CAAA;CAAO,EAC3F,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAER;AAED,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AACrF,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC"}
package/dist/Button.js CHANGED
@@ -1,39 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from "./utils.js";
3
- import { Spinner } from "./Spinner.js";
4
- /**
5
- * Layout and focus affordance. The focus ring is on `focus-visible`, so a
6
- * pointer press does not paint it and a keyboard press always does.
7
- */
8
- const buttonBaseClass = 'inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium transition-colors duration-150 disabled:opacity-50 disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]';
9
- const buttonVariantClass = {
10
- primary: 'bg-[var(--color-accent)] text-[#0d1008] hover:bg-[var(--color-accent-dim)]',
11
- secondary: 'bg-[var(--color-surface-3)] text-[var(--color-text-primary)] hover:bg-[var(--color-surface-4)]',
12
- ghost: 'bg-transparent text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-3)] hover:text-[var(--color-text-primary)]',
13
- danger: 'bg-[var(--color-error-bg)] text-[var(--color-error-text)] hover:brightness-125',
14
- };
15
- const buttonSizeClass = {
16
- sm: 'px-3 py-1.5 text-xs',
17
- md: 'px-4 py-2',
18
- lg: 'px-5 py-2.5 text-base',
19
- };
20
- function Button({ className, variant = 'secondary', size = 'md', loading = false, disabled = false, children, onClick, type = 'button', ...rest }) {
21
- const handleClick = (event) => {
22
- // Belt and braces: `disabled` already stops a real pointer or key press,
23
- // and this stops a synthesized event from re-entering an in-flight action.
24
- if (disabled || loading) {
25
- return;
26
- }
27
- onClick?.(event);
28
- };
29
- return (_jsxs("button", { type: type, className: cn(buttonBaseClass, buttonVariantClass[variant], buttonSizeClass[size], className), disabled: disabled || loading, "aria-busy": loading || undefined, onClick: handleClick, ...rest, children: [loading ? _jsx(Spinner, { size: 16, color: "currentColor", padding: "0" }) : null, children] }));
30
- }
31
- /**
32
- * The class string for a button, for callers rendering the element themselves —
33
- * a link styled as a button, or a toolbar control that is not a `<button>`.
34
- */
35
- function buttonClass({ variant = 'secondary', size = 'md' } = {}, className) {
36
- return cn(buttonBaseClass, buttonVariantClass[variant], buttonSizeClass[size], className);
37
- }
38
- export { Button, buttonBaseClass, buttonClass, buttonSizeClass, buttonVariantClass };
39
- //# sourceMappingURL=Button.js.map
1
+ import{jsx as v,jsxs as m}from"react/jsx-runtime";import{cn as i}from"./utils.js";import{Spinner as f}from"./Spinner.js";const n="inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium transition-colors duration-150 disabled:opacity-50 disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]",s={primary:"bg-[var(--color-accent)] text-[#0d1008] hover:bg-[var(--color-accent-dim)]",secondary:"bg-[var(--color-surface-3)] text-[var(--color-text-primary)] hover:bg-[var(--color-surface-4)]",ghost:"bg-transparent text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-3)] hover:text-[var(--color-text-primary)]",danger:"bg-[var(--color-error-bg)] text-[var(--color-error-text)] hover:brightness-125"},a={sm:"px-3 py-1.5 text-xs",md:"px-4 py-2",lg:"px-5 py-2.5 text-base"};function g({className:t,variant:e="secondary",size:o="md",loading:r=!1,disabled:c=!1,children:l,onClick:u,type:b="button",...x}){const d=p=>{c||r||u?.(p)};return m("button",{type:b,className:i(n,s[e],a[o],t),disabled:c||r,"aria-busy":r||void 0,onClick:d,...x,children:[r?v(f,{size:16,color:"currentColor",padding:"0"}):null,l]})}function y({variant:t="secondary",size:e="md"}={},o){return i(n,s[t],a[e],o)}export{g as Button,n as buttonBaseClass,y as buttonClass,a as buttonSizeClass,s as buttonVariantClass};
@@ -1 +1,7 @@
1
- {"version":3,"file":"Button.js","sourceRoot":"","sources":["../src/Button.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAe,CAAC;AAyCxC;;;GAGG;AACH,MAAM,eAAe,GACnB,uPAAuP,CAAC;AAE1P,MAAM,kBAAkB,GAAkC;IACxD,OAAO,EAAE,4EAA4E;IACrF,SAAS,EAAE,gGAAgG;IAC3G,KAAK,EAAE,4HAA4H;IACnI,MAAM,EAAE,gFAAgF;CACzF,CAAC;AAEF,MAAM,eAAe,GAA+B;IAClD,EAAE,EAAE,qBAAqB;IACzB,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,uBAAuB;CAC5B,CAAC;AAeF,SAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,GAAG,WAAW,EACrB,IAAI,GAAG,IAAI,EACX,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,QAAQ,EACR,OAAO,EACP,IAAI,GAAG,QAAQ,EACf,GAAG,IAAI,EACe;IACtB,MAAM,WAAW,GAAG,CAAC,KAAoC,EAAQ,EAAE;QACjE,yEAAyE;QACzE,2EAA2E;QAC3E,IAAI,QAAQ,IAAI,OAAO,EAAE,CAAC;YACxB,OAAO;QACT,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,CACL,kBACE,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,kBAAkB,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,EAC7F,QAAQ,EAAE,QAAQ,IAAI,OAAO,eAClB,OAAO,IAAI,SAAS,EAC/B,OAAO,EAAE,WAAW,KAChB,IAAI,aAEP,OAAO,CAAC,CAAC,CAAC,KAAC,OAAO,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,cAAc,EAAC,OAAO,EAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EACvE,QAAQ,IACF,CACV,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAClB,EAAE,OAAO,GAAG,WAAW,EAAE,IAAI,GAAG,IAAI,KAAqD,EAAE,EAC3F,SAAkB;IAElB,OAAO,EAAE,CAAC,eAAe,EAAE,kBAAkB,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CAAC;AAC5F,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import type { ButtonHTMLAttributes, MouseEvent, ReactElement } from 'react';\nimport { cn } from './utils.ts';\nimport { Spinner } from './Spinner.tsx';\n\n/**\n * The one button.\n *\n * ## Provenance\n *\n * `components/ui/Button.tsx` in **CalDAV-Bridge**, **Durable-DAV**,\n * **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** — six\n * copies written from one design, agreeing on the base classes, the four\n * variants (`primary`/`secondary`/`ghost`/`danger`) and the three sizes. The\n * differences that had to be settled:\n *\n * - **Default variant.** CalDAV-Bridge defaults to `primary`; the other five\n * default to `secondary`. The majority wins: a page of solid-coloured\n * buttons is noise, and `primary` should mark the one action that matters.\n * - **`type`.** Durable-DAV and Edge-Sonic default it to `button`; the others\n * leave the HTML default (`submit`) in place, so a `<Button>` inside a\n * `<form>` submits it. The explicit default is kept — it is the documented\n * fix, and a consumer that wants a submit button passes `type=\"submit\"`.\n * - **`ghost` hover.** Four repos hover to `--color-surface-3` with\n * `--color-text-secondary`; Edge-Sonic uses `surface-2`/`text-muted`. The\n * majority wins.\n * - **`danger` hover.** Four repos use `hover:brightness-125`; Edge-Sonic uses\n * `hover:opacity-90`. The majority wins.\n *\n * ## Loading\n *\n * Converged from **AWS-AccessBridge**'s `components/ui/LoadingButton.tsx`, the\n * one place the family tracked busy state itself. Its two behaviours fold\n * cleanly into this component's `loading` prop: the button is `disabled` while\n * loading (so neither a pointer, a keyboard, nor a screen reader can activate\n * it), *and* the click handler bails out, so a synthesized `click()` — which\n * jsdom and some test harnesses dispatch without honouring `disabled` — cannot\n * fire a second submission. The ring is this package's `Spinner`, which\n * inherits the button's text colour.\n */\n\ntype ButtonVariant = 'primary' | 'secondary' | 'danger' | 'ghost';\ntype ButtonSize = 'sm' | 'md' | 'lg';\n\n/**\n * Layout and focus affordance. The focus ring is on `focus-visible`, so a\n * pointer press does not paint it and a keyboard press always does.\n */\nconst buttonBaseClass =\n 'inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium transition-colors duration-150 disabled:opacity-50 disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]';\n\nconst buttonVariantClass: Record<ButtonVariant, string> = {\n primary: 'bg-[var(--color-accent)] text-[#0d1008] hover:bg-[var(--color-accent-dim)]',\n secondary: 'bg-[var(--color-surface-3)] text-[var(--color-text-primary)] hover:bg-[var(--color-surface-4)]',\n ghost: 'bg-transparent text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-3)] hover:text-[var(--color-text-primary)]',\n danger: 'bg-[var(--color-error-bg)] text-[var(--color-error-text)] hover:brightness-125',\n};\n\nconst buttonSizeClass: Record<ButtonSize, string> = {\n sm: 'px-3 py-1.5 text-xs',\n md: 'px-4 py-2',\n lg: 'px-5 py-2.5 text-base',\n};\n\ninterface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /** Visual weight; defaults to `secondary`. */\n variant?: ButtonVariant;\n /** Control size; defaults to `md`. */\n size?: ButtonSize;\n /**\n * Shows the spinner and blocks activation until it clears. A busy button is\n * a disabled button: the prop alone is enough, no `disabled` bookkeeping at\n * the call site.\n */\n loading?: boolean;\n}\n\nfunction Button({\n className,\n variant = 'secondary',\n size = 'md',\n loading = false,\n disabled = false,\n children,\n onClick,\n type = 'button',\n ...rest\n}: Readonly<ButtonProps>): ReactElement {\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n // Belt and braces: `disabled` already stops a real pointer or key press,\n // and this stops a synthesized event from re-entering an in-flight action.\n if (disabled || loading) {\n return;\n }\n onClick?.(event);\n };\n\n return (\n <button\n type={type}\n className={cn(buttonBaseClass, buttonVariantClass[variant], buttonSizeClass[size], className)}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n onClick={handleClick}\n {...rest}\n >\n {loading ? <Spinner size={16} color=\"currentColor\" padding=\"0\" /> : null}\n {children}\n </button>\n );\n}\n\n/**\n * The class string for a button, for callers rendering the element themselves —\n * a link styled as a button, or a toolbar control that is not a `<button>`.\n */\nfunction buttonClass(\n { variant = 'secondary', size = 'md' }: { variant?: ButtonVariant; size?: ButtonSize } = {},\n className?: string,\n): string {\n return cn(buttonBaseClass, buttonVariantClass[variant], buttonSizeClass[size], className);\n}\n\nexport { Button, buttonBaseClass, buttonClass, buttonSizeClass, buttonVariantClass };\nexport type { ButtonProps, ButtonSize, ButtonVariant };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Button.tsx"],
4
+ "sourcesContent": ["import type { ButtonHTMLAttributes, MouseEvent, ReactElement } from 'react';\nimport { cn } from './utils.ts';\nimport { Spinner } from './Spinner.tsx';\n\n/**\n * The one button.\n *\n * ## Provenance\n *\n * `components/ui/Button.tsx` in **CalDAV-Bridge**, **Durable-DAV**,\n * **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** — six\n * copies written from one design, agreeing on the base classes, the four\n * variants (`primary`/`secondary`/`ghost`/`danger`) and the three sizes. The\n * differences that had to be settled:\n *\n * - **Default variant.** CalDAV-Bridge defaults to `primary`; the other five\n * default to `secondary`. The majority wins: a page of solid-coloured\n * buttons is noise, and `primary` should mark the one action that matters.\n * - **`type`.** Durable-DAV and Edge-Sonic default it to `button`; the others\n * leave the HTML default (`submit`) in place, so a `<Button>` inside a\n * `<form>` submits it. The explicit default is kept — it is the documented\n * fix, and a consumer that wants a submit button passes `type=\"submit\"`.\n * - **`ghost` hover.** Four repos hover to `--color-surface-3` with\n * `--color-text-secondary`; Edge-Sonic uses `surface-2`/`text-muted`. The\n * majority wins.\n * - **`danger` hover.** Four repos use `hover:brightness-125`; Edge-Sonic uses\n * `hover:opacity-90`. The majority wins.\n *\n * ## Loading\n *\n * Converged from **AWS-AccessBridge**'s `components/ui/LoadingButton.tsx`, the\n * one place the family tracked busy state itself. Its two behaviours fold\n * cleanly into this component's `loading` prop: the button is `disabled` while\n * loading (so neither a pointer, a keyboard, nor a screen reader can activate\n * it), *and* the click handler bails out, so a synthesized `click()` — which\n * jsdom and some test harnesses dispatch without honouring `disabled` — cannot\n * fire a second submission. The ring is this package's `Spinner`, which\n * inherits the button's text colour.\n */\n\ntype ButtonVariant = 'primary' | 'secondary' | 'danger' | 'ghost';\ntype ButtonSize = 'sm' | 'md' | 'lg';\n\n/**\n * Layout and focus affordance. The focus ring is on `focus-visible`, so a\n * pointer press does not paint it and a keyboard press always does.\n */\nconst buttonBaseClass =\n 'inline-flex items-center justify-center gap-2 rounded-lg text-sm font-medium transition-colors duration-150 disabled:opacity-50 disabled:pointer-events-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-accent)]';\n\nconst buttonVariantClass: Record<ButtonVariant, string> = {\n primary: 'bg-[var(--color-accent)] text-[#0d1008] hover:bg-[var(--color-accent-dim)]',\n secondary: 'bg-[var(--color-surface-3)] text-[var(--color-text-primary)] hover:bg-[var(--color-surface-4)]',\n ghost: 'bg-transparent text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-3)] hover:text-[var(--color-text-primary)]',\n danger: 'bg-[var(--color-error-bg)] text-[var(--color-error-text)] hover:brightness-125',\n};\n\nconst buttonSizeClass: Record<ButtonSize, string> = {\n sm: 'px-3 py-1.5 text-xs',\n md: 'px-4 py-2',\n lg: 'px-5 py-2.5 text-base',\n};\n\ninterface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n Visual weight; defaults to `secondary`.\n */\n variant?: ButtonVariant;\n /**\n Control size; defaults to `md`.\n */\n size?: ButtonSize;\n /**\n * Shows the spinner and blocks activation until it clears. A busy button is\n * a disabled button: the prop alone is enough, no `disabled` bookkeeping at\n * the call site.\n */\n loading?: boolean;\n}\n\nfunction Button({\n className,\n variant = 'secondary',\n size = 'md',\n loading = false,\n disabled = false,\n children,\n onClick,\n type = 'button',\n ...rest\n}: Readonly<ButtonProps>): ReactElement {\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n // Belt and braces: `disabled` already stops a real pointer or key press,\n // and this stops a synthesized event from re-entering an in-flight action.\n if (disabled || loading) {\n return;\n }\n onClick?.(event);\n };\n\n return (\n <button\n type={type}\n className={cn(buttonBaseClass, buttonVariantClass[variant], buttonSizeClass[size], className)}\n disabled={disabled || loading}\n aria-busy={loading || undefined}\n onClick={handleClick}\n {...rest}\n >\n {loading ? <Spinner size={16} color=\"currentColor\" padding=\"0\" /> : null}\n {children}\n </button>\n );\n}\n\n/**\n * The class string for a button, for callers rendering the element themselves —\n * a link styled as a button, or a toolbar control that is not a `<button>`.\n */\nfunction buttonClass(\n { variant = 'secondary', size = 'md' }: { variant?: ButtonVariant; size?: ButtonSize } = {},\n className?: string,\n): string {\n return cn(buttonBaseClass, buttonVariantClass[variant], buttonSizeClass[size], className);\n}\n\nexport { Button, buttonBaseClass, buttonClass, buttonSizeClass, buttonVariantClass };\nexport type { ButtonProps, ButtonSize, ButtonVariant };\n"],
5
+ "mappings": "kDACA,OAAS,MAAAA,MAAU,aACnB,OAAS,WAAAC,MAAe,eA6CxB,MAAMC,EACJ,wPAEIC,EAAoD,CACxD,QAAS,6EACT,UAAW,iGACX,MAAO,6HACP,OAAQ,kFAGJC,EAA8C,CAClD,GAAI,sBACJ,GAAI,YACJ,GAAI,yBAoBN,SAASC,EAAO,CACd,UAAAC,EACA,QAAAC,EAAU,YACV,KAAAC,EAAO,KACP,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,SAAAC,EACA,QAAAC,EACA,KAAAC,EAAO,SACP,GAAGC,CAAI,EACe,CACtB,MAAMC,EAAeC,GAA8C,CAG7DN,GAAYD,GAGhBG,IAAUI,CAAK,CACjB,EAEA,OACEC,EAAA,SAAA,CACE,KAAMJ,EACN,UAAWb,EAAGE,EAAiBC,EAAmBI,CAAO,EAAGH,EAAgBI,CAAI,EAAGF,CAAS,EAC5F,SAAUI,GAAYD,EAAO,YAClBA,GAAW,OACtB,QAASM,EAAW,GAChBD,EAAI,SAAA,CAEPL,EAAUS,EAACjB,EAAO,CAAC,KAAM,GAAI,MAAM,eAAe,QAAQ,GAAG,CAAA,EAAM,KACnEU,CAAQ,CAAA,CAAA,CAGf,CAMA,SAASQ,EACP,CAAE,QAAAZ,EAAU,YAAa,KAAAC,EAAO,IAAI,EAAqD,CAAA,EACzFF,EAAkB,CAElB,OAAON,EAAGE,EAAiBC,EAAmBI,CAAO,EAAGH,EAAgBI,CAAI,EAAGF,CAAS,CAC1F",
6
+ "names": ["cn", "Spinner", "buttonBaseClass", "buttonVariantClass", "buttonSizeClass", "Button", "className", "variant", "size", "loading", "disabled", "children", "onClick", "type", "rest", "handleClick", "event", "_jsxs", "_jsx", "buttonClass"]
7
+ }
package/dist/Card.d.ts CHANGED
@@ -22,20 +22,23 @@ import type { HTMLAttributes, ReactElement } from 'react';
22
22
  * that needs a different level composes the class string it needs from
23
23
  * `cardTitleClass`.
24
24
  */
25
- /** The card surface. */
25
+ /**
26
+ The card surface.
27
+ */
26
28
  declare const cardClass = "rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-1)] p-5";
27
- interface CardProps extends HTMLAttributes<HTMLDivElement> {
28
- }
29
+ type CardProps = HTMLAttributes<HTMLDivElement>;
29
30
  declare function Card({ className, ...rest }: Readonly<CardProps>): ReactElement;
30
- /** The header row: title on the left, actions on the right. */
31
+ /**
32
+ The header row: title on the left, actions on the right.
33
+ */
31
34
  declare const cardHeaderClass = "mb-4 flex items-center justify-between gap-3";
32
- interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
33
- }
35
+ type CardHeaderProps = HTMLAttributes<HTMLDivElement>;
34
36
  declare function CardHeader({ className, ...rest }: Readonly<CardHeaderProps>): ReactElement;
35
- /** The card's title. Renders an `<h2>`; nested headings override the level via `role`. */
37
+ /**
38
+ The card's title. Renders an `<h2>`; nested headings override the level via `role`.
39
+ */
36
40
  declare const cardTitleClass = "text-lg font-semibold text-[var(--color-text-primary)]";
37
- interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {
38
- }
41
+ type CardTitleProps = HTMLAttributes<HTMLHeadingElement>;
39
42
  declare function CardTitle({ className, ...rest }: Readonly<CardTitleProps>): ReactElement;
40
43
  export { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle };
41
44
  export type { CardHeaderProps, CardProps, CardTitleProps };
@@ -1 +1 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../src/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,wBAAwB;AACxB,QAAA,MAAM,SAAS,mFAAmF,CAAC;AAEnG,UAAU,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAE7D,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,YAAY,CAEvE;AAED,+DAA+D;AAC/D,QAAA,MAAM,eAAe,iDAAiD,CAAC;AAEvE,UAAU,eAAgB,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAEnE,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,YAAY,CAEnF;AAED,0FAA0F;AAC1F,QAAA,MAAM,cAAc,2DAA2D,CAAC;AAEhF,UAAU,cAAe,SAAQ,cAAc,CAAC,kBAAkB,CAAC;CAAG;AAEtE,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,YAAY,CAEjF;AAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACnF,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC"}
1
+ {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../src/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;EAEE;AACF,QAAA,MAAM,SAAS,mFAAmF,CAAC;AAEnG,KAAK,SAAS,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEhD,iBAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,YAAY,CAEvE;AAED;;EAEE;AACF,QAAA,MAAM,eAAe,iDAAiD,CAAC;AAEvE,KAAK,eAAe,GAAG,cAAc,CAAC,cAAc,CAAC,CAAC;AAEtD,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,YAAY,CAEnF;AAED;;EAEE;AACF,QAAA,MAAM,cAAc,2DAA2D,CAAC;AAEhF,KAAK,cAAc,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC;AAEzD,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,YAAY,CAEjF;AAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;AACnF,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC"}
package/dist/Card.js CHANGED
@@ -1,42 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "./utils.js";
3
- /**
4
- * Surface primitives: `Card`, `CardHeader`, `CardTitle`.
5
- *
6
- * ## Provenance
7
- *
8
- * `components/ui/Card.tsx` in **CalDAV-Bridge**, **Durable-DAV**,
9
- * **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** — six
10
- * copies that are identical apart from Edge-Sonic's two improvements, both of
11
- * which are adopted here:
12
- *
13
- * 1. **Props spread onto the DOM element.** The other five take only
14
- * `className` and `children`, so a card that needs an `id`, a `role` or a
15
- * `data-testid` has to be wrapped in a redundant element.
16
- * 2. **The base classes live in one exported string** rather than being
17
- * re-spelled by `CardHeader`/`CardTitle`, so a change to the surface lands
18
- * once.
19
- *
20
- * `CardTitle` renders an `<h2>` in every copy. No copy in the family
21
- * parameterised the heading level, and inventing a `headingLevel` prop here
22
- * would strand the other six call sites, so the level stays fixed and a caller
23
- * that needs a different level composes the class string it needs from
24
- * `cardTitleClass`.
25
- */
26
- /** The card surface. */
27
- const cardClass = 'rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-1)] p-5';
28
- function Card({ className, ...rest }) {
29
- return _jsx("div", { className: cn(cardClass, className), ...rest });
30
- }
31
- /** The header row: title on the left, actions on the right. */
32
- const cardHeaderClass = 'mb-4 flex items-center justify-between gap-3';
33
- function CardHeader({ className, ...rest }) {
34
- return _jsx("div", { className: cn(cardHeaderClass, className), ...rest });
35
- }
36
- /** The card's title. Renders an `<h2>`; nested headings override the level via `role`. */
37
- const cardTitleClass = 'text-lg font-semibold text-[var(--color-text-primary)]';
38
- function CardTitle({ className, ...rest }) {
39
- return _jsx("h2", { className: cn(cardTitleClass, className), ...rest });
40
- }
41
- export { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle };
42
- //# sourceMappingURL=Card.js.map
1
+ import{jsx as t}from"react/jsx-runtime";import{cn as a}from"./utils.js";const o="rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-1)] p-5";function n({className:r,...e}){return t("div",{className:a(o,r),...e})}const s="mb-4 flex items-center justify-between gap-3";function d({className:r,...e}){return t("div",{className:a(s,r),...e})}const c="text-lg font-semibold text-[var(--color-text-primary)]";function l({className:r,...e}){return t("h2",{className:a(c,r),...e})}export{n as Card,d as CardHeader,l as CardTitle,o as cardClass,s as cardHeaderClass,c as cardTitleClass};
package/dist/Card.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"Card.js","sourceRoot":"","sources":["../src/Card.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,wBAAwB;AACxB,MAAM,SAAS,GAAG,gFAAgF,CAAC;AAInG,SAAS,IAAI,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAuB;IACvD,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,KAAM,IAAI,GAAI,CAAC;AAChE,CAAC;AAED,+DAA+D;AAC/D,MAAM,eAAe,GAAG,8CAA8C,CAAC;AAIvE,SAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAA6B;IACnE,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,SAAS,CAAC,KAAM,IAAI,GAAI,CAAC;AACtE,CAAC;AAED,0FAA0F;AAC1F,MAAM,cAAc,GAAG,wDAAwD,CAAC;AAIhF,SAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAA4B;IACjE,OAAO,aAAI,SAAS,EAAE,EAAE,CAAC,cAAc,EAAE,SAAS,CAAC,KAAM,IAAI,GAAI,CAAC;AACpE,CAAC;AAED,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC","sourcesContent":["import type { HTMLAttributes, ReactElement } from 'react';\nimport { cn } from './utils.ts';\n\n/**\n * Surface primitives: `Card`, `CardHeader`, `CardTitle`.\n *\n * ## Provenance\n *\n * `components/ui/Card.tsx` in **CalDAV-Bridge**, **Durable-DAV**,\n * **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** — six\n * copies that are identical apart from Edge-Sonic's two improvements, both of\n * which are adopted here:\n *\n * 1. **Props spread onto the DOM element.** The other five take only\n * `className` and `children`, so a card that needs an `id`, a `role` or a\n * `data-testid` has to be wrapped in a redundant element.\n * 2. **The base classes live in one exported string** rather than being\n * re-spelled by `CardHeader`/`CardTitle`, so a change to the surface lands\n * once.\n *\n * `CardTitle` renders an `<h2>` in every copy. No copy in the family\n * parameterised the heading level, and inventing a `headingLevel` prop here\n * would strand the other six call sites, so the level stays fixed and a caller\n * that needs a different level composes the class string it needs from\n * `cardTitleClass`.\n */\n\n/** The card surface. */\nconst cardClass = 'rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-1)] p-5';\n\ninterface CardProps extends HTMLAttributes<HTMLDivElement> {}\n\nfunction Card({ className, ...rest }: Readonly<CardProps>): ReactElement {\n return <div className={cn(cardClass, className)} {...rest} />;\n}\n\n/** The header row: title on the left, actions on the right. */\nconst cardHeaderClass = 'mb-4 flex items-center justify-between gap-3';\n\ninterface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {}\n\nfunction CardHeader({ className, ...rest }: Readonly<CardHeaderProps>): ReactElement {\n return <div className={cn(cardHeaderClass, className)} {...rest} />;\n}\n\n/** The card's title. Renders an `<h2>`; nested headings override the level via `role`. */\nconst cardTitleClass = 'text-lg font-semibold text-[var(--color-text-primary)]';\n\ninterface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {}\n\nfunction CardTitle({ className, ...rest }: Readonly<CardTitleProps>): ReactElement {\n return <h2 className={cn(cardTitleClass, className)} {...rest} />;\n}\n\nexport { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle };\nexport type { CardHeaderProps, CardProps, CardTitleProps };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/Card.tsx"],
4
+ "sourcesContent": ["import type { HTMLAttributes, ReactElement } from 'react';\nimport { cn } from './utils.ts';\n\n/**\n * Surface primitives: `Card`, `CardHeader`, `CardTitle`.\n *\n * ## Provenance\n *\n * `components/ui/Card.tsx` in **CalDAV-Bridge**, **Durable-DAV**,\n * **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** — six\n * copies that are identical apart from Edge-Sonic's two improvements, both of\n * which are adopted here:\n *\n * 1. **Props spread onto the DOM element.** The other five take only\n * `className` and `children`, so a card that needs an `id`, a `role` or a\n * `data-testid` has to be wrapped in a redundant element.\n * 2. **The base classes live in one exported string** rather than being\n * re-spelled by `CardHeader`/`CardTitle`, so a change to the surface lands\n * once.\n *\n * `CardTitle` renders an `<h2>` in every copy. No copy in the family\n * parameterised the heading level, and inventing a `headingLevel` prop here\n * would strand the other six call sites, so the level stays fixed and a caller\n * that needs a different level composes the class string it needs from\n * `cardTitleClass`.\n */\n\n/**\nThe card surface.\n*/\nconst cardClass = 'rounded-xl border border-[var(--color-border)] bg-[var(--color-surface-1)] p-5';\n\ntype CardProps = HTMLAttributes<HTMLDivElement>;\n\nfunction Card({ className, ...rest }: Readonly<CardProps>): ReactElement {\n return <div className={cn(cardClass, className)} {...rest} />;\n}\n\n/**\nThe header row: title on the left, actions on the right.\n*/\nconst cardHeaderClass = 'mb-4 flex items-center justify-between gap-3';\n\ntype CardHeaderProps = HTMLAttributes<HTMLDivElement>;\n\nfunction CardHeader({ className, ...rest }: Readonly<CardHeaderProps>): ReactElement {\n return <div className={cn(cardHeaderClass, className)} {...rest} />;\n}\n\n/**\nThe card's title. Renders an `<h2>`; nested headings override the level via `role`.\n*/\nconst cardTitleClass = 'text-lg font-semibold text-[var(--color-text-primary)]';\n\ntype CardTitleProps = HTMLAttributes<HTMLHeadingElement>;\n\nfunction CardTitle({ className, ...rest }: Readonly<CardTitleProps>): ReactElement {\n return <h2 className={cn(cardTitleClass, className)} {...rest} />;\n}\n\nexport { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle };\nexport type { CardHeaderProps, CardProps, CardTitleProps };\n"],
5
+ "mappings": "wCACA,OAAS,MAAAA,MAAU,aA6BnB,MAAMC,EAAY,iFAIlB,SAASC,EAAK,CAAE,UAAAC,EAAW,GAAGC,CAAI,EAAuB,CACvD,OAAOC,EAAA,MAAA,CAAK,UAAWL,EAAGC,EAAWE,CAAS,EAAC,GAAMC,CAAI,CAAA,CAC3D,CAKA,MAAME,EAAkB,+CAIxB,SAASC,EAAW,CAAE,UAAAJ,EAAW,GAAGC,CAAI,EAA6B,CACnE,OAAOC,EAAA,MAAA,CAAK,UAAWL,EAAGM,EAAiBH,CAAS,EAAC,GAAMC,CAAI,CAAA,CACjE,CAKA,MAAMI,EAAiB,yDAIvB,SAASC,EAAU,CAAE,UAAAN,EAAW,GAAGC,CAAI,EAA4B,CACjE,OAAOC,EAAA,KAAA,CAAI,UAAWL,EAAGQ,EAAgBL,CAAS,EAAC,GAAMC,CAAI,CAAA,CAC/D",
6
+ "names": ["cn", "cardClass", "Card", "className", "rest", "_jsx", "cardHeaderClass", "CardHeader", "cardTitleClass", "CardTitle"]
7
+ }
@@ -30,11 +30,17 @@ interface ContextBarProps {
30
30
  * not be omittable. Pass an empty node only if a route genuinely has no home.
31
31
  */
32
32
  home: ReactNode;
33
- /** The current location's name. Usually a `Link` or breadcrumb segment. */
33
+ /**
34
+ The current location's name. Usually a `Link` or breadcrumb segment.
35
+ */
34
36
  crumb: ReactNode;
35
- /** Right-aligned controls — refresh, settings, a sign-out button. */
37
+ /**
38
+ Right-aligned controls — refresh, settings, a sign-out button.
39
+ */
36
40
  actions?: ReactNode;
37
- /** Merged last onto the bar's outer element. */
41
+ /**
42
+ Merged last onto the bar's outer element.
43
+ */
38
44
  className?: string;
39
45
  }
40
46
  declare function ContextBar({ home, crumb, actions, className }: Readonly<ContextBarProps>): import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"ContextBar.d.ts","sourceRoot":"","sources":["../src/ContextBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,UAAU,eAAe;IACvB;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,2EAA2E;IAC3E,KAAK,EAAE,SAAS,CAAC;IACjB,qEAAqE;IACrE,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,+BAgBjF;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"ContextBar.d.ts","sourceRoot":"","sources":["../src/ContextBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,UAAU,eAAe;IACvB;;;;;;OAMG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB;;MAEE;IACF,KAAK,EAAE,SAAS,CAAC;IACjB;;MAEE;IACF,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB;;MAEE;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,iBAAS,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,+BAgBjF;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -1,7 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from "./utils.js";
3
- function ContextBar({ home, crumb, actions, className }) {
4
- return (_jsx("div", { className: cn('sticky top-0 z-40 border-b border-[var(--color-border)] bg-[var(--color-surface-1)]/95 backdrop-blur', className), children: _jsxs("div", { className: "max-w-7xl mx-auto px-6 py-3 flex items-center gap-3 flex-wrap", children: [home, _jsx("span", { "aria-hidden": "true", className: "text-[var(--color-text-muted)] font-normal", children: "/" }), _jsx("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: crumb }), actions && _jsx("div", { className: "ml-auto flex items-center gap-2 shrink-0", children: actions })] }) }));
5
- }
6
- export { ContextBar };
7
- //# sourceMappingURL=ContextBar.js.map
1
+ import{jsx as e,jsxs as l}from"react/jsx-runtime";import{cn as o}from"./utils.js";function c({home:a,crumb:s,actions:r,className:t}){return e("div",{className:o("sticky top-0 z-40 border-b border-[var(--color-border)] bg-[var(--color-surface-1)]/95 backdrop-blur",t),children:l("div",{className:"max-w-7xl mx-auto px-6 py-3 flex items-center gap-3 flex-wrap",children:[a,e("span",{"aria-hidden":"true",className:"text-[var(--color-text-muted)] font-normal",children:"/"}),e("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:s}),r&&e("div",{className:"ml-auto flex items-center gap-2 shrink-0",children:r})]})})}export{c as ContextBar};
@@ -1 +1,7 @@
1
- {"version":3,"file":"ContextBar.js","sourceRoot":"","sources":["../src/ContextBar.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AA0ChC,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAA6B;IAChF,OAAO,CACL,cAAK,SAAS,EAAE,EAAE,CAAC,sGAAsG,EAAE,SAAS,CAAC,YACnI,eAAK,SAAS,EAAC,+DAA+D,aAC3E,IAAI,EAIL,8BAAkB,MAAM,EAAC,SAAS,EAAC,4CAA4C,kBAExE,EACP,cAAK,SAAS,EAAC,wCAAwC,YAAE,KAAK,GAAO,EACpE,OAAO,IAAI,cAAK,SAAS,EAAC,0CAA0C,YAAE,OAAO,GAAO,IACjF,GACF,CACP,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import type { ReactNode } from 'react';\nimport { cn } from './utils.ts';\n\n/**\n * The sticky bar every non-root page renders.\n *\n * ## Provenance\n *\n * `components/layout/ContextBar.tsx` in **Durable-DAV**, **Durable-DAV-Router**\n * and **Edge-Git** — three copies differing only in the logo and the\n * `aria-label` on the home link.\n *\n * ## Why `home` is a node and not a `<Link>`\n *\n * All three imports `react-router-dom`, solely to wrap a logo in a `Link` to\n * `/`. That is the whole of their router coupling — and it is why none of them\n * could be lifted into a package the kit's other seven stay clear of, and why\n * a repo on a different router could not use the bar at all.\n *\n * So the caller renders the anchor and passes it in. The bar keeps the part\n * that was genuinely duplicated (the sticky geometry, the breadcrumb slot, the\n * right-aligned actions) and gives up the part that was a routing assumption.\n * The caller also owns the link's accessible name, which is the one thing that\n * genuinely differs between the three copies and could not have been defaulted.\n */\n\ninterface ContextBarProps {\n /**\n * The home link, already rendered by the caller.\n *\n * Required, even though the bar is usable without one: a bar with no way back\n * to the root is the failure this component exists to prevent, so it should\n * not be omittable. Pass an empty node only if a route genuinely has no home.\n */\n home: ReactNode;\n /** The current location's name. Usually a `Link` or breadcrumb segment. */\n crumb: ReactNode;\n /** Right-aligned controls — refresh, settings, a sign-out button. */\n actions?: ReactNode;\n /** Merged last onto the bar's outer element. */\n className?: string;\n}\n\nfunction ContextBar({ home, crumb, actions, className }: Readonly<ContextBarProps>) {\n return (\n <div className={cn('sticky top-0 z-40 border-b border-[var(--color-border)] bg-[var(--color-surface-1)]/95 backdrop-blur', className)}>\n <div className=\"max-w-7xl mx-auto px-6 py-3 flex items-center gap-3 flex-wrap\">\n {home}\n {/* Decorative: the breadcrumb and the home link already separate these\n regions for a screen reader, and a stray \"/\" read aloud between them\n is noise. */}\n <span aria-hidden=\"true\" className=\"text-[var(--color-text-muted)] font-normal\">\n /\n </span>\n <div className=\"flex items-center gap-2 min-w-0 flex-1\">{crumb}</div>\n {actions && <div className=\"ml-auto flex items-center gap-2 shrink-0\">{actions}</div>}\n </div>\n </div>\n );\n}\n\nexport { ContextBar };\nexport type { ContextBarProps };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/ContextBar.tsx"],
4
+ "sourcesContent": ["import type { ReactNode } from 'react';\nimport { cn } from './utils.ts';\n\n/**\n * The sticky bar every non-root page renders.\n *\n * ## Provenance\n *\n * `components/layout/ContextBar.tsx` in **Durable-DAV**, **Durable-DAV-Router**\n * and **Edge-Git** — three copies differing only in the logo and the\n * `aria-label` on the home link.\n *\n * ## Why `home` is a node and not a `<Link>`\n *\n * All three imports `react-router-dom`, solely to wrap a logo in a `Link` to\n * `/`. That is the whole of their router coupling — and it is why none of them\n * could be lifted into a package the kit's other seven stay clear of, and why\n * a repo on a different router could not use the bar at all.\n *\n * So the caller renders the anchor and passes it in. The bar keeps the part\n * that was genuinely duplicated (the sticky geometry, the breadcrumb slot, the\n * right-aligned actions) and gives up the part that was a routing assumption.\n * The caller also owns the link's accessible name, which is the one thing that\n * genuinely differs between the three copies and could not have been defaulted.\n */\n\ninterface ContextBarProps {\n /**\n * The home link, already rendered by the caller.\n *\n * Required, even though the bar is usable without one: a bar with no way back\n * to the root is the failure this component exists to prevent, so it should\n * not be omittable. Pass an empty node only if a route genuinely has no home.\n */\n home: ReactNode;\n /**\n The current location's name. Usually a `Link` or breadcrumb segment.\n */\n crumb: ReactNode;\n /**\n Right-aligned controls — refresh, settings, a sign-out button.\n */\n actions?: ReactNode;\n /**\n Merged last onto the bar's outer element.\n */\n className?: string;\n}\n\nfunction ContextBar({ home, crumb, actions, className }: Readonly<ContextBarProps>) {\n return (\n <div className={cn('sticky top-0 z-40 border-b border-[var(--color-border)] bg-[var(--color-surface-1)]/95 backdrop-blur', className)}>\n <div className=\"max-w-7xl mx-auto px-6 py-3 flex items-center gap-3 flex-wrap\">\n {home}\n {/* Decorative: the breadcrumb and the home link already separate these\n regions for a screen reader, and a stray \"/\" read aloud between them\n is noise. */}\n <span aria-hidden=\"true\" className=\"text-[var(--color-text-muted)] font-normal\">\n /\n </span>\n <div className=\"flex items-center gap-2 min-w-0 flex-1\">{crumb}</div>\n {actions && <div className=\"ml-auto flex items-center gap-2 shrink-0\">{actions}</div>}\n </div>\n </div>\n );\n}\n\nexport { ContextBar };\nexport type { ContextBarProps };\n"],
5
+ "mappings": "kDACA,OAAS,MAAAA,MAAU,aAgDnB,SAASC,EAAW,CAAE,KAAAC,EAAM,MAAAC,EAAO,QAAAC,EAAS,UAAAC,CAAS,EAA6B,CAChF,OACEC,EAAA,MAAA,CAAK,UAAWN,EAAG,uGAAwGK,CAAS,EAAC,SACnIE,EAAA,MAAA,CAAK,UAAU,gEAA+D,SAAA,CAC3EL,EAIDI,EAAA,OAAA,CAAA,cAAkB,OAAO,UAAU,6CAA4C,SAAA,GAAA,CAAA,EAG/EA,EAAA,MAAA,CAAK,UAAU,yCAAwC,SAAEH,CAAK,CAAA,EAC7DC,GAAWE,EAAA,MAAA,CAAK,UAAU,2CAA0C,SAAEF,CAAO,CAAA,CAAO,CAAA,CAAA,CACjF,CAAA,CAGZ",
6
+ "names": ["cn", "ContextBar", "home", "crumb", "actions", "className", "_jsx", "_jsxs"]
7
+ }
@@ -24,8 +24,7 @@ import { type InputHTMLAttributes, type ReactElement } from 'react';
24
24
  * and a component-level `focus()` call in an effect would race the caller's own
25
25
  * focus management for no gain.
26
26
  */
27
- interface FocusInputProps extends InputHTMLAttributes<HTMLInputElement> {
28
- }
27
+ type FocusInputProps = InputHTMLAttributes<HTMLInputElement>;
29
28
  declare function FocusInput({ style, onFocus, onBlur, ...rest }: Readonly<FocusInputProps>): ReactElement;
30
29
  export { FocusInput };
31
30
  export type { FocusInputProps };
@@ -1 +1 @@
1
- {"version":3,"file":"FocusInput.d.ts","sourceRoot":"","sources":["../src/FocusInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAInH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,UAAU,eAAgB,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;CAAG;AAE1E,iBAAS,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,YAAY,CAehG;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"FocusInput.d.ts","sourceRoot":"","sources":["../src/FocusInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAInH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,KAAK,eAAe,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;AAE7D,iBAAS,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,eAAe,CAAC,GAAG,YAAY,CAehG;AAED,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,eAAe,EAAE,CAAC"}
@@ -1,19 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useState } from 'react';
3
- import { Input } from "./Input.js";
4
- import { theme } from "./theme.js";
5
- function FocusInput({ style, onFocus, onBlur, ...rest }) {
6
- const [focused, setFocused] = useState(false);
7
- const focusStyle = { borderColor: focused ? theme.focusBorder : theme.border, ...style };
8
- const handleFocus = (event) => {
9
- setFocused(true);
10
- onFocus?.(event);
11
- };
12
- const handleBlur = (event) => {
13
- setFocused(false);
14
- onBlur?.(event);
15
- };
16
- return _jsx(Input, { ...rest, style: focusStyle, onFocus: handleFocus, onBlur: handleBlur });
17
- }
18
- export { FocusInput };
19
- //# sourceMappingURL=FocusInput.js.map
1
+ import{jsx as f}from"react/jsx-runtime";import{useState as d}from"react";import{Input as m}from"./Input.js";import{theme as e}from"./theme.js";function a({style:s,onFocus:t,onBlur:u,...n}){const[c,r]=d(!1),l={borderColor:c?e.focusBorder:e.border,...s};return f(m,{...n,style:l,onFocus:o=>{r(!0),t?.(o)},onBlur:o=>{r(!1),u?.(o)}})}export{a as FocusInput};
@@ -1 +1,7 @@
1
- {"version":3,"file":"FocusInput.js","sourceRoot":"","sources":["../src/FocusInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAoF,MAAM,OAAO,CAAC;AACnH,OAAO,EAAE,KAAK,EAAE,MAAM,YAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AA8BnC,SAAS,UAAU,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAA6B;IAChF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,UAAU,GAAkB,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;IAExG,MAAM,WAAW,GAAG,CAAC,KAAmC,EAAQ,EAAE;QAChE,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,CAAC,KAAmC,EAAQ,EAAE;QAC/D,UAAU,CAAC,KAAK,CAAC,CAAC;QAClB,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,KAAC,KAAK,OAAK,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAI,CAAC;AAC1F,CAAC;AAED,OAAO,EAAE,UAAU,EAAE,CAAC","sourcesContent":["import { useState, type CSSProperties, type FocusEvent, type InputHTMLAttributes, type ReactElement } from 'react';\nimport { Input } from './Input.tsx';\nimport { theme } from './theme.ts';\n\n/**\n * A text field that paints its border while it holds focus.\n *\n * ## Provenance\n *\n * `components/ui/FocusInput.tsx` in **AWS-AccessBridge** — the only copy in the\n * family, and the only AWS primitive still in active use after the Tailwind\n * repos' `Input` absorbed the focus treatment into its class list\n * (`focus:border-[var(--color-accent)]`). It is kept because the two mechanisms\n * are not equivalent for a consumer without Tailwind: the class version needs\n * the stylesheet, the inline version needs nothing.\n *\n * Two normalizations from the original:\n *\n * - It **renders `Input`**, so the field's base styling (padding, radius,\n * disabled opacity, placeholder colour) comes from the kit instead of a\n * second, drifting copy.\n * - It no longer re-spells `inputStyle`. The original built its own style\n * object and merged the caller's over it; this one passes `style` straight\n * through, which is the same contract with one less place to change.\n *\n * Auto-focus is the standard `autoFocus` attribute — React applies it on mount,\n * and a component-level `focus()` call in an effect would race the caller's own\n * focus management for no gain.\n */\n\ninterface FocusInputProps extends InputHTMLAttributes<HTMLInputElement> {}\n\nfunction FocusInput({ style, onFocus, onBlur, ...rest }: Readonly<FocusInputProps>): ReactElement {\n const [focused, setFocused] = useState(false);\n const focusStyle: CSSProperties = { borderColor: focused ? theme.focusBorder : theme.border, ...style };\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>): void => {\n setFocused(true);\n onFocus?.(event);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>): void => {\n setFocused(false);\n onBlur?.(event);\n };\n\n return <Input {...rest} style={focusStyle} onFocus={handleFocus} onBlur={handleBlur} />;\n}\n\nexport { FocusInput };\nexport type { FocusInputProps };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/FocusInput.tsx"],
4
+ "sourcesContent": ["import { useState, type CSSProperties, type FocusEvent, type InputHTMLAttributes, type ReactElement } from 'react';\nimport { Input } from './Input.tsx';\nimport { theme } from './theme.ts';\n\n/**\n * A text field that paints its border while it holds focus.\n *\n * ## Provenance\n *\n * `components/ui/FocusInput.tsx` in **AWS-AccessBridge** — the only copy in the\n * family, and the only AWS primitive still in active use after the Tailwind\n * repos' `Input` absorbed the focus treatment into its class list\n * (`focus:border-[var(--color-accent)]`). It is kept because the two mechanisms\n * are not equivalent for a consumer without Tailwind: the class version needs\n * the stylesheet, the inline version needs nothing.\n *\n * Two normalizations from the original:\n *\n * - It **renders `Input`**, so the field's base styling (padding, radius,\n * disabled opacity, placeholder colour) comes from the kit instead of a\n * second, drifting copy.\n * - It no longer re-spells `inputStyle`. The original built its own style\n * object and merged the caller's over it; this one passes `style` straight\n * through, which is the same contract with one less place to change.\n *\n * Auto-focus is the standard `autoFocus` attribute — React applies it on mount,\n * and a component-level `focus()` call in an effect would race the caller's own\n * focus management for no gain.\n */\n\ntype FocusInputProps = InputHTMLAttributes<HTMLInputElement>;\n\nfunction FocusInput({ style, onFocus, onBlur, ...rest }: Readonly<FocusInputProps>): ReactElement {\n const [focused, setFocused] = useState(false);\n const focusStyle: CSSProperties = { borderColor: focused ? theme.focusBorder : theme.border, ...style };\n\n const handleFocus = (event: FocusEvent<HTMLInputElement>): void => {\n setFocused(true);\n onFocus?.(event);\n };\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>): void => {\n setFocused(false);\n onBlur?.(event);\n };\n\n return <Input {...rest} style={focusStyle} onFocus={handleFocus} onBlur={handleBlur} />;\n}\n\nexport { FocusInput };\nexport type { FocusInputProps };\n"],
5
+ "mappings": "wCAAA,OAAS,YAAAA,MAAkG,QAC3G,OAAS,SAAAC,MAAa,aACtB,OAAS,SAAAC,MAAa,aA8BtB,SAASC,EAAW,CAAE,MAAAC,EAAO,QAAAC,EAAS,OAAAC,EAAQ,GAAGC,CAAI,EAA6B,CAChF,KAAM,CAACC,EAASC,CAAU,EAAIT,EAAS,EAAK,EACtCU,EAA4B,CAAE,YAAaF,EAAUN,EAAM,YAAcA,EAAM,OAAQ,GAAGE,CAAK,EAYrG,OAAOO,EAACV,EAAK,CAAA,GAAKM,EAAM,MAAOG,EAAY,QAVtBE,GAA6C,CAChEH,EAAW,EAAI,EACfJ,IAAUO,CAAK,CACjB,EAOiE,OAL7CA,GAA6C,CAC/DH,EAAW,EAAK,EAChBH,IAASM,CAAK,CAChB,CAEmF,CAAA,CACrF",
6
+ "names": ["useState", "Input", "theme", "FocusInput", "style", "onFocus", "onBlur", "rest", "focused", "setFocused", "focusStyle", "_jsx", "event"]
7
+ }
package/dist/Input.d.ts CHANGED
@@ -30,19 +30,20 @@ import type { InputHTMLAttributes, LabelHTMLAttributes, ReactElement, ReactNode,
30
30
  * spread through here, and a consumer whose design reddens the border on error
31
31
  * passes the class itself (`className={error ? 'border-[var(--color-error-text)]' : undefined}`).
32
32
  */
33
- /** The shared look of every text-entry control. */
33
+ /**
34
+ The shared look of every text-entry control.
35
+ */
34
36
  declare const fieldClass = "w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-base)] px-3 py-2 text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-muted)] transition-colors duration-150 focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-60";
35
- interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
36
- }
37
+ type InputProps = InputHTMLAttributes<HTMLInputElement>;
37
38
  declare function Input({ className, ...rest }: Readonly<InputProps>): ReactElement;
38
- interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
39
- }
39
+ type SelectProps = SelectHTMLAttributes<HTMLSelectElement>;
40
40
  declare function Select({ className, children, ...rest }: Readonly<SelectProps>): ReactElement;
41
- interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
42
- }
41
+ type TextareaProps = TextareaHTMLAttributes<HTMLTextAreaElement>;
43
42
  declare function Textarea({ className, ...rest }: Readonly<TextareaProps>): ReactElement;
44
43
  interface LabelProps extends Omit<LabelHTMLAttributes<HTMLLabelElement>, 'htmlFor'> {
45
- /** The `id` of the control this label names. */
44
+ /**
45
+ The `id` of the control this label names.
46
+ */
46
47
  htmlFor?: string;
47
48
  children: ReactNode;
48
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../src/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,OAAO,CAAC;AAGf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,mDAAmD;AACnD,QAAA,MAAM,UAAU,gSAC+Q,CAAC;AAEhS,UAAU,UAAW,SAAQ,mBAAmB,CAAC,gBAAgB,CAAC;CAAG;AAErE,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,YAAY,CAEzE;AAED,UAAU,WAAY,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC;CAAG;AAExE,iBAAS,MAAM,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,YAAY,CAMrF;AAED,UAAU,aAAc,SAAQ,sBAAsB,CAAC,mBAAmB,CAAC;CAAG;AAE9E,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,YAAY,CAE/E;AAED,UAAU,UAAW,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC;IACjF,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,YAAY,CAMjF;AAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../src/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,SAAS,EACT,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,OAAO,CAAC;AAGf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;EAEE;AACF,QAAA,MAAM,UAAU,gSAC+Q,CAAC;AAEhS,KAAK,UAAU,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,CAAC;AAExD,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,YAAY,CAEzE;AAED,KAAK,WAAW,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAE3D,iBAAS,MAAM,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,YAAY,CAMrF;AAED,KAAK,aAAa,GAAG,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;AAEjE,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,YAAY,CAE/E;AAED,UAAU,UAAW,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,SAAS,CAAC;IACjF;;MAEE;IACF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,iBAAS,KAAK,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,YAAY,CAMjF;AAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC"}
package/dist/Input.js CHANGED
@@ -1,49 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from "./utils.js";
3
- /**
4
- * Form controls: `Input`, `Select`, `Textarea`, `Label`.
5
- *
6
- * ## Provenance
7
- *
8
- * `components/ui/Input.tsx` in **CalDAV-Bridge**, **Durable-DAV**,
9
- * **Durable-DAV-Router**, **Edge-Git**, **Edge-Sonic** and **Mail-Otter** — six
10
- * copies that all export the same four controls and agree on the field classes
11
- * up to two drifting details, both settled the Edge-Sonic way:
12
- *
13
- * 1. **One shared class string** (`fieldClass`) instead of four re-spelled
14
- * copies. CalDAV-Bridge, Durable-DAV-Router, Edge-Git and Mail-Otter omit
15
- * `w-full` from their `Select`; CalDAV-Bridge's `Select`/`Label` and every
16
- * `Textarea` re-spell the field classes minus one property. A placeholder
17
- * colour that matches an input but not its select is a difference nobody
18
- * notices until a client is looking at both.
19
- * 2. **`htmlFor` is stated, not spread.** Edge-Sonic's `Label` takes `htmlFor`
20
- * and `children` explicitly, because a label with no `for` is announced as
21
- * unassociated text: the click target and the accessible name both depend
22
- * on it, and neither is visible in the markup that omits it.
23
- *
24
- * ## Error state
25
- *
26
- * None of the six copies carries an error state — each renders its field-level
27
- * error beside the input with its own markup (a `<p>` in `--color-error-text`,
28
- * or the app's notice bar), and none of them wires `aria-invalid`. Rather than
29
- * invent a sixth shape, the kit leaves the element to do what it already does:
30
- * `aria-invalid` and `aria-describedby` are standard input attributes and both
31
- * spread through here, and a consumer whose design reddens the border on error
32
- * passes the class itself (`className={error ? 'border-[var(--color-error-text)]' : undefined}`).
33
- */
34
- /** The shared look of every text-entry control. */
35
- const fieldClass = 'w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-base)] px-3 py-2 text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-muted)] transition-colors duration-150 focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-60';
36
- function Input({ className, ...rest }) {
37
- return _jsx("input", { className: cn(fieldClass, className), ...rest });
38
- }
39
- function Select({ className, children, ...rest }) {
40
- return (_jsx("select", { className: cn(fieldClass, className), ...rest, children: children }));
41
- }
42
- function Textarea({ className, ...rest }) {
43
- return _jsx("textarea", { className: cn(fieldClass, 'min-h-20 resize-y', className), ...rest });
44
- }
45
- function Label({ children, htmlFor, ...rest }) {
46
- return (_jsx("label", { htmlFor: htmlFor, className: "mb-1 block text-xs font-medium text-[var(--color-text-muted)]", ...rest, children: children }));
47
- }
48
- export { Input, Label, Select, Textarea, fieldClass };
49
- //# sourceMappingURL=Input.js.map
1
+ import{jsx as t}from"react/jsx-runtime";import{cn as c}from"./utils.js";const o="w-full rounded-lg border border-[var(--color-border)] bg-[var(--color-surface-base)] px-3 py-2 text-sm text-[var(--color-text-primary)] placeholder:text-[var(--color-text-muted)] transition-colors duration-150 focus:border-[var(--color-accent)] focus:outline-none disabled:opacity-60";function l({className:e,...r}){return t("input",{className:c(o,e),...r})}function n({className:e,children:r,...a}){return t("select",{className:c(o,e),...a,children:r})}function s({className:e,...r}){return t("textarea",{className:c(o,"min-h-20 resize-y",e),...r})}function i({children:e,htmlFor:r,...a}){return t("label",{htmlFor:r,className:"mb-1 block text-xs font-medium text-[var(--color-text-muted)]",...a,children:e})}export{l as Input,i as Label,n as Select,s as Textarea,o as fieldClass};