@rexezuge/web 1.2.0 → 1.4.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 (111) 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 +19 -7
  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 +7 -3
  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.d.ts +51 -51
  84. package/dist/index.d.ts.map +1 -1
  85. package/dist/index.js +1 -89
  86. package/dist/index.js.map +7 -1
  87. package/dist/theme.d.ts +24 -8
  88. package/dist/theme.d.ts.map +1 -1
  89. package/dist/theme.js +1 -134
  90. package/dist/theme.js.map +7 -1
  91. package/dist/useCopyToClipboard.d.ts +3 -1
  92. package/dist/useCopyToClipboard.d.ts.map +1 -1
  93. package/dist/useCopyToClipboard.js +1 -40
  94. package/dist/useCopyToClipboard.js.map +7 -1
  95. package/dist/useCurrentUser.d.ts +22 -8
  96. package/dist/useCurrentUser.d.ts.map +1 -1
  97. package/dist/useCurrentUser.js +1 -49
  98. package/dist/useCurrentUser.js.map +7 -1
  99. package/dist/useNotice.d.ts +21 -7
  100. package/dist/useNotice.d.ts.map +1 -1
  101. package/dist/useNotice.js +1 -34
  102. package/dist/useNotice.js.map +7 -1
  103. package/dist/useSpaLanguage.d.ts +27 -11
  104. package/dist/useSpaLanguage.d.ts.map +1 -1
  105. package/dist/useSpaLanguage.js +1 -149
  106. package/dist/useSpaLanguage.js.map +7 -1
  107. package/dist/utils.d.ts +6 -2
  108. package/dist/utils.d.ts.map +1 -1
  109. package/dist/utils.js +1 -346
  110. package/dist/utils.js.map +7 -1
  111. package/package.json +4 -4
package/dist/index.d.ts CHANGED
@@ -51,55 +51,55 @@
51
51
  * exactly one consumer, so each stays with it — see `constants.ts` and the
52
52
  * per-module provenance notes for the list.
53
53
  */
54
- export { Badge, badgeBaseClass, badgeClass, badgeVariantClass } from './Badge';
55
- export type { BadgeProps, BadgeVariant } from './Badge';
56
- export { Button, buttonBaseClass, buttonClass, buttonSizeClass, buttonVariantClass } from './Button';
57
- export type { ButtonProps, ButtonSize, ButtonVariant } from './Button';
58
- export { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle } from './Card';
59
- export type { CardHeaderProps, CardProps, CardTitleProps } from './Card';
60
- export { FocusInput } from './FocusInput';
61
- export type { FocusInputProps } from './FocusInput';
62
- export { Input, Label, Select, Textarea, fieldClass } from './Input';
63
- export type { InputProps, LabelProps, SelectProps, TextareaProps } from './Input';
64
- export { LoadingButton } from './LoadingButton';
65
- export type { LoadingButtonProps } from './LoadingButton';
66
- export { ModalShell } from './ModalShell';
67
- export type { ModalShellProps } from './ModalShell';
68
- export { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState';
69
- export { AppPage } from './AppPage';
70
- export type { AppPageProps, AppPageVariant } from './AppPage';
71
- export { PageHeaderCard } from './PageHeaderCard';
72
- export type { PageHeaderCardProps } from './PageHeaderCard';
73
- export { ContextBar } from './ContextBar';
74
- export type { ContextBarProps } from './ContextBar';
75
- export { Unauthorized } from './Unauthorized';
76
- export type { UnauthorizedProps } from './Unauthorized';
77
- export { NoticeBar } from './NoticeBar';
78
- export type { NoticeBarProps, NoticeStatusLabels } from './NoticeBar';
79
- export { LanguageSelector } from './LanguageSelector';
80
- export type { LanguageSelectorProps } from './LanguageSelector';
81
- export { RefreshButton } from './RefreshButton';
82
- export type { RefreshButtonProps } from './RefreshButton';
83
- export { ReadOnlyField } from './ReadOnlyField';
84
- export type { ReadOnlyFieldProps } from './ReadOnlyField';
85
- export { TypeToConfirmModal } from './TypeToConfirmModal';
86
- export type { TypeToConfirmModalProps } from './TypeToConfirmModal';
87
- export { useCopyToClipboard } from './useCopyToClipboard';
88
- export type { UseCopyToClipboardResult } from './useCopyToClipboard';
89
- export { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination';
90
- export type { PaginationLabels, PaginationProps } from './Pagination';
91
- export { Spinner } from './Spinner';
92
- export type { SpinnerProps } from './Spinner';
93
- export { btnBase, btnBlueStyle, btnGreenStyle, btnSmallStyle, buttonColors, cardStyle, inputStyle, paginationBtnStyle, tableCardStyle, tdStyle, theme, thStyle, } from './theme';
94
- export { cn } from './utils';
95
- export type { ClassDictionary, ClassValue } from './utils';
96
- export { COPY_FEEDBACK_TIMEOUT_MS, NOTICE_TIMEOUT_MS, ZERO_TRUST_AUTHENTICATION_PATH } from './constants';
97
- export { useNotice } from './useNotice';
98
- export type { Notice, NoticeKind, ShowNotice, UseNoticeOptions, UseNoticeResult } from './useNotice';
99
- export { canonicalizeLanguageTag, DEFAULT_FALLBACK_LANGUAGE, DEFAULT_LANGUAGE_STORAGE_KEY, DEFAULT_SUPPORTED_LANGUAGES, resolveLanguageTag, useSpaLanguage, } from './useSpaLanguage';
100
- export type { LanguageTag, UseSpaLanguageOptions, UseSpaLanguageResult } from './useSpaLanguage';
101
- export { CURRENT_USER_PATH, useCurrentUser } from './useCurrentUser';
102
- export type { CurrentUser, UseCurrentUserOptions, UseCurrentUserResult } from './useCurrentUser';
103
- export { buildQuery, createApiClient, HttpStatusError, MAX_ERROR_MESSAGE_LENGTH } from './api';
104
- export type { ApiClient, ApiRequestInit, CreateApiClientOptions, FetchFn, QueryParams, QueryValue } from './api';
54
+ export { Badge, badgeBaseClass, badgeClass, badgeVariantClass } from './Badge.tsx';
55
+ export type { BadgeProps, BadgeVariant } from './Badge.tsx';
56
+ export { Button, buttonBaseClass, buttonClass, buttonSizeClass, buttonVariantClass } from './Button.tsx';
57
+ export type { ButtonProps, ButtonSize, ButtonVariant } from './Button.tsx';
58
+ export { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle } from './Card.tsx';
59
+ export type { CardHeaderProps, CardProps, CardTitleProps } from './Card.tsx';
60
+ export { FocusInput } from './FocusInput.tsx';
61
+ export type { FocusInputProps } from './FocusInput.tsx';
62
+ export { Input, Label, Select, Textarea, fieldClass } from './Input.tsx';
63
+ export type { InputProps, LabelProps, SelectProps, TextareaProps } from './Input.tsx';
64
+ export { LoadingButton } from './LoadingButton.tsx';
65
+ export type { LoadingButtonProps } from './LoadingButton.tsx';
66
+ export { ModalShell } from './ModalShell.tsx';
67
+ export type { ModalShellProps } from './ModalShell.tsx';
68
+ export { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState.tsx';
69
+ export { AppPage } from './AppPage.tsx';
70
+ export type { AppPageProps, AppPageVariant } from './AppPage.tsx';
71
+ export { PageHeaderCard } from './PageHeaderCard.tsx';
72
+ export type { PageHeaderCardProps } from './PageHeaderCard.tsx';
73
+ export { ContextBar } from './ContextBar.tsx';
74
+ export type { ContextBarProps } from './ContextBar.tsx';
75
+ export { Unauthorized } from './Unauthorized.tsx';
76
+ export type { UnauthorizedProps } from './Unauthorized.tsx';
77
+ export { NoticeBar } from './NoticeBar.tsx';
78
+ export type { NoticeBarProps, NoticeStatusLabels } from './NoticeBar.tsx';
79
+ export { LanguageSelector } from './LanguageSelector.tsx';
80
+ export type { LanguageSelectorProps } from './LanguageSelector.tsx';
81
+ export { RefreshButton } from './RefreshButton.tsx';
82
+ export type { RefreshButtonProps } from './RefreshButton.tsx';
83
+ export { ReadOnlyField } from './ReadOnlyField.tsx';
84
+ export type { ReadOnlyFieldProps } from './ReadOnlyField.tsx';
85
+ export { TypeToConfirmModal } from './TypeToConfirmModal.tsx';
86
+ export type { TypeToConfirmModalProps } from './TypeToConfirmModal.tsx';
87
+ export { useCopyToClipboard } from './useCopyToClipboard.ts';
88
+ export type { UseCopyToClipboardResult } from './useCopyToClipboard.ts';
89
+ export { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination.tsx';
90
+ export type { PaginationLabels, PaginationProps } from './Pagination.tsx';
91
+ export { Spinner } from './Spinner.tsx';
92
+ export type { SpinnerProps } from './Spinner.tsx';
93
+ export { btnBase, btnBlueStyle, btnGreenStyle, btnSmallStyle, buttonColors, cardStyle, inputStyle, paginationBtnStyle, tableCardStyle, tdStyle, theme, thStyle, } from './theme.ts';
94
+ export { cn } from './utils.ts';
95
+ export type { ClassDictionary, ClassValue } from './utils.ts';
96
+ export { COPY_FEEDBACK_TIMEOUT_MS, NOTICE_TIMEOUT_MS, ZERO_TRUST_AUTHENTICATION_PATH } from './constants.ts';
97
+ export { useNotice } from './useNotice.ts';
98
+ export type { Notice, NoticeKind, ShowNotice, UseNoticeOptions, UseNoticeResult } from './useNotice.ts';
99
+ export { canonicalizeLanguageTag, DEFAULT_FALLBACK_LANGUAGE, DEFAULT_LANGUAGE_STORAGE_KEY, DEFAULT_SUPPORTED_LANGUAGES, resolveLanguageTag, useSpaLanguage, } from './useSpaLanguage.ts';
100
+ export type { LanguageTag, UseSpaLanguageOptions, UseSpaLanguageResult } from './useSpaLanguage.ts';
101
+ export { CURRENT_USER_PATH, useCurrentUser } from './useCurrentUser.ts';
102
+ export type { CurrentUser, UseCurrentUserOptions, UseCurrentUserResult } from './useCurrentUser.ts';
103
+ export { buildQuery, createApiClient, HttpStatusError, MAX_ERROR_MESSAGE_LENGTH } from './api.ts';
104
+ export type { ApiClient, ApiRequestInit, CreateApiClientOptions, FetchFn, QueryParams, QueryValue } from './api.ts';
105
105
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC/E,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAExD,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACrG,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEvE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACjG,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,KAA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,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEpG,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAClG,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,sBAAsB,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
package/dist/index.js CHANGED
@@ -1,89 +1 @@
1
- /**
2
- * `@rexezuge/web` — the SPA layer of the kit.
3
- *
4
- * React primitives, the hooks every app's shell needs, and the one API client.
5
- * Every export is the converged form of a framework that lived as copies inside
6
- * the nine consumer repos; see the `## Provenance` block at the top of each
7
- * module for what it replaced and which copy won.
8
- *
9
- * ```ts
10
- * import { AppPage, Button, Card, createApiClient, useCurrentUser, useNotice, useSpaLanguage } from '@rexezuge/web';
11
- * ```
12
- *
13
- * ## What a consumer must provide
14
- *
15
- * - **The CSS variables the class-based components read.** All six Tailwind
16
- * repos define the same set, so this is usually already present:
17
- * `--color-accent`, `--color-accent-dim`, `--color-border`,
18
- * `--color-surface-base`, `--color-surface-1..4`,
19
- * `--color-text-primary`, `--color-text-secondary`, `--color-text-muted`, and
20
- * `--color-{success,error,warning,info,neutral}-{bg,text}`.
21
- * - **`animate-spin`**, for `Spinner` (and therefore `Button`'s busy state).
22
- * Tailwind ships it; a non-Tailwind app defines the keyframes once.
23
- * - **A dependency on `@rexezuge/errors`**, which `api.ts` imports for
24
- * `ServiceError` and the status classes.
25
- *
26
- * ## Glyphs in, strings out
27
- *
28
- * Three components (`RefreshButton`, `ReadOnlyField`, `TypeToConfirmModal`) take
29
- * their icon from `lucide-react`, which is why it is a peer rather than a
30
- * dependency. Everything *sayable* is a prop: no component here calls
31
- * `useTranslation`, because the app rendering a dialog knows what it says and a
32
- * kit that hard-codes English for it has taken over the app's string catalogue.
33
- *
34
- * The dividing line is deliberate. `Button` keeps using this package's own
35
- * `Spinner` rather than lucide's `Loader2` — chrome is cheap to draw, iconography
36
- * is not, and vendoring a glyph's path data freezes it at whatever version was
37
- * current when it was copied.
38
- *
39
- * ## Migrating the copies
40
- *
41
- * `codemods/` rewrites the family's `../components/…` imports onto this package
42
- * for every component converged here, and names the ones it has not. Those
43
- * imports are **relative**, so this is a separate transform from the
44
- * `@scope/pkg` one — see `codemods/src/web-components.ts`.
45
- *
46
- * ## What is deliberately not here
47
- *
48
- * Domain badges (`ConnectionBadge`, `TaskRunStatusBadge`, …), the OAuth
49
- * `?oauth2=` notice seeding, the D1 bookmark header, WebDAV `207` handling, the
50
- * authed-first public fallback, and every app's `SUPPORTED_LANGUAGES`. Each had
51
- * exactly one consumer, so each stays with it — see `constants.ts` and the
52
- * per-module provenance notes for the list.
53
- */
54
- export { Badge, badgeBaseClass, badgeClass, badgeVariantClass } from './Badge';
55
- export { Button, buttonBaseClass, buttonClass, buttonSizeClass, buttonVariantClass } from './Button';
56
- export { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle } from './Card';
57
- export { FocusInput } from './FocusInput';
58
- export { Input, Label, Select, Textarea, fieldClass } from './Input';
59
- export { LoadingButton } from './LoadingButton';
60
- // Converged from the `ModalShell` / `ConfirmDeleteModal` / `PageState` copies
61
- // that Durable-DAV, Durable-DAV-Router, Mail-Otter and Edge-Git each shipped.
62
- // Deliberately dependency-free — labels are props, not `useTranslation` — so
63
- // adopting these does not require a translation library or an icon set.
64
- export { ModalShell } from './ModalShell';
65
- export { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState';
66
- // The second convergence round: page layout, the notice banner, the access
67
- // page, the language picker, and the two clipboard-bearing controls. Same rule
68
- // on labels — the app owns its string catalogue. Three of these need
69
- // `lucide-react`, which is why it is a peer and not a dependency.
70
- export { AppPage } from './AppPage';
71
- export { PageHeaderCard } from './PageHeaderCard';
72
- export { ContextBar } from './ContextBar';
73
- export { Unauthorized } from './Unauthorized';
74
- export { NoticeBar } from './NoticeBar';
75
- export { LanguageSelector } from './LanguageSelector';
76
- export { RefreshButton } from './RefreshButton';
77
- export { ReadOnlyField } from './ReadOnlyField';
78
- export { TypeToConfirmModal } from './TypeToConfirmModal';
79
- export { useCopyToClipboard } from './useCopyToClipboard';
80
- export { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination';
81
- export { Spinner } from './Spinner';
82
- export { btnBase, btnBlueStyle, btnGreenStyle, btnSmallStyle, buttonColors, cardStyle, inputStyle, paginationBtnStyle, tableCardStyle, tdStyle, theme, thStyle, } from './theme';
83
- export { cn } from './utils';
84
- export { COPY_FEEDBACK_TIMEOUT_MS, NOTICE_TIMEOUT_MS, ZERO_TRUST_AUTHENTICATION_PATH } from './constants';
85
- export { useNotice } from './useNotice';
86
- export { canonicalizeLanguageTag, DEFAULT_FALLBACK_LANGUAGE, DEFAULT_LANGUAGE_STORAGE_KEY, DEFAULT_SUPPORTED_LANGUAGES, resolveLanguageTag, useSpaLanguage, } from './useSpaLanguage';
87
- export { CURRENT_USER_PATH, useCurrentUser } from './useCurrentUser';
88
- export { buildQuery, createApiClient, HttpStatusError, MAX_ERROR_MESSAGE_LENGTH } from './api';
89
- //# sourceMappingURL=index.js.map
1
+ import{Badge as t,badgeBaseClass as o,badgeClass as a,badgeVariantClass as l}from"./Badge.js";import{Button as p,buttonBaseClass as s,buttonClass as m,buttonSizeClass as f,buttonVariantClass as C}from"./Button.js";import{Card as x,cardClass as i,cardHeaderClass as S,cardTitleClass as u,CardHeader as T,CardTitle as E}from"./Card.js";import{FocusInput as A}from"./FocusInput.js";import{Input as b,Label as L,Select as U,Textarea as c,fieldClass as y}from"./Input.js";import{LoadingButton as R}from"./LoadingButton.js";import{ModalShell as N}from"./ModalShell.js";import{ConfirmDeleteModal as M,EmptyState as P,LoadingSpinner as F}from"./PageState.js";import{AppPage as I}from"./AppPage.js";import{PageHeaderCard as h}from"./PageHeaderCard.js";import{ContextBar as K}from"./ContextBar.js";import{Unauthorized as Y}from"./Unauthorized.js";import{NoticeBar as w}from"./NoticeBar.js";import{LanguageSelector as W}from"./LanguageSelector.js";import{RefreshButton as Z}from"./RefreshButton.js";import{ReadOnlyField as k}from"./ReadOnlyField.js";import{TypeToConfirmModal as J}from"./TypeToConfirmModal.js";import{useCopyToClipboard as ee}from"./useCopyToClipboard.js";import{Pagination as te,clampPage as oe,pageCountFor as ae,pageWindow as le}from"./Pagination.js";import{Spinner as pe}from"./Spinner.js";import{btnBase as me,btnBlueStyle as fe,btnGreenStyle as Ce,btnSmallStyle as de,buttonColors as xe,cardStyle as ie,inputStyle as Se,paginationBtnStyle as ue,tableCardStyle as Te,tdStyle as Ee,theme as ge,thStyle as Ae}from"./theme.js";import{cn as be}from"./utils.js";import{COPY_FEEDBACK_TIMEOUT_MS as Ue,NOTICE_TIMEOUT_MS as ce,ZERO_TRUST_AUTHENTICATION_PATH as ye}from"./constants.js";import{useNotice as Re}from"./useNotice.js";import{canonicalizeLanguageTag as Ne,DEFAULT_FALLBACK_LANGUAGE as Oe,DEFAULT_LANGUAGE_STORAGE_KEY as Me,DEFAULT_SUPPORTED_LANGUAGES as Pe,resolveLanguageTag as Fe,useSpaLanguage as He}from"./useSpaLanguage.js";import{CURRENT_USER_PATH as De,useCurrentUser as he}from"./useCurrentUser.js";import{buildQuery as Ke,createApiClient as Ve,HttpStatusError as Ye,MAX_ERROR_MESSAGE_LENGTH as ve}from"./api.js";export{I as AppPage,t as Badge,p as Button,Ue as COPY_FEEDBACK_TIMEOUT_MS,De as CURRENT_USER_PATH,x as Card,T as CardHeader,E as CardTitle,M as ConfirmDeleteModal,K as ContextBar,Oe as DEFAULT_FALLBACK_LANGUAGE,Me as DEFAULT_LANGUAGE_STORAGE_KEY,Pe as DEFAULT_SUPPORTED_LANGUAGES,P as EmptyState,A as FocusInput,Ye as HttpStatusError,b as Input,L as Label,W as LanguageSelector,R as LoadingButton,F as LoadingSpinner,ve as MAX_ERROR_MESSAGE_LENGTH,N as ModalShell,ce as NOTICE_TIMEOUT_MS,w as NoticeBar,h as PageHeaderCard,te as Pagination,k as ReadOnlyField,Z as RefreshButton,U as Select,pe as Spinner,c as Textarea,J as TypeToConfirmModal,Y as Unauthorized,ye as ZERO_TRUST_AUTHENTICATION_PATH,o as badgeBaseClass,a as badgeClass,l as badgeVariantClass,me as btnBase,fe as btnBlueStyle,Ce as btnGreenStyle,de as btnSmallStyle,Ke as buildQuery,s as buttonBaseClass,m as buttonClass,xe as buttonColors,f as buttonSizeClass,C as buttonVariantClass,Ne as canonicalizeLanguageTag,i as cardClass,S as cardHeaderClass,ie as cardStyle,u as cardTitleClass,oe as clampPage,be as cn,Ve as createApiClient,y as fieldClass,Se as inputStyle,ae as pageCountFor,le as pageWindow,ue as paginationBtnStyle,Fe as resolveLanguageTag,Te as tableCardStyle,Ee as tdStyle,Ae as thStyle,ge as theme,ee as useCopyToClipboard,he as useCurrentUser,Re as useNotice,He as useSpaLanguage};
package/dist/index.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG/E,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGrG,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGjG,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAGrE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,8EAA8E;AAC9E,8EAA8E;AAC9E,6EAA6E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B,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC3B,kBAAkB,EAClB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGrE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC","sourcesContent":["/**\n * `@rexezuge/web` — the SPA layer of the kit.\n *\n * React primitives, the hooks every app's shell needs, and the one API client.\n * Every export is the converged form of a framework that lived as copies inside\n * the nine consumer repos; see the `## Provenance` block at the top of each\n * module for what it replaced and which copy won.\n *\n * ```ts\n * import { AppPage, Button, Card, createApiClient, useCurrentUser, useNotice, useSpaLanguage } from '@rexezuge/web';\n * ```\n *\n * ## What a consumer must provide\n *\n * - **The CSS variables the class-based components read.** All six Tailwind\n * repos define the same set, so this is usually already present:\n * `--color-accent`, `--color-accent-dim`, `--color-border`,\n * `--color-surface-base`, `--color-surface-1..4`,\n * `--color-text-primary`, `--color-text-secondary`, `--color-text-muted`, and\n * `--color-{success,error,warning,info,neutral}-{bg,text}`.\n * - **`animate-spin`**, for `Spinner` (and therefore `Button`'s busy state).\n * Tailwind ships it; a non-Tailwind app defines the keyframes once.\n * - **A dependency on `@rexezuge/errors`**, which `api.ts` imports for\n * `ServiceError` and the status classes.\n *\n * ## Glyphs in, strings out\n *\n * Three components (`RefreshButton`, `ReadOnlyField`, `TypeToConfirmModal`) take\n * their icon from `lucide-react`, which is why it is a peer rather than a\n * dependency. Everything *sayable* is a prop: no component here calls\n * `useTranslation`, because the app rendering a dialog knows what it says and a\n * kit that hard-codes English for it has taken over the app's string catalogue.\n *\n * The dividing line is deliberate. `Button` keeps using this package's own\n * `Spinner` rather than lucide's `Loader2` — chrome is cheap to draw, iconography\n * is not, and vendoring a glyph's path data freezes it at whatever version was\n * current when it was copied.\n *\n * ## Migrating the copies\n *\n * `codemods/` rewrites the family's `../components/…` imports onto this package\n * for every component converged here, and names the ones it has not. Those\n * imports are **relative**, so this is a separate transform from the\n * `@scope/pkg` one — see `codemods/src/web-components.ts`.\n *\n * ## What is deliberately not here\n *\n * Domain badges (`ConnectionBadge`, `TaskRunStatusBadge`, …), the OAuth\n * `?oauth2=` notice seeding, the D1 bookmark header, WebDAV `207` handling, the\n * authed-first public fallback, and every app's `SUPPORTED_LANGUAGES`. Each had\n * exactly one consumer, so each stays with it — see `constants.ts` and the\n * per-module provenance notes for the list.\n */\n\nexport { Badge, badgeBaseClass, badgeClass, badgeVariantClass } from './Badge';\nexport type { BadgeProps, BadgeVariant } from './Badge';\n\nexport { Button, buttonBaseClass, buttonClass, buttonSizeClass, buttonVariantClass } from './Button';\nexport type { ButtonProps, ButtonSize, ButtonVariant } from './Button';\n\nexport { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle } from './Card';\nexport type { CardHeaderProps, CardProps, CardTitleProps } from './Card';\n\nexport { FocusInput } from './FocusInput';\nexport type { FocusInputProps } from './FocusInput';\n\nexport { Input, Label, Select, Textarea, fieldClass } from './Input';\nexport type { InputProps, LabelProps, SelectProps, TextareaProps } from './Input';\n\nexport { LoadingButton } from './LoadingButton';\nexport type { LoadingButtonProps } from './LoadingButton';\n\n// Converged from the `ModalShell` / `ConfirmDeleteModal` / `PageState` copies\n// that Durable-DAV, Durable-DAV-Router, Mail-Otter and Edge-Git each shipped.\n// Deliberately dependency-free — labels are props, not `useTranslation` — so\n// adopting these does not require a translation library or an icon set.\nexport { ModalShell } from './ModalShell';\nexport type { ModalShellProps } from './ModalShell';\nexport { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState';\n\n// The second convergence round: page layout, the notice banner, the access\n// page, the language picker, and the two clipboard-bearing controls. Same rule\n// on labels — the app owns its string catalogue. Three of these need\n// `lucide-react`, which is why it is a peer and not a dependency.\nexport { AppPage } from './AppPage';\nexport type { AppPageProps, AppPageVariant } from './AppPage';\nexport { PageHeaderCard } from './PageHeaderCard';\nexport type { PageHeaderCardProps } from './PageHeaderCard';\nexport { ContextBar } from './ContextBar';\nexport type { ContextBarProps } from './ContextBar';\nexport { Unauthorized } from './Unauthorized';\nexport type { UnauthorizedProps } from './Unauthorized';\nexport { NoticeBar } from './NoticeBar';\nexport type { NoticeBarProps, NoticeStatusLabels } from './NoticeBar';\nexport { LanguageSelector } from './LanguageSelector';\nexport type { LanguageSelectorProps } from './LanguageSelector';\nexport { RefreshButton } from './RefreshButton';\nexport type { RefreshButtonProps } from './RefreshButton';\nexport { ReadOnlyField } from './ReadOnlyField';\nexport type { ReadOnlyFieldProps } from './ReadOnlyField';\nexport { TypeToConfirmModal } from './TypeToConfirmModal';\nexport type { TypeToConfirmModalProps } from './TypeToConfirmModal';\nexport { useCopyToClipboard } from './useCopyToClipboard';\nexport type { UseCopyToClipboardResult } from './useCopyToClipboard';\n\nexport { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination';\nexport type { PaginationLabels, PaginationProps } from './Pagination';\n\nexport { Spinner } from './Spinner';\nexport type { SpinnerProps } from './Spinner';\n\nexport {\n btnBase,\n btnBlueStyle,\n btnGreenStyle,\n btnSmallStyle,\n buttonColors,\n cardStyle,\n inputStyle,\n paginationBtnStyle,\n tableCardStyle,\n tdStyle,\n theme,\n thStyle,\n} from './theme';\n\nexport { cn } from './utils';\nexport type { ClassDictionary, ClassValue } from './utils';\n\nexport { COPY_FEEDBACK_TIMEOUT_MS, NOTICE_TIMEOUT_MS, ZERO_TRUST_AUTHENTICATION_PATH } from './constants';\n\nexport { useNotice } from './useNotice';\nexport type { Notice, NoticeKind, ShowNotice, UseNoticeOptions, UseNoticeResult } from './useNotice';\n\nexport {\n canonicalizeLanguageTag,\n DEFAULT_FALLBACK_LANGUAGE,\n DEFAULT_LANGUAGE_STORAGE_KEY,\n DEFAULT_SUPPORTED_LANGUAGES,\n resolveLanguageTag,\n useSpaLanguage,\n} from './useSpaLanguage';\nexport type { LanguageTag, UseSpaLanguageOptions, UseSpaLanguageResult } from './useSpaLanguage';\n\nexport { CURRENT_USER_PATH, useCurrentUser } from './useCurrentUser';\nexport type { CurrentUser, UseCurrentUserOptions, UseCurrentUserResult } from './useCurrentUser';\n\nexport { buildQuery, createApiClient, HttpStatusError, MAX_ERROR_MESSAGE_LENGTH } from './api';\nexport type { ApiClient, ApiRequestInit, CreateApiClientOptions, FetchFn, QueryParams, QueryValue } from './api';\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["/**\n * `@rexezuge/web` — the SPA layer of the kit.\n *\n * React primitives, the hooks every app's shell needs, and the one API client.\n * Every export is the converged form of a framework that lived as copies inside\n * the nine consumer repos; see the `## Provenance` block at the top of each\n * module for what it replaced and which copy won.\n *\n * ```ts\n * import { AppPage, Button, Card, createApiClient, useCurrentUser, useNotice, useSpaLanguage } from '@rexezuge/web';\n * ```\n *\n * ## What a consumer must provide\n *\n * - **The CSS variables the class-based components read.** All six Tailwind\n * repos define the same set, so this is usually already present:\n * `--color-accent`, `--color-accent-dim`, `--color-border`,\n * `--color-surface-base`, `--color-surface-1..4`,\n * `--color-text-primary`, `--color-text-secondary`, `--color-text-muted`, and\n * `--color-{success,error,warning,info,neutral}-{bg,text}`.\n * - **`animate-spin`**, for `Spinner` (and therefore `Button`'s busy state).\n * Tailwind ships it; a non-Tailwind app defines the keyframes once.\n * - **A dependency on `@rexezuge/errors`**, which `api.ts` imports for\n * `ServiceError` and the status classes.\n *\n * ## Glyphs in, strings out\n *\n * Three components (`RefreshButton`, `ReadOnlyField`, `TypeToConfirmModal`) take\n * their icon from `lucide-react`, which is why it is a peer rather than a\n * dependency. Everything *sayable* is a prop: no component here calls\n * `useTranslation`, because the app rendering a dialog knows what it says and a\n * kit that hard-codes English for it has taken over the app's string catalogue.\n *\n * The dividing line is deliberate. `Button` keeps using this package's own\n * `Spinner` rather than lucide's `Loader2` — chrome is cheap to draw, iconography\n * is not, and vendoring a glyph's path data freezes it at whatever version was\n * current when it was copied.\n *\n * ## Migrating the copies\n *\n * `codemods/` rewrites the family's `../components/…` imports onto this package\n * for every component converged here, and names the ones it has not. Those\n * imports are **relative**, so this is a separate transform from the\n * `@scope/pkg` one — see `codemods/src/web-components.ts`.\n *\n * ## What is deliberately not here\n *\n * Domain badges (`ConnectionBadge`, `TaskRunStatusBadge`, …), the OAuth\n * `?oauth2=` notice seeding, the D1 bookmark header, WebDAV `207` handling, the\n * authed-first public fallback, and every app's `SUPPORTED_LANGUAGES`. Each had\n * exactly one consumer, so each stays with it — see `constants.ts` and the\n * per-module provenance notes for the list.\n */\n\nexport { Badge, badgeBaseClass, badgeClass, badgeVariantClass } from './Badge.tsx';\nexport type { BadgeProps, BadgeVariant } from './Badge.tsx';\n\nexport { Button, buttonBaseClass, buttonClass, buttonSizeClass, buttonVariantClass } from './Button.tsx';\nexport type { ButtonProps, ButtonSize, ButtonVariant } from './Button.tsx';\n\nexport { Card, cardClass, cardHeaderClass, cardTitleClass, CardHeader, CardTitle } from './Card.tsx';\nexport type { CardHeaderProps, CardProps, CardTitleProps } from './Card.tsx';\n\nexport { FocusInput } from './FocusInput.tsx';\nexport type { FocusInputProps } from './FocusInput.tsx';\n\nexport { Input, Label, Select, Textarea, fieldClass } from './Input.tsx';\nexport type { InputProps, LabelProps, SelectProps, TextareaProps } from './Input.tsx';\n\nexport { LoadingButton } from './LoadingButton.tsx';\nexport type { LoadingButtonProps } from './LoadingButton.tsx';\n\n// Converged from the `ModalShell` / `ConfirmDeleteModal` / `PageState` copies\n// that Durable-DAV, Durable-DAV-Router, Mail-Otter and Edge-Git each shipped.\n// Deliberately dependency-free — labels are props, not `useTranslation` — so\n// adopting these does not require a translation library or an icon set.\nexport { ModalShell } from './ModalShell.tsx';\nexport type { ModalShellProps } from './ModalShell.tsx';\nexport { ConfirmDeleteModal, EmptyState, LoadingSpinner } from './PageState.tsx';\n\n// The second convergence round: page layout, the notice banner, the access\n// page, the language picker, and the two clipboard-bearing controls. Same rule\n// on labels — the app owns its string catalogue. Three of these need\n// `lucide-react`, which is why it is a peer and not a dependency.\nexport { AppPage } from './AppPage.tsx';\nexport type { AppPageProps, AppPageVariant } from './AppPage.tsx';\nexport { PageHeaderCard } from './PageHeaderCard.tsx';\nexport type { PageHeaderCardProps } from './PageHeaderCard.tsx';\nexport { ContextBar } from './ContextBar.tsx';\nexport type { ContextBarProps } from './ContextBar.tsx';\nexport { Unauthorized } from './Unauthorized.tsx';\nexport type { UnauthorizedProps } from './Unauthorized.tsx';\nexport { NoticeBar } from './NoticeBar.tsx';\nexport type { NoticeBarProps, NoticeStatusLabels } from './NoticeBar.tsx';\nexport { LanguageSelector } from './LanguageSelector.tsx';\nexport type { LanguageSelectorProps } from './LanguageSelector.tsx';\nexport { RefreshButton } from './RefreshButton.tsx';\nexport type { RefreshButtonProps } from './RefreshButton.tsx';\nexport { ReadOnlyField } from './ReadOnlyField.tsx';\nexport type { ReadOnlyFieldProps } from './ReadOnlyField.tsx';\nexport { TypeToConfirmModal } from './TypeToConfirmModal.tsx';\nexport type { TypeToConfirmModalProps } from './TypeToConfirmModal.tsx';\nexport { useCopyToClipboard } from './useCopyToClipboard.ts';\nexport type { UseCopyToClipboardResult } from './useCopyToClipboard.ts';\n\nexport { Pagination, clampPage, pageCountFor, pageWindow } from './Pagination.tsx';\nexport type { PaginationLabels, PaginationProps } from './Pagination.tsx';\n\nexport { Spinner } from './Spinner.tsx';\nexport type { SpinnerProps } from './Spinner.tsx';\n\nexport {\n btnBase,\n btnBlueStyle,\n btnGreenStyle,\n btnSmallStyle,\n buttonColors,\n cardStyle,\n inputStyle,\n paginationBtnStyle,\n tableCardStyle,\n tdStyle,\n theme,\n thStyle,\n} from './theme.ts';\n\nexport { cn } from './utils.ts';\nexport type { ClassDictionary, ClassValue } from './utils.ts';\n\nexport { COPY_FEEDBACK_TIMEOUT_MS, NOTICE_TIMEOUT_MS, ZERO_TRUST_AUTHENTICATION_PATH } from './constants.ts';\n\nexport { useNotice } from './useNotice.ts';\nexport type { Notice, NoticeKind, ShowNotice, UseNoticeOptions, UseNoticeResult } from './useNotice.ts';\n\nexport {\n canonicalizeLanguageTag,\n DEFAULT_FALLBACK_LANGUAGE,\n DEFAULT_LANGUAGE_STORAGE_KEY,\n DEFAULT_SUPPORTED_LANGUAGES,\n resolveLanguageTag,\n useSpaLanguage,\n} from './useSpaLanguage.ts';\nexport type { LanguageTag, UseSpaLanguageOptions, UseSpaLanguageResult } from './useSpaLanguage.ts';\n\nexport { CURRENT_USER_PATH, useCurrentUser } from './useCurrentUser.ts';\nexport type { CurrentUser, UseCurrentUserOptions, UseCurrentUserResult } from './useCurrentUser.ts';\n\nexport { buildQuery, createApiClient, HttpStatusError, MAX_ERROR_MESSAGE_LENGTH } from './api.ts';\nexport type { ApiClient, ApiRequestInit, CreateApiClientOptions, FetchFn, QueryParams, QueryValue } from './api.ts';\n"],
5
+ "mappings": "AAsDA,OAAS,SAAAA,EAAO,kBAAAC,EAAgB,cAAAC,EAAY,qBAAAC,MAAyB,aAGrE,OAAS,UAAAC,EAAQ,mBAAAC,EAAiB,eAAAC,EAAa,mBAAAC,EAAiB,sBAAAC,MAA0B,cAG1F,OAAS,QAAAC,EAAM,aAAAC,EAAW,mBAAAC,EAAiB,kBAAAC,EAAgB,cAAAC,EAAY,aAAAC,MAAiB,YAGxF,OAAS,cAAAC,MAAkB,kBAG3B,OAAS,SAAAC,EAAO,SAAAC,EAAO,UAAAC,EAAQ,YAAAC,EAAU,cAAAC,MAAkB,aAG3D,OAAS,iBAAAC,MAAqB,qBAO9B,OAAS,cAAAC,MAAkB,kBAE3B,OAAS,sBAAAC,EAAoB,cAAAC,EAAY,kBAAAC,MAAsB,iBAM/D,OAAS,WAAAC,MAAe,eAExB,OAAS,kBAAAC,MAAsB,sBAE/B,OAAS,cAAAC,MAAkB,kBAE3B,OAAS,gBAAAC,MAAoB,oBAE7B,OAAS,aAAAC,MAAiB,iBAE1B,OAAS,oBAAAC,MAAwB,wBAEjC,OAAS,iBAAAC,MAAqB,qBAE9B,OAAS,iBAAAC,MAAqB,qBAE9B,OAAS,sBAAAC,MAA0B,0BAEnC,OAAS,sBAAAC,OAA0B,0BAGnC,OAAS,cAAAC,GAAY,aAAAC,GAAW,gBAAAC,GAAc,cAAAC,OAAkB,kBAGhE,OAAS,WAAAC,OAAe,eAGxB,OACE,WAAAC,GACA,gBAAAC,GACA,iBAAAC,GACA,iBAAAC,GACA,gBAAAC,GACA,aAAAC,GACA,cAAAC,GACA,sBAAAC,GACA,kBAAAC,GACA,WAAAC,GACA,SAAAC,GACA,WAAAC,OACK,aAEP,OAAS,MAAAC,OAAU,aAGnB,OAAS,4BAAAC,GAA0B,qBAAAC,GAAmB,kCAAAC,OAAsC,iBAE5F,OAAS,aAAAC,OAAiB,iBAG1B,OACE,2BAAAC,GACA,6BAAAC,GACA,gCAAAC,GACA,+BAAAC,GACA,sBAAAC,GACA,kBAAAC,OACK,sBAGP,OAAS,qBAAAC,GAAmB,kBAAAC,OAAsB,sBAGlD,OAAS,cAAAC,GAAY,mBAAAC,GAAiB,mBAAAC,GAAiB,4BAAAC,OAAgC",
6
+ "names": ["Badge", "badgeBaseClass", "badgeClass", "badgeVariantClass", "Button", "buttonBaseClass", "buttonClass", "buttonSizeClass", "buttonVariantClass", "Card", "cardClass", "cardHeaderClass", "cardTitleClass", "CardHeader", "CardTitle", "FocusInput", "Input", "Label", "Select", "Textarea", "fieldClass", "LoadingButton", "ModalShell", "ConfirmDeleteModal", "EmptyState", "LoadingSpinner", "AppPage", "PageHeaderCard", "ContextBar", "Unauthorized", "NoticeBar", "LanguageSelector", "RefreshButton", "ReadOnlyField", "TypeToConfirmModal", "useCopyToClipboard", "Pagination", "clampPage", "pageCountFor", "pageWindow", "Spinner", "btnBase", "btnBlueStyle", "btnGreenStyle", "btnSmallStyle", "buttonColors", "cardStyle", "inputStyle", "paginationBtnStyle", "tableCardStyle", "tdStyle", "theme", "thStyle", "cn", "COPY_FEEDBACK_TIMEOUT_MS", "NOTICE_TIMEOUT_MS", "ZERO_TRUST_AUTHENTICATION_PATH", "useNotice", "canonicalizeLanguageTag", "DEFAULT_FALLBACK_LANGUAGE", "DEFAULT_LANGUAGE_STORAGE_KEY", "DEFAULT_SUPPORTED_LANGUAGES", "resolveLanguageTag", "useSpaLanguage", "CURRENT_USER_PATH", "useCurrentUser", "buildQuery", "createApiClient", "HttpStatusError", "MAX_ERROR_MESSAGE_LENGTH"]
7
+ }
package/dist/theme.d.ts CHANGED
@@ -39,7 +39,9 @@ declare const theme: {
39
39
  readonly red: "#dc2626";
40
40
  readonly redHover: "#b91c1c";
41
41
  readonly spinnerBlue: "#60a5fa";
42
- /** The border colour a focused field paints. */
42
+ /**
43
+ The border colour a focused field paints.
44
+ */
43
45
  readonly focusBorder: "#3b82f6";
44
46
  };
45
47
  /**
@@ -53,17 +55,29 @@ declare const buttonColors: Record<string, {
53
55
  bg: string;
54
56
  hover: string;
55
57
  }>;
56
- /** The standard content card surface. */
58
+ /**
59
+ The standard content card surface.
60
+ */
57
61
  declare const cardStyle: CSSProperties;
58
- /** The standard text field surface. */
62
+ /**
63
+ The standard text field surface.
64
+ */
59
65
  declare const inputStyle: CSSProperties;
60
- /** A card whose content is a table: the table supplies its own padding. */
66
+ /**
67
+ A card whose content is a table: the table supplies its own padding.
68
+ */
61
69
  declare const tableCardStyle: CSSProperties;
62
- /** Column header cell. */
70
+ /**
71
+ Column header cell.
72
+ */
63
73
  declare const thStyle: CSSProperties;
64
- /** Body cell. */
74
+ /**
75
+ Body cell.
76
+ */
65
77
  declare const tdStyle: CSSProperties;
66
- /** A pager control, as used by `Pagination`'s inline-styled consumers. */
78
+ /**
79
+ A pager control, as used by `Pagination`'s inline-styled consumers.
80
+ */
67
81
  declare const paginationBtnStyle: CSSProperties;
68
82
  /**
69
83
  * Shared geometry for the solid action buttons: `btnBlueStyle`, `btnGreenStyle`
@@ -73,7 +87,9 @@ declare const paginationBtnStyle: CSSProperties;
73
87
  declare const btnBase: CSSProperties;
74
88
  declare const btnBlueStyle: CSSProperties;
75
89
  declare const btnGreenStyle: CSSProperties;
76
- /** The dense action button used in table rows. */
90
+ /**
91
+ The dense action button used in table rows.
92
+ */
77
93
  declare const btnSmallStyle: CSSProperties;
78
94
  export { btnBase, btnBlueStyle, btnGreenStyle, btnSmallStyle, buttonColors, cardStyle, inputStyle, paginationBtnStyle, tableCardStyle, tdStyle, theme, thStyle, };
79
95
  //# sourceMappingURL=theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;GAGG;AACH,QAAA,MAAM,KAAK;;;;;;;;;;;IAWT,gDAAgD;;CAExC,CAAC;AAEX;;;;;;GAMG;AACH,QAAA,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAI/D,CAAC;AAEF,yCAAyC;AACzC,QAAA,MAAM,SAAS,EAAE,aAIhB,CAAC;AAEF,uCAAuC;AACvC,QAAA,MAAM,UAAU,EAAE,aAUjB,CAAC;AAEF,2EAA2E;AAC3E,QAAA,MAAM,cAAc,EAAE,aAIrB,CAAC;AAEF,0BAA0B;AAC1B,QAAA,MAAM,OAAO,EAAE,aASd,CAAC;AAEF,iBAAiB;AACjB,QAAA,MAAM,OAAO,EAAE,aAGd,CAAC;AAEF,0EAA0E;AAC1E,QAAA,MAAM,kBAAkB,EAAE,aAQzB,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,OAAO,EAAE,aAQd,CAAC;AAEF,QAAA,MAAM,YAAY,EAAE,aAAsD,CAAC;AAC3E,QAAA,MAAM,aAAa,EAAE,aAAuD,CAAC;AAE7E,kDAAkD;AAClD,QAAA,MAAM,aAAa,EAAE,aASpB,CAAC;AAEF,OAA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
package/dist/theme.js CHANGED
@@ -1,134 +1 @@
1
- /**
2
- * Design tokens for the inline-styled parts of the SPA.
3
- *
4
- * ## Provenance
5
- *
6
- * Verbatim from `apps/web/src/components/ui/theme.ts` in **AWS-AccessBridge**,
7
- * which is the only repo of the eight that styled its primitives with inline
8
- * styles rather than Tailwind classes. It wins by default: nothing else in the
9
- * family carries a token table, and the six Tailwind repos encode the same
10
- * decisions as CSS custom properties (`--color-accent`, `--color-surface-1`, …)
11
- * in their `globals.css` instead of in TypeScript.
12
- *
13
- * So this file serves two audiences:
14
- *
15
- * - Consumers that render the class-based primitives (`Button`, `Card`, `Input`,
16
- * `Badge`, `Pagination`) need nothing from here — those components carry
17
- * Tailwind classes that read the CSS variables their `globals.css` defines.
18
- * - Consumers with bespoke, non-Tailwind surfaces (AWS-AccessBridge's admin
19
- * tables and its `LoadingButton` chrome) use these tokens directly.
20
- *
21
- * The two are deliberately not unified: collapsing them would either push hex
22
- * values into the class-based components or force every Tailwind consumer to
23
- * declare a TypeScript mirror of their theme. Neither repo family does that
24
- * today, and a token that exists in two places is a token that drifts.
25
- */
26
- /**
27
- * The palette. One flat record so a consumer can spread it into a CSS-in-JS
28
- * theme or read `theme.accent`-style names without a nested lookup.
29
- */
30
- const theme = {
31
- cardBg: '#1e2433',
32
- inputBg: '#252d3d',
33
- border: '#374151',
34
- blue: '#2563eb',
35
- blueHover: '#1d4ed8',
36
- green: '#16a34a',
37
- greenHover: '#15803d',
38
- red: '#dc2626',
39
- redHover: '#b91c1c',
40
- spinnerBlue: '#60a5fa',
41
- /** The border colour a focused field paints. */
42
- focusBorder: '#3b82f6',
43
- };
44
- /**
45
- * Background/hover pairs for the solid action colours.
46
- *
47
- * Keyed by colour name rather than by the kit's `Button` variants because a
48
- * plain colour table is what a bespoke button needs; `Button` maps its
49
- * normalized variants onto its own classes.
50
- */
51
- const buttonColors = {
52
- blue: { bg: theme.blue, hover: theme.blueHover },
53
- green: { bg: theme.green, hover: theme.greenHover },
54
- red: { bg: theme.red, hover: theme.redHover },
55
- };
56
- /** The standard content card surface. */
57
- const cardStyle = {
58
- background: theme.cardBg,
59
- borderRadius: '12px',
60
- padding: '24px',
61
- };
62
- /** The standard text field surface. */
63
- const inputStyle = {
64
- width: '100%',
65
- padding: '12px',
66
- background: theme.inputBg,
67
- borderRadius: '8px',
68
- border: `1px solid ${theme.border}`,
69
- color: '#ffffff',
70
- outline: 'none',
71
- boxSizing: 'border-box',
72
- transition: 'border-color 0.15s',
73
- };
74
- /** A card whose content is a table: the table supplies its own padding. */
75
- const tableCardStyle = {
76
- background: theme.cardBg,
77
- borderRadius: '12px',
78
- overflow: 'hidden',
79
- };
80
- /** Column header cell. */
81
- const thStyle = {
82
- textAlign: 'left',
83
- padding: '12px',
84
- background: theme.inputBg,
85
- color: '#9ca3af',
86
- textTransform: 'uppercase',
87
- letterSpacing: '0.05em',
88
- fontSize: '12px',
89
- fontWeight: 500,
90
- };
91
- /** Body cell. */
92
- const tdStyle = {
93
- padding: '12px',
94
- borderTop: '1px solid rgba(55,65,81,0.3)',
95
- };
96
- /** A pager control, as used by `Pagination`'s inline-styled consumers. */
97
- const paginationBtnStyle = {
98
- padding: '6px 12px',
99
- background: theme.inputBg,
100
- border: 'none',
101
- borderRadius: '8px',
102
- color: 'white',
103
- cursor: 'pointer',
104
- transition: 'background 0.15s',
105
- };
106
- /**
107
- * Shared geometry for the solid action buttons: `btnBlueStyle`, `btnGreenStyle`
108
- * and the small variant each spread it and override only what differs, so a
109
- * change to the radius or weight lands in all of them at once.
110
- */
111
- const btnBase = {
112
- padding: '10px 20px',
113
- borderRadius: '8px',
114
- color: 'white',
115
- fontWeight: 500,
116
- border: 'none',
117
- cursor: 'pointer',
118
- transition: 'background 0.15s',
119
- };
120
- const btnBlueStyle = { ...btnBase, background: theme.blue };
121
- const btnGreenStyle = { ...btnBase, background: theme.green };
122
- /** The dense action button used in table rows. */
123
- const btnSmallStyle = {
124
- padding: '6px 12px',
125
- borderRadius: '6px',
126
- color: 'white',
127
- fontWeight: 500,
128
- fontSize: '13px',
129
- border: 'none',
130
- cursor: 'pointer',
131
- transition: 'background 0.15s',
132
- };
133
- export { btnBase, btnBlueStyle, btnGreenStyle, btnSmallStyle, buttonColors, cardStyle, inputStyle, paginationBtnStyle, tableCardStyle, tdStyle, theme, thStyle, };
134
- //# sourceMappingURL=theme.js.map
1
+ const e={cardBg:"#1e2433",inputBg:"#252d3d",border:"#374151",blue:"#2563eb",blueHover:"#1d4ed8",green:"#16a34a",greenHover:"#15803d",red:"#dc2626",redHover:"#b91c1c",spinnerBlue:"#60a5fa",focusBorder:"#3b82f6"},o={blue:{bg:e.blue,hover:e.blueHover},green:{bg:e.green,hover:e.greenHover},red:{bg:e.red,hover:e.redHover}},n={background:e.cardBg,borderRadius:"12px",padding:"24px"},t={width:"100%",padding:"12px",background:e.inputBg,borderRadius:"8px",border:`1px solid ${e.border}`,color:"#ffffff",outline:"none",boxSizing:"border-box",transition:"border-color 0.15s"},d={background:e.cardBg,borderRadius:"12px",overflow:"hidden"},i={textAlign:"left",padding:"12px",background:e.inputBg,color:"#9ca3af",textTransform:"uppercase",letterSpacing:"0.05em",fontSize:"12px",fontWeight:500},a={padding:"12px",borderTop:"1px solid rgba(55,65,81,0.3)"},b={padding:"6px 12px",background:e.inputBg,border:"none",borderRadius:"8px",color:"white",cursor:"pointer",transition:"background 0.15s"},r={padding:"10px 20px",borderRadius:"8px",color:"white",fontWeight:500,border:"none",cursor:"pointer",transition:"background 0.15s"},c={...r,background:e.blue},p={...r,background:e.green},g={padding:"6px 12px",borderRadius:"6px",color:"white",fontWeight:500,fontSize:"13px",border:"none",cursor:"pointer",transition:"background 0.15s"};export{r as btnBase,c as btnBlueStyle,p as btnGreenStyle,g as btnSmallStyle,o as buttonColors,n as cardStyle,t as inputStyle,b as paginationBtnStyle,d as tableCardStyle,a as tdStyle,i as thStyle,e as theme};
package/dist/theme.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"theme.js","sourceRo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GAAG;IACf,QAAQ,EAAE,MAAM;IAChB,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,SAAS;IACjB,UAAU,EAAE,kBAAkB;CAC/B,CAAC;AAEF,OAAO,EACL,OAAO,EACP,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,OAAO,EACP,KAAK,EACL,OAAO,GACR,CAAC","sourcesContent":["import type { CSSProperties } from 'react';\n\n/**\n * Design tokens for the inline-styled parts of the SPA.\n *\n * ## Provenance\n *\n * Verbatim from `apps/web/src/components/ui/theme.ts` in **AWS-AccessBridge**,\n * which is the only repo of the eight that styled its primitives with inline\n * styles rather than Tailwind classes. It wins by default: nothing else in the\n * family carries a token table, and the six Tailwind repos encode the same\n * decisions as CSS custom properties (`--color-accent`, `--color-surface-1`, …)\n * in their `globals.css` instead of in TypeScript.\n *\n * So this file serves two audiences:\n *\n * - Consumers that render the class-based primitives (`Button`, `Card`, `Input`,\n * `Badge`, `Pagination`) need nothing from here — those components carry\n * Tailwind classes that read the CSS variables their `globals.css` defines.\n * - Consumers with bespoke, non-Tailwind surfaces (AWS-AccessBridge's admin\n * tables and its `LoadingButton` chrome) use these tokens directly.\n *\n * The two are deliberately not unified: collapsing them would either push hex\n * values into the class-based components or force every Tailwind consumer to\n * declare a TypeScript mirror of their theme. Neither repo family does that\n * today, and a token that exists in two places is a token that drifts.\n */\n\n/**\n * The palette. One flat record so a consumer can spread it into a CSS-in-JS\n * theme or read `theme.accent`-style names without a nested lookup.\n */\nconst theme = {\n cardBg: '#1e2433',\n inputBg: '#252d3d',\n border: '#374151',\n blue: '#2563eb',\n blueHover: '#1d4ed8',\n green: '#16a34a',\n greenHover: '#15803d',\n red: '#dc2626',\n redHover: '#b91c1c',\n spinnerBlue: '#60a5fa',\n /** The border colour a focused field paints. */\n focusBorder: '#3b82f6',\n} as const;\n\n/**\n * Background/hover pairs for the solid action colours.\n *\n * Keyed by colour name rather than by the kit's `Button` variants because a\n * plain colour table is what a bespoke button needs; `Button` maps its\n * normalized variants onto its own classes.\n */\nconst buttonColors: Record<string, { bg: string; hover: string }> = {\n blue: { bg: theme.blue, hover: theme.blueHover },\n green: { bg: theme.green, hover: theme.greenHover },\n red: { bg: theme.red, hover: theme.redHover },\n};\n\n/** The standard content card surface. */\nconst cardStyle: CSSProperties = {\n background: theme.cardBg,\n borderRadius: '12px',\n padding: '24px',\n};\n\n/** The standard text field surface. */\nconst inputStyle: CSSProperties = {\n width: '100%',\n padding: '12px',\n background: theme.inputBg,\n borderRadius: '8px',\n border: `1px solid ${theme.border}`,\n color: '#ffffff',\n outline: 'none',\n boxSizing: 'border-box',\n transition: 'border-color 0.15s',\n};\n\n/** A card whose content is a table: the table supplies its own padding. */\nconst tableCardStyle: CSSProperties = {\n background: theme.cardBg,\n borderRadius: '12px',\n overflow: 'hidden',\n};\n\n/** Column header cell. */\nconst thStyle: CSSProperties = {\n textAlign: 'left',\n padding: '12px',\n background: theme.inputBg,\n color: '#9ca3af',\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n fontSize: '12px',\n fontWeight: 500,\n};\n\n/** Body cell. */\nconst tdStyle: CSSProperties = {\n padding: '12px',\n borderTop: '1px solid rgba(55,65,81,0.3)',\n};\n\n/** A pager control, as used by `Pagination`'s inline-styled consumers. */\nconst paginationBtnStyle: CSSProperties = {\n padding: '6px 12px',\n background: theme.inputBg,\n border: 'none',\n borderRadius: '8px',\n color: 'white',\n cursor: 'pointer',\n transition: 'background 0.15s',\n};\n\n/**\n * Shared geometry for the solid action buttons: `btnBlueStyle`, `btnGreenStyle`\n * and the small variant each spread it and override only what differs, so a\n * change to the radius or weight lands in all of them at once.\n */\nconst btnBase: CSSProperties = {\n padding: '10px 20px',\n borderRadius: '8px',\n color: 'white',\n fontWeight: 500,\n border: 'none',\n cursor: 'pointer',\n transition: 'background 0.15s',\n};\n\nconst btnBlueStyle: CSSProperties = { ...btnBase, background: theme.blue };\nconst btnGreenStyle: CSSProperties = { ...btnBase, background: theme.green };\n\n/** The dense action button used in table rows. */\nconst btnSmallStyle: CSSProperties = {\n padding: '6px 12px',\n borderRadius: '6px',\n color: 'white',\n fontWeight: 500,\n fontSize: '13px',\n border: 'none',\n cursor: 'pointer',\n transition: 'background 0.15s',\n};\n\nexport {\n btnBase,\n btnBlueStyle,\n btnGreenStyle,\n btnSmallStyle,\n buttonColors,\n cardStyle,\n inputStyle,\n paginationBtnStyle,\n tableCardStyle,\n tdStyle,\n theme,\n thStyle,\n};\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/theme.ts"],
4
+ "sourcesContent": ["import type { CSSProperties } from 'react';\n\n/**\n * Design tokens for the inline-styled parts of the SPA.\n *\n * ## Provenance\n *\n * Verbatim from `apps/web/src/components/ui/theme.ts` in **AWS-AccessBridge**,\n * which is the only repo of the eight that styled its primitives with inline\n * styles rather than Tailwind classes. It wins by default: nothing else in the\n * family carries a token table, and the six Tailwind repos encode the same\n * decisions as CSS custom properties (`--color-accent`, `--color-surface-1`, …)\n * in their `globals.css` instead of in TypeScript.\n *\n * So this file serves two audiences:\n *\n * - Consumers that render the class-based primitives (`Button`, `Card`, `Input`,\n * `Badge`, `Pagination`) need nothing from here — those components carry\n * Tailwind classes that read the CSS variables their `globals.css` defines.\n * - Consumers with bespoke, non-Tailwind surfaces (AWS-AccessBridge's admin\n * tables and its `LoadingButton` chrome) use these tokens directly.\n *\n * The two are deliberately not unified: collapsing them would either push hex\n * values into the class-based components or force every Tailwind consumer to\n * declare a TypeScript mirror of their theme. Neither repo family does that\n * today, and a token that exists in two places is a token that drifts.\n */\n\n/**\n * The palette. One flat record so a consumer can spread it into a CSS-in-JS\n * theme or read `theme.accent`-style names without a nested lookup.\n */\nconst theme = {\n cardBg: '#1e2433',\n inputBg: '#252d3d',\n border: '#374151',\n blue: '#2563eb',\n blueHover: '#1d4ed8',\n green: '#16a34a',\n greenHover: '#15803d',\n red: '#dc2626',\n redHover: '#b91c1c',\n spinnerBlue: '#60a5fa',\n /**\n The border colour a focused field paints.\n */\n focusBorder: '#3b82f6',\n} as const;\n\n/**\n * Background/hover pairs for the solid action colours.\n *\n * Keyed by colour name rather than by the kit's `Button` variants because a\n * plain colour table is what a bespoke button needs; `Button` maps its\n * normalized variants onto its own classes.\n */\nconst buttonColors: Record<string, { bg: string; hover: string }> = {\n blue: { bg: theme.blue, hover: theme.blueHover },\n green: { bg: theme.green, hover: theme.greenHover },\n red: { bg: theme.red, hover: theme.redHover },\n};\n\n/**\nThe standard content card surface.\n*/\nconst cardStyle: CSSProperties = {\n background: theme.cardBg,\n borderRadius: '12px',\n padding: '24px',\n};\n\n/**\nThe standard text field surface.\n*/\nconst inputStyle: CSSProperties = {\n width: '100%',\n padding: '12px',\n background: theme.inputBg,\n borderRadius: '8px',\n border: `1px solid ${theme.border}`,\n color: '#ffffff',\n outline: 'none',\n boxSizing: 'border-box',\n transition: 'border-color 0.15s',\n};\n\n/**\nA card whose content is a table: the table supplies its own padding.\n*/\nconst tableCardStyle: CSSProperties = {\n background: theme.cardBg,\n borderRadius: '12px',\n overflow: 'hidden',\n};\n\n/**\nColumn header cell.\n*/\nconst thStyle: CSSProperties = {\n textAlign: 'left',\n padding: '12px',\n background: theme.inputBg,\n color: '#9ca3af',\n textTransform: 'uppercase',\n letterSpacing: '0.05em',\n fontSize: '12px',\n fontWeight: 500,\n};\n\n/**\nBody cell.\n*/\nconst tdStyle: CSSProperties = {\n padding: '12px',\n borderTop: '1px solid rgba(55,65,81,0.3)',\n};\n\n/**\nA pager control, as used by `Pagination`'s inline-styled consumers.\n*/\nconst paginationBtnStyle: CSSProperties = {\n padding: '6px 12px',\n background: theme.inputBg,\n border: 'none',\n borderRadius: '8px',\n color: 'white',\n cursor: 'pointer',\n transition: 'background 0.15s',\n};\n\n/**\n * Shared geometry for the solid action buttons: `btnBlueStyle`, `btnGreenStyle`\n * and the small variant each spread it and override only what differs, so a\n * change to the radius or weight lands in all of them at once.\n */\nconst btnBase: CSSProperties = {\n padding: '10px 20px',\n borderRadius: '8px',\n color: 'white',\n fontWeight: 500,\n border: 'none',\n cursor: 'pointer',\n transition: 'background 0.15s',\n};\n\nconst btnBlueStyle: CSSProperties = { ...btnBase, background: theme.blue };\nconst btnGreenStyle: CSSProperties = { ...btnBase, background: theme.green };\n\n/**\nThe dense action button used in table rows.\n*/\nconst btnSmallStyle: CSSProperties = {\n padding: '6px 12px',\n borderRadius: '6px',\n color: 'white',\n fontWeight: 500,\n fontSize: '13px',\n border: 'none',\n cursor: 'pointer',\n transition: 'background 0.15s',\n};\n\nexport {\n btnBase,\n btnBlueStyle,\n btnGreenStyle,\n btnSmallStyle,\n buttonColors,\n cardStyle,\n inputStyle,\n paginationBtnStyle,\n tableCardStyle,\n tdStyle,\n theme,\n thStyle,\n};\n"],
5
+ "mappings": "AAgCA,MAAMA,EAAQ,CACZ,OAAQ,UACR,QAAS,UACT,OAAQ,UACR,KAAM,UACN,UAAW,UACX,MAAO,UACP,WAAY,UACZ,IAAK,UACL,SAAU,UACV,YAAa,UAIb,YAAa,WAUTC,EAA8D,CAClE,KAAM,CAAE,GAAID,EAAM,KAAM,MAAOA,EAAM,SAAS,EAC9C,MAAO,CAAE,GAAIA,EAAM,MAAO,MAAOA,EAAM,UAAU,EACjD,IAAK,CAAE,GAAIA,EAAM,IAAK,MAAOA,EAAM,QAAQ,GAMvCE,EAA2B,CAC/B,WAAYF,EAAM,OAClB,aAAc,OACd,QAAS,QAMLG,EAA4B,CAChC,MAAO,OACP,QAAS,OACT,WAAYH,EAAM,QAClB,aAAc,MACd,OAAQ,aAAaA,EAAM,MAAM,GACjC,MAAO,UACP,QAAS,OACT,UAAW,aACX,WAAY,sBAMRI,EAAgC,CACpC,WAAYJ,EAAM,OAClB,aAAc,OACd,SAAU,UAMNK,EAAyB,CAC7B,UAAW,OACX,QAAS,OACT,WAAYL,EAAM,QAClB,MAAO,UACP,cAAe,YACf,cAAe,SACf,SAAU,OACV,WAAY,KAMRM,EAAyB,CAC7B,QAAS,OACT,UAAW,gCAMPC,EAAoC,CACxC,QAAS,WACT,WAAYP,EAAM,QAClB,OAAQ,OACR,aAAc,MACd,MAAO,QACP,OAAQ,UACR,WAAY,oBAQRQ,EAAyB,CAC7B,QAAS,YACT,aAAc,MACd,MAAO,QACP,WAAY,IACZ,OAAQ,OACR,OAAQ,UACR,WAAY,oBAGRC,EAA8B,CAAE,GAAGD,EAAS,WAAYR,EAAM,IAAI,EAClEU,EAA+B,CAAE,GAAGF,EAAS,WAAYR,EAAM,KAAK,EAKpEW,EAA+B,CACnC,QAAS,WACT,aAAc,MACd,MAAO,QACP,WAAY,IACZ,SAAU,OACV,OAAQ,OACR,OAAQ,UACR,WAAY",
6
+ "names": ["theme", "buttonColors", "cardStyle", "inputStyle", "tableCardStyle", "thStyle", "tdStyle", "paginationBtnStyle", "btnBase", "btnBlueStyle", "btnGreenStyle", "btnSmallStyle"]
7
+ }
@@ -45,7 +45,9 @@ interface UseCopyToClipboardResult {
45
45
  * this `false`, which is the answer that matters — there is nothing to undo.
46
46
  */
47
47
  copied: boolean;
48
- /** Writes `text`, or does nothing if the clipboard is unavailable. */
48
+ /**
49
+ Writes `text`, or does nothing if the clipboard is unavailable.
50
+ */
49
51
  copy: (text: string) => void;
50
52
  }
51
53
  declare function useCopyToClipboard(): UseCopyToClipboardResult;
@@ -1 +1 @@
1
- {"version":3,"file":"useCopyToClipboard.d.ts","sourceRoot":"","sources":["../src/useCopyToClipboard.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,UAAU,wBAAwB;IAChC;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB,sEAAsE;IACtE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,iBAAS,kBAAkB,IAAI,wBAAwB,CAuCtD;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"useCopyToClipboard.d.ts","sourceRoot":"","sources":["../src/useCopyToClipboard.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,UAAU,wBAAwB;IAChC;;;;;OAKG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;MAEE;IACF,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,iBAAS,kBAAkB,IAAI,wBAAwB,CAuCtD;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9B,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
@@ -1,40 +1 @@
1
- import { useCallback, useEffect, useRef, useState } from 'react';
2
- import { COPY_FEEDBACK_TIMEOUT_MS } from './constants';
3
- function useCopyToClipboard() {
4
- const [copied, setCopied] = useState(false);
5
- const resetTimer = useRef(null);
6
- useEffect(() => () => {
7
- if (resetTimer.current !== null)
8
- clearTimeout(resetTimer.current);
9
- }, []);
10
- const copy = useCallback((text) => {
11
- // Optional chaining rather than an assumption: `navigator.clipboard` is
12
- // genuinely absent over plain HTTP, and for a self-hosted deployment over
13
- // plain HTTP that is a normal configuration, not an error to surface.
14
- const clipboard = globalThis.navigator?.clipboard;
15
- // Nothing was copied, so there is nothing to report and nothing to undo.
16
- if (!clipboard)
17
- return;
18
- void clipboard
19
- .writeText(text)
20
- .then(() => {
21
- setCopied(true);
22
- // Cancel any pending reset before arming a new one. Replacing the
23
- // handle without clearing leaves the earlier timer live, and it can
24
- // clear the checkmark for a copy that is still being reported.
25
- if (resetTimer.current !== null)
26
- clearTimeout(resetTimer.current);
27
- resetTimer.current = setTimeout(() => {
28
- resetTimer.current = null;
29
- setCopied(false);
30
- }, COPY_FEEDBACK_TIMEOUT_MS);
31
- })
32
- // Leave `copied` false rather than flashing and clearing it: a rejection
33
- // means the text is still on screen and unread, so the affordance must
34
- // not claim otherwise.
35
- .catch(() => undefined);
36
- }, []);
37
- return { copied, copy };
38
- }
39
- export { useCopyToClipboard };
40
- //# sourceMappingURL=useCopyToClipboard.js.map
1
+ import{useCallback as n,useEffect as i,useRef as l,useState as s}from"react";import{COPY_FEEDBACK_TIMEOUT_MS as a}from"./constants.js";function f(){const[o,r]=s(!1),e=l(null);i(()=>()=>{e.current!==null&&clearTimeout(e.current)},[]);const u=n(c=>{const t=globalThis.navigator?.clipboard;t&&t.writeText(c).then(()=>{r(!0),e.current!==null&&clearTimeout(e.current),e.current=setTimeout(()=>{e.current=null,r(!1)},a)}).catch(()=>{})},[]);return{copied:o,copy:u}}export{f as useCopyToClipboard};
@@ -1 +1,7 @@
1
- {"version":3,"file":"useCopyToClipboard.js","sourceRoot":"","sources":["../src/useCopyToClipboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAsDvD,SAAS,kBAAkB;IACzB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAC;IAEtE,SAAS,CACP,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI;YAAE,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpE,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,IAAY,EAAQ,EAAE;QAC9C,wEAAwE;QACxE,0EAA0E;QAC1E,sEAAsE;QACtE,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,EAAE,SAAkC,CAAC;QAC3E,yEAAyE;QACzE,IAAI,CAAC,SAAS;YAAE,OAAO;QAEvB,KAAK,SAAS;aACX,SAAS,CAAC,IAAI,CAAC;aACf,IAAI,CAAC,GAAG,EAAE;YACT,SAAS,CAAC,IAAI,CAAC,CAAC;YAChB,kEAAkE;YAClE,oEAAoE;YACpE,+DAA+D;YAC/D,IAAI,UAAU,CAAC,OAAO,KAAK,IAAI;gBAAE,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAClE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE;gBACnC,UAAU,CAAC,OAAO,GAAG,IAAI,CAAC;gBAC1B,SAAS,CAAC,KAAK,CAAC,CAAC;YACnB,CAAC,EAAE,wBAAwB,CAAC,CAAC;QAC/B,CAAC,CAAC;YACF,yEAAyE;YACzE,uEAAuE;YACvE,uBAAuB;aACtB,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { COPY_FEEDBACK_TIMEOUT_MS } from './constants';\n\n/**\n * Copy text to the clipboard, reporting success only when it happened.\n *\n * ## Provenance\n *\n * `hooks/useCopyToClipboard.ts` in **Durable-DAV** — the one copy that had\n * solved the two failures the others carried. The other three handlers were\n * inlined into `ReadOnlyField` (Edge-Git, Mail-Otter, Durable-DAV-Router) and\n * `TypeToConfirmModal`, and were byte-identical to each other.\n *\n * ## The two live bugs this converges away\n *\n * 1. **`navigator.clipboard` is absent in an insecure context.** A plain\n * `navigator.clipboard.writeText` throws *synchronously* there, so the\n * handler dies before setting state. Where it was guarded with\n * `if (clipboard)`, the guard fell through to `setCopied(true)` anyway and\n * showed a checkmark for a copy that never happened.\n * 2. **The write is a promise that rejects on a denied permission.** Awaiting\n * it is not enough; the rejection has to be handled, or it surfaces as an\n * unhandled rejection *and* the checkmark still appears.\n *\n * That second case is why this is a hook rather than a helper. The honest\n * answer — \"nothing was copied, so there is nothing to undo\" — is expressed by\n * `copied` simply never becoming true, which is state a helper function cannot\n * hold.\n *\n * Every call site in the family is a secret reveal: a bucket credential's\n * copy-once password, a resource name typed to confirm a destructive action.\n * A false success sends the operator away believing they have something they do\n * not.\n *\n * ## Timer handling\n *\n * The reset timer is a ref and is cleared on unmount. Local `setTimeout` handles\n * in the inlined copies leaked both ways: a modal closed inside the feedback\n * window set state on an unmounted component, and repeated clicks each replaced\n * the timer without cancelling the previous one, so an early timer could clear\n * the checkmark while a later copy was still pending.\n */\n\ninterface UseCopyToClipboardResult {\n /**\n * True only after a write that actually resolved.\n *\n * Never optimistically set: a denied permission or an insecure context leaves\n * this `false`, which is the answer that matters — there is nothing to undo.\n */\n copied: boolean;\n /** Writes `text`, or does nothing if the clipboard is unavailable. */\n copy: (text: string) => void;\n}\n\nfunction useCopyToClipboard(): UseCopyToClipboardResult {\n const [copied, setCopied] = useState(false);\n const resetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(\n () => () => {\n if (resetTimer.current !== null) clearTimeout(resetTimer.current);\n },\n [],\n );\n\n const copy = useCallback((text: string): void => {\n // Optional chaining rather than an assumption: `navigator.clipboard` is\n // genuinely absent over plain HTTP, and for a self-hosted deployment over\n // plain HTTP that is a normal configuration, not an error to surface.\n const clipboard = globalThis.navigator?.clipboard as Clipboard | undefined;\n // Nothing was copied, so there is nothing to report and nothing to undo.\n if (!clipboard) return;\n\n void clipboard\n .writeText(text)\n .then(() => {\n setCopied(true);\n // Cancel any pending reset before arming a new one. Replacing the\n // handle without clearing leaves the earlier timer live, and it can\n // clear the checkmark for a copy that is still being reported.\n if (resetTimer.current !== null) clearTimeout(resetTimer.current);\n resetTimer.current = setTimeout(() => {\n resetTimer.current = null;\n setCopied(false);\n }, COPY_FEEDBACK_TIMEOUT_MS);\n })\n // Leave `copied` false rather than flashing and clearing it: a rejection\n // means the text is still on screen and unread, so the affordance must\n // not claim otherwise.\n .catch(() => undefined);\n }, []);\n\n return { copied, copy };\n}\n\nexport { useCopyToClipboard };\nexport type { UseCopyToClipboardResult };\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/useCopyToClipboard.ts"],
4
+ "sourcesContent": ["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { COPY_FEEDBACK_TIMEOUT_MS } from './constants.ts';\n\n/**\n * Copy text to the clipboard, reporting success only when it happened.\n *\n * ## Provenance\n *\n * `hooks/useCopyToClipboard.ts` in **Durable-DAV** — the one copy that had\n * solved the two failures the others carried. The other three handlers were\n * inlined into `ReadOnlyField` (Edge-Git, Mail-Otter, Durable-DAV-Router) and\n * `TypeToConfirmModal`, and were byte-identical to each other.\n *\n * ## The two live bugs this converges away\n *\n * 1. **`navigator.clipboard` is absent in an insecure context.** A plain\n * `navigator.clipboard.writeText` throws *synchronously* there, so the\n * handler dies before setting state. Where it was guarded with\n * `if (clipboard)`, the guard fell through to `setCopied(true)` anyway and\n * showed a checkmark for a copy that never happened.\n * 2. **The write is a promise that rejects on a denied permission.** Awaiting\n * it is not enough; the rejection has to be handled, or it surfaces as an\n * unhandled rejection *and* the checkmark still appears.\n *\n * That second case is why this is a hook rather than a helper. The honest\n * answer — \"nothing was copied, so there is nothing to undo\" — is expressed by\n * `copied` simply never becoming true, which is state a helper function cannot\n * hold.\n *\n * Every call site in the family is a secret reveal: a bucket credential's\n * copy-once password, a resource name typed to confirm a destructive action.\n * A false success sends the operator away believing they have something they do\n * not.\n *\n * ## Timer handling\n *\n * The reset timer is a ref and is cleared on unmount. Local `setTimeout` handles\n * in the inlined copies leaked both ways: a modal closed inside the feedback\n * window set state on an unmounted component, and repeated clicks each replaced\n * the timer without cancelling the previous one, so an early timer could clear\n * the checkmark while a later copy was still pending.\n */\n\ninterface UseCopyToClipboardResult {\n /**\n * True only after a write that actually resolved.\n *\n * Never optimistically set: a denied permission or an insecure context leaves\n * this `false`, which is the answer that matters — there is nothing to undo.\n */\n copied: boolean;\n /**\n Writes `text`, or does nothing if the clipboard is unavailable.\n */\n copy: (text: string) => void;\n}\n\nfunction useCopyToClipboard(): UseCopyToClipboardResult {\n const [copied, setCopied] = useState(false);\n const resetTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n useEffect(\n () => () => {\n if (resetTimer.current !== null) clearTimeout(resetTimer.current);\n },\n [],\n );\n\n const copy = useCallback((text: string): void => {\n // Optional chaining rather than an assumption: `navigator.clipboard` is\n // genuinely absent over plain HTTP, and for a self-hosted deployment over\n // plain HTTP that is a normal configuration, not an error to surface.\n const clipboard = globalThis.navigator?.clipboard as Clipboard | undefined;\n // Nothing was copied, so there is nothing to report and nothing to undo.\n if (!clipboard) return;\n\n void clipboard\n .writeText(text)\n .then(() => {\n setCopied(true);\n // Cancel any pending reset before arming a new one. Replacing the\n // handle without clearing leaves the earlier timer live, and it can\n // clear the checkmark for a copy that is still being reported.\n if (resetTimer.current !== null) clearTimeout(resetTimer.current);\n resetTimer.current = setTimeout(() => {\n resetTimer.current = null;\n setCopied(false);\n }, COPY_FEEDBACK_TIMEOUT_MS);\n })\n // Leave `copied` false rather than flashing and clearing it: a rejection\n // means the text is still on screen and unread, so the affordance must\n // not claim otherwise.\n .catch(() => {});\n }, []);\n\n return { copied, copy };\n}\n\nexport { useCopyToClipboard };\nexport type { UseCopyToClipboardResult };\n"],
5
+ "mappings": "AAAA,OAAS,eAAAA,EAAa,aAAAC,EAAW,UAAAC,EAAQ,YAAAC,MAAgB,QACzD,OAAS,4BAAAC,MAAgC,iBAwDzC,SAASC,GAAkB,CACzB,KAAM,CAACC,EAAQC,CAAS,EAAIJ,EAAS,EAAK,EACpCK,EAAaN,EAA6C,IAAI,EAEpED,EACE,IAAM,IAAK,CACLO,EAAW,UAAY,MAAM,aAAaA,EAAW,OAAO,CAClE,EACA,CAAA,CAAE,EAGJ,MAAMC,EAAOT,EAAaU,GAAsB,CAI9C,MAAMC,EAAY,WAAW,WAAW,UAEnCA,GAEAA,EACF,UAAUD,CAAI,EACd,KAAK,IAAK,CACTH,EAAU,EAAI,EAIVC,EAAW,UAAY,MAAM,aAAaA,EAAW,OAAO,EAChEA,EAAW,QAAU,WAAW,IAAK,CACnCA,EAAW,QAAU,KACrBD,EAAU,EAAK,CACjB,EAAGH,CAAwB,CAC7B,CAAC,EAIA,MAAM,IAAK,CAAE,CAAC,CACnB,EAAG,CAAA,CAAE,EAEL,MAAO,CAAE,OAAAE,EAAQ,KAAAG,CAAI,CACvB",
6
+ "names": ["useCallback", "useEffect", "useRef", "useState", "COPY_FEEDBACK_TIMEOUT_MS", "useCopyToClipboard", "copied", "setCopied", "resetTimer", "copy", "text", "clipboard"]
7
+ }