@lerianstudio/sindarian-ui 1.2.0-beta.1 → 1.2.0-beta.11

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 (207) hide show
  1. package/dist/components/breadcrumb/index.d.ts +2 -1
  2. package/dist/components/breadcrumb/index.d.ts.map +1 -1
  3. package/dist/components/card/account-card/index.d.ts +12 -12
  4. package/dist/components/card/account-card/index.d.ts.map +1 -1
  5. package/dist/components/card/account-card/index.js +3 -3
  6. package/dist/components/card/basic-card/index.d.ts +4 -4
  7. package/dist/components/card/basic-card/index.d.ts.map +1 -1
  8. package/dist/components/card/dashboard-card/index.d.ts +4 -4
  9. package/dist/components/card/dashboard-card/index.d.ts.map +1 -1
  10. package/dist/components/card/dashboard-card/index.js +1 -1
  11. package/dist/components/card/entity-card/index.d.ts +13 -13
  12. package/dist/components/card/entity-card/index.d.ts.map +1 -1
  13. package/dist/components/card/entity-card/index.js +1 -1
  14. package/dist/components/dialog/confirmation-dialog/index.d.ts +2 -1
  15. package/dist/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
  16. package/dist/components/dialog/confirmation-dialog/use-confirm-dialog.d.ts +1 -1
  17. package/dist/components/dialog/confirmation-dialog/use-confirm-dialog.d.ts.map +1 -1
  18. package/dist/components/dialog/large-dialog/index.d.ts +4 -4
  19. package/dist/components/dialog/large-dialog/index.d.ts.map +1 -1
  20. package/dist/components/entity-box/index.d.ts +7 -7
  21. package/dist/components/entity-box/index.d.ts.map +1 -1
  22. package/dist/components/entity-data-table/index.d.ts +3 -3
  23. package/dist/components/entity-data-table/index.d.ts.map +1 -1
  24. package/dist/components/form/combo-box-field/index.d.ts +1 -1
  25. package/dist/components/form/combo-box-field/index.d.ts.map +1 -1
  26. package/dist/components/form/combo-box-field/index.js +1 -1
  27. package/dist/components/form/country-field/index.d.ts +1 -1
  28. package/dist/components/form/country-field/index.d.ts.map +1 -1
  29. package/dist/components/form/date-picker-field/index.d.ts +2 -1
  30. package/dist/components/form/date-picker-field/index.d.ts.map +1 -1
  31. package/dist/components/form/date-picker-field/index.js +36 -1
  32. package/dist/components/form/date-range-field/index.d.ts +2 -1
  33. package/dist/components/form/date-range-field/index.d.ts.map +1 -1
  34. package/dist/components/form/date-range-field/index.js +36 -1
  35. package/dist/components/form/date-time-picker-field/index.d.ts +23 -0
  36. package/dist/components/form/date-time-picker-field/index.d.ts.map +1 -0
  37. package/dist/components/form/date-time-picker-field/index.js +113 -0
  38. package/dist/components/form/index.d.ts +2 -0
  39. package/dist/components/form/index.d.ts.map +1 -1
  40. package/dist/components/form/index.js +2 -0
  41. package/dist/components/form/input-field/index.d.ts +1 -1
  42. package/dist/components/form/input-field/index.d.ts.map +1 -1
  43. package/dist/components/form/otp-field/index.d.ts +18 -0
  44. package/dist/components/form/otp-field/index.d.ts.map +1 -0
  45. package/dist/components/form/otp-field/index.js +19 -0
  46. package/dist/components/form/pagination-limit-field/index.d.ts +1 -1
  47. package/dist/components/form/pagination-limit-field/index.d.ts.map +1 -1
  48. package/dist/components/form/pagination-limit-field/index.js +1 -1
  49. package/dist/components/form/password-field/index.d.ts +2 -1
  50. package/dist/components/form/password-field/index.d.ts.map +1 -1
  51. package/dist/components/form/select-field/index.d.ts +1 -1
  52. package/dist/components/form/select-field/index.d.ts.map +1 -1
  53. package/dist/components/form/select-field/index.js +1 -1
  54. package/dist/components/form/state-field/index.d.ts +2 -1
  55. package/dist/components/form/state-field/index.d.ts.map +1 -1
  56. package/dist/components/form/state-field/index.js +1 -1
  57. package/dist/components/form/switch-field/index.d.ts +1 -1
  58. package/dist/components/form/switch-field/index.d.ts.map +1 -1
  59. package/dist/components/page/index.d.ts +3 -3
  60. package/dist/components/page/index.d.ts.map +1 -1
  61. package/dist/components/page-header/index.d.ts +7 -7
  62. package/dist/components/page-header/index.d.ts.map +1 -1
  63. package/dist/components/page-header/index.js +1 -1
  64. package/dist/components/pagination/index.d.ts +1 -1
  65. package/dist/components/pagination/index.d.ts.map +1 -1
  66. package/dist/components/table/id-table-cell.d.ts +1 -1
  67. package/dist/components/table/id-table-cell.d.ts.map +1 -1
  68. package/dist/components/table/locked-table-actions.d.ts +2 -1
  69. package/dist/components/table/locked-table-actions.d.ts.map +1 -1
  70. package/dist/components/table/name-table-cell.d.ts +1 -1
  71. package/dist/components/table/name-table-cell.d.ts.map +1 -1
  72. package/dist/components/ui/alert/index.d.ts +6 -6
  73. package/dist/components/ui/alert/index.d.ts.map +1 -1
  74. package/dist/components/ui/autocomplete/index.d.ts +9 -9
  75. package/dist/components/ui/autocomplete/index.d.ts.map +1 -1
  76. package/dist/components/ui/autocomplete/index.js +6 -6
  77. package/dist/components/ui/autosize-textarea/index.d.ts +1 -1
  78. package/dist/components/ui/autosize-textarea/index.d.ts.map +1 -1
  79. package/dist/components/ui/avatar/index.d.ts +3 -3
  80. package/dist/components/ui/avatar/index.d.ts.map +1 -1
  81. package/dist/components/ui/badge/index.d.ts +1 -1
  82. package/dist/components/ui/badge/index.d.ts.map +1 -1
  83. package/dist/components/ui/badge/index.js +2 -2
  84. package/dist/components/ui/breadcrumb/index.d.ts +7 -7
  85. package/dist/components/ui/breadcrumb/index.d.ts.map +1 -1
  86. package/dist/components/ui/button/index.d.ts +1 -1
  87. package/dist/components/ui/button/index.d.ts.map +1 -1
  88. package/dist/components/ui/calendar/index.d.ts +2 -2
  89. package/dist/components/ui/calendar/index.d.ts.map +1 -1
  90. package/dist/components/ui/calendar/index.js +12 -12
  91. package/dist/components/ui/card/index.d.ts +7 -7
  92. package/dist/components/ui/card/index.d.ts.map +1 -1
  93. package/dist/components/ui/checkbox/index.d.ts +1 -1
  94. package/dist/components/ui/checkbox/index.d.ts.map +1 -1
  95. package/dist/components/ui/checkbox/index.js +1 -1
  96. package/dist/components/ui/collapsible/index.d.ts +3 -3
  97. package/dist/components/ui/collapsible/index.d.ts.map +1 -1
  98. package/dist/components/ui/command/index.d.ts +9 -9
  99. package/dist/components/ui/command/index.d.ts.map +1 -1
  100. package/dist/components/ui/command/index.js +4 -4
  101. package/dist/components/ui/copy-field/copy-field.test.d.ts +2 -0
  102. package/dist/components/ui/copy-field/copy-field.test.d.ts.map +1 -0
  103. package/dist/components/ui/copy-field/copy-field.test.js +268 -0
  104. package/dist/components/ui/copy-field/index.d.ts +56 -0
  105. package/dist/components/ui/copy-field/index.d.ts.map +1 -0
  106. package/dist/components/ui/copy-field/index.js +150 -0
  107. package/dist/components/ui/dialog/index.d.ts +10 -10
  108. package/dist/components/ui/dialog/index.d.ts.map +1 -1
  109. package/dist/components/ui/dropdown-menu/index.d.ts +16 -16
  110. package/dist/components/ui/dropdown-menu/index.d.ts.map +1 -1
  111. package/dist/components/ui/dropdown-menu/index.js +5 -5
  112. package/dist/components/ui/field/index.d.ts +10 -10
  113. package/dist/components/ui/field/index.d.ts.map +1 -1
  114. package/dist/components/ui/form.d.ts +5 -3
  115. package/dist/components/ui/form.d.ts.map +1 -1
  116. package/dist/components/ui/icon-button/index.d.ts +1 -1
  117. package/dist/components/ui/icon-button/index.d.ts.map +1 -1
  118. package/dist/components/ui/icon-button/styles.css +24 -24
  119. package/dist/components/ui/input/adornment.d.ts +1 -1
  120. package/dist/components/ui/input/adornment.d.ts.map +1 -1
  121. package/dist/components/ui/input/index.d.ts +1 -1
  122. package/dist/components/ui/input/index.d.ts.map +1 -1
  123. package/dist/components/ui/label/index.d.ts +1 -1
  124. package/dist/components/ui/label/index.d.ts.map +1 -1
  125. package/dist/components/ui/loading-button/index.d.ts +2 -1
  126. package/dist/components/ui/loading-button/index.d.ts.map +1 -1
  127. package/dist/components/ui/multiple-select/index.d.ts.map +1 -1
  128. package/dist/components/ui/multiple-select/index.js +1 -1
  129. package/dist/components/ui/otp-input/index.d.ts +13 -0
  130. package/dist/components/ui/otp-input/index.d.ts.map +1 -0
  131. package/dist/components/ui/otp-input/index.js +62 -0
  132. package/dist/components/ui/paper/index.d.ts +1 -1
  133. package/dist/components/ui/paper/index.d.ts.map +1 -1
  134. package/dist/components/ui/paper-collapsible/index.d.ts +4 -4
  135. package/dist/components/ui/paper-collapsible/index.d.ts.map +1 -1
  136. package/dist/components/ui/popover/index.d.ts +4 -4
  137. package/dist/components/ui/popover/index.d.ts.map +1 -1
  138. package/dist/components/ui/popover/index.js +1 -1
  139. package/dist/components/ui/progress/index.d.ts +1 -1
  140. package/dist/components/ui/progress/index.d.ts.map +1 -1
  141. package/dist/components/ui/qr-code/index.d.ts +26 -0
  142. package/dist/components/ui/qr-code/index.d.ts.map +1 -0
  143. package/dist/components/ui/qr-code/index.js +27 -0
  144. package/dist/components/ui/qr-code/qr-code.test.d.ts +2 -0
  145. package/dist/components/ui/qr-code/qr-code.test.d.ts.map +1 -0
  146. package/dist/components/ui/qr-code/qr-code.test.js +60 -0
  147. package/dist/components/ui/select/index.d.ts +11 -11
  148. package/dist/components/ui/select/index.d.ts.map +1 -1
  149. package/dist/components/ui/select/styles.css +1 -1
  150. package/dist/components/ui/separator/index.d.ts +1 -1
  151. package/dist/components/ui/separator/index.d.ts.map +1 -1
  152. package/dist/components/ui/sheet/index.d.ts +10 -10
  153. package/dist/components/ui/sheet/index.d.ts.map +1 -1
  154. package/dist/components/ui/sidebar/sidebar-back-button.d.ts +1 -1
  155. package/dist/components/ui/sidebar/sidebar-back-button.d.ts.map +1 -1
  156. package/dist/components/ui/sidebar/sidebar-components.d.ts +5 -5
  157. package/dist/components/ui/sidebar/sidebar-components.d.ts.map +1 -1
  158. package/dist/components/ui/sidebar/sidebar-components.js +1 -1
  159. package/dist/components/ui/sidebar/sidebar-expand-button.d.ts +2 -1
  160. package/dist/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
  161. package/dist/components/ui/sidebar/sidebar-expand-button.js +1 -1
  162. package/dist/components/ui/sidebar/sidebar-item-button.d.ts +1 -1
  163. package/dist/components/ui/sidebar/sidebar-item-button.d.ts.map +1 -1
  164. package/dist/components/ui/sidebar/sidebar-item-collapsible.d.ts +3 -3
  165. package/dist/components/ui/sidebar/sidebar-item-collapsible.d.ts.map +1 -1
  166. package/dist/components/ui/sidebar/sidebar-item-collapsible.js +1 -1
  167. package/dist/components/ui/sidebar/sidebar-item-icon-button.d.ts +1 -1
  168. package/dist/components/ui/sidebar/sidebar-item-icon-button.d.ts.map +1 -1
  169. package/dist/components/ui/sidebar/sidebar-item-icon-button.js +2 -2
  170. package/dist/components/ui/sidebar/sidebar-item.d.ts +1 -1
  171. package/dist/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
  172. package/dist/components/ui/sidebar/sidebar-item.js +1 -1
  173. package/dist/components/ui/sidebar/sidebar-provider.d.ts +1 -1
  174. package/dist/components/ui/sidebar/sidebar-provider.d.ts.map +1 -1
  175. package/dist/components/ui/sidebar/sidebar-provider.test.js +4 -1
  176. package/dist/components/ui/sidebar/sidebar-root.d.ts +1 -1
  177. package/dist/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
  178. package/dist/components/ui/skeleton/index.d.ts +1 -1
  179. package/dist/components/ui/skeleton/index.d.ts.map +1 -1
  180. package/dist/components/ui/stepper/index.d.ts +6 -6
  181. package/dist/components/ui/stepper/index.d.ts.map +1 -1
  182. package/dist/components/ui/switch/index.d.ts +1 -1
  183. package/dist/components/ui/switch/index.d.ts.map +1 -1
  184. package/dist/components/ui/switch/index.js +1 -1
  185. package/dist/components/ui/table/index.d.ts +11 -11
  186. package/dist/components/ui/table/index.d.ts.map +1 -1
  187. package/dist/components/ui/tabs/index.d.ts +4 -4
  188. package/dist/components/ui/tabs/index.d.ts.map +1 -1
  189. package/dist/components/ui/textarea/index.d.ts +1 -1
  190. package/dist/components/ui/textarea/index.d.ts.map +1 -1
  191. package/dist/components/ui/textarea/index.js +1 -1
  192. package/dist/components/ui/time-picker/index.d.ts +18 -0
  193. package/dist/components/ui/time-picker/index.d.ts.map +1 -0
  194. package/dist/components/ui/time-picker/index.js +85 -0
  195. package/dist/components/ui/toast/toaster.d.ts +1 -1
  196. package/dist/components/ui/toast/toaster.d.ts.map +1 -1
  197. package/dist/components/ui/tooltip/index.d.ts +4 -4
  198. package/dist/components/ui/tooltip/index.d.ts.map +1 -1
  199. package/dist/globals.css +17 -1
  200. package/dist/hooks/use-toast.d.ts.map +1 -1
  201. package/dist/hooks/use-toast.js +1 -2
  202. package/dist/index.d.ts +4 -0
  203. package/dist/index.d.ts.map +1 -1
  204. package/dist/index.js +4 -0
  205. package/dist/lib/storage/get-storage.js +1 -1
  206. package/dist/utils/country-utils.d.ts.map +1 -1
  207. package/package.json +30 -28
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const jsx_runtime_1 = require("react/jsx-runtime");
4
+ require("@testing-library/jest-dom");
5
+ const react_1 = require("@testing-library/react");
6
+ const _1 = require(".");
7
+ const mockToast = jest.fn();
8
+ jest.mock('@/hooks/use-toast', () => ({
9
+ useToast: () => ({ toast: mockToast })
10
+ }));
11
+ const FALLBACK_COPY_LABEL = 'Copy not available — text selected, press Ctrl/Cmd+C';
12
+ const writeText = jest.fn().mockResolvedValue(undefined);
13
+ const readText = jest.fn().mockResolvedValue('');
14
+ const setClipboard = (value) => {
15
+ Object.defineProperty(navigator, 'clipboard', {
16
+ value,
17
+ configurable: true,
18
+ writable: true
19
+ });
20
+ };
21
+ beforeEach(() => {
22
+ mockToast.mockClear();
23
+ writeText.mockClear();
24
+ writeText.mockResolvedValue(undefined);
25
+ readText.mockClear();
26
+ readText.mockResolvedValue('');
27
+ setClipboard({ writeText, readText });
28
+ });
29
+ describe('CopyField', () => {
30
+ it('renders the value in a read-only input', () => {
31
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret" }));
32
+ const input = react_1.screen.getByLabelText('Secret');
33
+ expect(input).toHaveValue('SECRET123');
34
+ expect(input).toHaveAttribute('readonly');
35
+ });
36
+ it('associates the visible label with the input via htmlFor/id', () => {
37
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "abc", label: "API Key" }));
38
+ expect(react_1.screen.getByLabelText('API Key')).toBeInTheDocument();
39
+ });
40
+ it('copies the value to the clipboard when the copy button is clicked', async () => {
41
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret" }));
42
+ await (0, react_1.act)(async () => {
43
+ react_1.fireEvent.click(react_1.screen.getByRole('button', { name: /copy secret/i }));
44
+ });
45
+ expect(writeText).toHaveBeenCalledWith('SECRET123');
46
+ });
47
+ it('fires a success toast with the provided onCopyLabel after copying', async () => {
48
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret", onCopyLabel: "Secret copied!" }));
49
+ react_1.fireEvent.click(react_1.screen.getByRole('button', { name: /copy secret/i }));
50
+ await (0, react_1.waitFor)(() => expect(mockToast).toHaveBeenCalledWith(expect.objectContaining({ variant: 'success', title: 'Secret copied!' })));
51
+ });
52
+ it('uses the default copy label when onCopyLabel is not provided', async () => {
53
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "abc" }));
54
+ react_1.fireEvent.click(react_1.screen.getByRole('button', { name: /copy/i }));
55
+ await (0, react_1.waitFor)(() => expect(mockToast).toHaveBeenCalledWith(expect.objectContaining({ title: 'Copied to clipboard!' })));
56
+ });
57
+ it('gives the copy button an accessible name even without a label', () => {
58
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "abc" }));
59
+ expect(react_1.screen.getByRole('button', { name: /copy/i })).toBeInTheDocument();
60
+ });
61
+ it('overrides the input aria-label via valueLabel when no visible label', () => {
62
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "abc", valueLabel: "Valor para copiar" }));
63
+ expect(react_1.screen.getByLabelText('Valor para copiar')).toBeInTheDocument();
64
+ });
65
+ describe('masked', () => {
66
+ it('obscures the displayed value while keeping the real value copyable', async () => {
67
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "TOTPSECRET", label: "Secret", masked: true }));
68
+ const input = react_1.screen.getByLabelText('Secret');
69
+ expect(input).toHaveAttribute('type', 'password');
70
+ expect(input).toHaveValue('TOTPSECRET');
71
+ await (0, react_1.act)(async () => {
72
+ react_1.fireEvent.click(react_1.screen.getByRole('button', { name: /copy secret/i }));
73
+ });
74
+ expect(writeText).toHaveBeenCalledWith('TOTPSECRET');
75
+ });
76
+ it('reveals and then hides the value with the reveal toggle (aria-pressed)', () => {
77
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "s3cr3t", label: "Secret", masked: true }));
78
+ const input = react_1.screen.getByLabelText('Secret');
79
+ expect(input).toHaveAttribute('type', 'password');
80
+ const toggle = react_1.screen.getByRole('button', { name: /show value/i });
81
+ expect(toggle).toHaveAttribute('aria-pressed', 'false');
82
+ react_1.fireEvent.click(toggle);
83
+ expect(input).toHaveAttribute('type', 'text');
84
+ const hideToggle = react_1.screen.getByRole('button', { name: /hide value/i });
85
+ expect(hideToggle).toHaveAttribute('aria-pressed', 'true');
86
+ react_1.fireEvent.click(hideToggle);
87
+ expect(input).toHaveAttribute('type', 'password');
88
+ expect(react_1.screen.getByRole('button', { name: /show value/i })).toHaveAttribute('aria-pressed', 'false');
89
+ });
90
+ it('supports localized reveal/hide labels', () => {
91
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "s3cr3t", label: "Secret", masked: true, revealLabel: "Mostrar valor", hideLabel: "Ocultar valor" }));
92
+ const toggle = react_1.screen.getByRole('button', { name: 'Mostrar valor' });
93
+ react_1.fireEvent.click(toggle);
94
+ expect(react_1.screen.getByRole('button', { name: 'Ocultar valor' })).toBeInTheDocument();
95
+ });
96
+ it('does not render a reveal toggle when not masked', () => {
97
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "abc", label: "Token" }));
98
+ expect(react_1.screen.queryByRole('button', { name: /show value/i })).not.toBeInTheDocument();
99
+ });
100
+ });
101
+ describe('clipboard unavailable fallback', () => {
102
+ it('selects the input text and toasts the fallback label when clipboard API is absent', async () => {
103
+ setClipboard(undefined);
104
+ const selectSpy = jest.spyOn(HTMLInputElement.prototype, 'select');
105
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "abc", label: "Token" }));
106
+ expect(() => react_1.fireEvent.click(react_1.screen.getByRole('button', { name: /copy token/i }))).not.toThrow();
107
+ expect(selectSpy).toHaveBeenCalled();
108
+ await (0, react_1.waitFor)(() => expect(mockToast).toHaveBeenCalledWith(expect.objectContaining({ title: FALLBACK_COPY_LABEL })));
109
+ selectSpy.mockRestore();
110
+ });
111
+ it('fires the fallback toast and NOT the success toast when writeText rejects', async () => {
112
+ writeText.mockRejectedValueOnce(new Error('permission denied'));
113
+ const selectSpy = jest.spyOn(HTMLInputElement.prototype, 'select');
114
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "abc", label: "Token" }));
115
+ react_1.fireEvent.click(react_1.screen.getByRole('button', { name: /copy token/i }));
116
+ await (0, react_1.waitFor)(() => expect(selectSpy).toHaveBeenCalled());
117
+ await (0, react_1.waitFor)(() => expect(mockToast).toHaveBeenCalledWith(expect.objectContaining({ title: FALLBACK_COPY_LABEL })));
118
+ expect(mockToast).not.toHaveBeenCalledWith(expect.objectContaining({ variant: 'success' }));
119
+ selectSpy.mockRestore();
120
+ });
121
+ it('makes a masked field textual (selectable) before the fallback selection when clipboard is absent', async () => {
122
+ setClipboard(undefined);
123
+ const selectSpy = jest.spyOn(HTMLInputElement.prototype, 'select');
124
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "TOTPSECRET", label: "Secret", masked: true }));
125
+ const input = react_1.screen.getByLabelText('Secret');
126
+ expect(input).toHaveAttribute('type', 'password');
127
+ react_1.fireEvent.click(react_1.screen.getByRole('button', { name: /copy secret/i }));
128
+ // The field must be text (selectable) at/after the fallback, and it must
129
+ // still hold the real secret so Ctrl/Cmd+C copies the true value.
130
+ expect(input).toHaveAttribute('type', 'text');
131
+ expect(input).toHaveValue('TOTPSECRET');
132
+ expect(selectSpy).toHaveBeenCalled();
133
+ selectSpy.mockRestore();
134
+ });
135
+ it('makes a masked field textual before the fallback selection when writeText rejects', async () => {
136
+ writeText.mockRejectedValueOnce(new Error('permission denied'));
137
+ const selectSpy = jest.spyOn(HTMLInputElement.prototype, 'select');
138
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "TOTPSECRET", label: "Secret", masked: true }));
139
+ const input = react_1.screen.getByLabelText('Secret');
140
+ expect(input).toHaveAttribute('type', 'password');
141
+ react_1.fireEvent.click(react_1.screen.getByRole('button', { name: /copy secret/i }));
142
+ await (0, react_1.waitFor)(() => expect(selectSpy).toHaveBeenCalled());
143
+ expect(input).toHaveAttribute('type', 'text');
144
+ expect(input).toHaveValue('TOTPSECRET');
145
+ selectSpy.mockRestore();
146
+ });
147
+ });
148
+ describe('clearClipboardAfter', () => {
149
+ const CLEAR_AFTER = 30_000;
150
+ beforeEach(() => {
151
+ jest.useFakeTimers();
152
+ });
153
+ afterEach(() => {
154
+ jest.runOnlyPendingTimers();
155
+ jest.useRealTimers();
156
+ });
157
+ /** Runs the pending clear timer and drains its await chain. */
158
+ const runClearTimer = async () => {
159
+ await (0, react_1.act)(async () => {
160
+ jest.advanceTimersByTime(CLEAR_AFTER);
161
+ });
162
+ // readText -> comparison -> writeText: two extra microtask turns.
163
+ await (0, react_1.act)(async () => {
164
+ await Promise.resolve();
165
+ await Promise.resolve();
166
+ });
167
+ };
168
+ const copy = async (name) => {
169
+ await (0, react_1.act)(async () => {
170
+ react_1.fireEvent.click(react_1.screen.getByRole('button', { name }));
171
+ });
172
+ };
173
+ it('wipes the clipboard after the delay when it still holds the copied value', async () => {
174
+ readText.mockResolvedValue('SECRET123');
175
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret", clearClipboardAfter: CLEAR_AFTER }));
176
+ await copy(/copy secret/i);
177
+ expect(writeText).toHaveBeenCalledWith('SECRET123');
178
+ // Nothing cleared before the delay elapses.
179
+ expect(writeText).toHaveBeenCalledTimes(1);
180
+ await runClearTimer();
181
+ expect(readText).toHaveBeenCalled();
182
+ expect(writeText).toHaveBeenLastCalledWith('');
183
+ });
184
+ it('leaves the clipboard untouched when it now holds an unrelated value', async () => {
185
+ readText.mockResolvedValue('something the user copied afterwards');
186
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret", clearClipboardAfter: CLEAR_AFTER }));
187
+ await copy(/copy secret/i);
188
+ await runClearTimer();
189
+ expect(readText).toHaveBeenCalled();
190
+ expect(writeText).toHaveBeenCalledTimes(1);
191
+ expect(writeText).toHaveBeenLastCalledWith('SECRET123');
192
+ });
193
+ it('clears against the value copied at click time, not a later prop value', async () => {
194
+ readText.mockResolvedValue('FIRST');
195
+ const { rerender } = (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "FIRST", label: "Secret", clearClipboardAfter: CLEAR_AFTER }));
196
+ await copy(/copy secret/i);
197
+ rerender((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECOND", label: "Secret", clearClipboardAfter: CLEAR_AFTER }));
198
+ await runClearTimer();
199
+ expect(writeText).toHaveBeenLastCalledWith('');
200
+ });
201
+ it('does not clear when the clipboard cannot be read back', async () => {
202
+ setClipboard({ writeText });
203
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret", clearClipboardAfter: CLEAR_AFTER }));
204
+ await copy(/copy secret/i);
205
+ await runClearTimer();
206
+ expect(writeText).toHaveBeenCalledTimes(1);
207
+ expect(writeText).toHaveBeenLastCalledWith('SECRET123');
208
+ });
209
+ it('does not clear when readText rejects', async () => {
210
+ readText.mockRejectedValue(new Error('permission denied'));
211
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret", clearClipboardAfter: CLEAR_AFTER }));
212
+ await copy(/copy secret/i);
213
+ await runClearTimer();
214
+ expect(writeText).toHaveBeenCalledTimes(1);
215
+ });
216
+ it('does not schedule a clear when the copy itself failed', async () => {
217
+ writeText.mockRejectedValue(new Error('permission denied'));
218
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret", clearClipboardAfter: CLEAR_AFTER }));
219
+ await copy(/copy secret/i);
220
+ await runClearTimer();
221
+ expect(readText).not.toHaveBeenCalled();
222
+ });
223
+ it('never clears when the prop is omitted or non-positive', async () => {
224
+ const { unmount } = (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret" }));
225
+ await copy(/copy secret/i);
226
+ await runClearTimer();
227
+ expect(readText).not.toHaveBeenCalled();
228
+ unmount();
229
+ (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret", clearClipboardAfter: 0 }));
230
+ await copy(/copy secret/i);
231
+ await runClearTimer();
232
+ expect(readText).not.toHaveBeenCalled();
233
+ });
234
+ it('still clears after the field unmounts before the delay elapses', async () => {
235
+ readText.mockResolvedValue('SECRET123');
236
+ const { unmount } = (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "SECRET123", label: "Secret", clearClipboardAfter: CLEAR_AFTER }));
237
+ await copy(/copy secret/i);
238
+ unmount();
239
+ await runClearTimer();
240
+ expect(writeText).toHaveBeenLastCalledWith('');
241
+ });
242
+ });
243
+ describe('copied-indicator timer', () => {
244
+ beforeEach(() => {
245
+ jest.useFakeTimers();
246
+ });
247
+ afterEach(() => {
248
+ jest.runOnlyPendingTimers();
249
+ jest.useRealTimers();
250
+ });
251
+ it('does not throw on rapid double-copy or unmount before the timeout', async () => {
252
+ const { unmount } = (0, react_1.render)((0, jsx_runtime_1.jsx)(_1.CopyField, { value: "abc", label: "Token" }));
253
+ const button = react_1.screen.getByRole('button', { name: /copy token/i });
254
+ await (0, react_1.act)(async () => {
255
+ react_1.fireEvent.click(button);
256
+ });
257
+ await (0, react_1.act)(async () => {
258
+ react_1.fireEvent.click(button);
259
+ });
260
+ // Unmount before the copied-icon timeout fires; the cleanup effect must
261
+ // clear the pending timer so no setState-after-unmount occurs.
262
+ expect(() => {
263
+ unmount();
264
+ jest.advanceTimersByTime(2000);
265
+ }).not.toThrow();
266
+ });
267
+ });
268
+ });
@@ -0,0 +1,56 @@
1
+ import * as React from 'react';
2
+ export type CopyFieldProps = {
3
+ /**
4
+ * The string shown and copied verbatim (e.g. a TOTP manual-entry secret or a
5
+ * single recovery code). Copy always uses this raw value, even while masked.
6
+ */
7
+ value: string;
8
+ /**
9
+ * Optional visible label rendered above the field and associated with the
10
+ * input via `htmlFor`/`id`.
11
+ */
12
+ label?: string;
13
+ /**
14
+ * When true the displayed value is obscured (native password dots) while the
15
+ * underlying `value` stays copyable. A reveal toggle is offered.
16
+ * @defaultValue false
17
+ */
18
+ masked?: boolean;
19
+ /**
20
+ * i18n message used as the success toast text. Falls back to a sensible
21
+ * default when omitted.
22
+ */
23
+ onCopyLabel?: string;
24
+ /**
25
+ * Accessible name for the reveal toggle when the value is hidden. Override
26
+ * for localization. Defaults to English.
27
+ * @defaultValue 'Show value'
28
+ */
29
+ revealLabel?: string;
30
+ /**
31
+ * Accessible name for the reveal toggle when the value is shown. Override
32
+ * for localization. Defaults to English.
33
+ * @defaultValue 'Hide value'
34
+ */
35
+ hideLabel?: string;
36
+ /**
37
+ * Accessible name for the input when no visible `label` is provided. Override
38
+ * for localization. Defaults to English.
39
+ * @defaultValue 'Value to copy'
40
+ */
41
+ valueLabel?: string;
42
+ /**
43
+ * Milliseconds after a *successful* copy before the clipboard is wiped, for
44
+ * sensitive values that shouldn't linger there (TOTP secrets, recovery
45
+ * codes). Omit — or pass a non-positive number — to never clear.
46
+ *
47
+ * The clear is best-effort and never destructive: before wiping, the
48
+ * clipboard is read back and left untouched unless it still holds exactly
49
+ * the value this field wrote, so a copy the user made in the meantime
50
+ * survives. Browsers without `clipboard.readText` (Firefox, Safari) or that
51
+ * deny the read can't be verified, so nothing is cleared there.
52
+ */
53
+ clearClipboardAfter?: number;
54
+ };
55
+ export declare function CopyField({ value, label, masked, onCopyLabel, revealLabel, hideLabel, valueLabel, clearClipboardAfter }: CopyFieldProps): React.JSX.Element;
56
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/copy-field/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAM9B,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAA;AAmCD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,KAAK,EACL,MAAc,EACd,WAAW,EACX,WAA0B,EAC1B,SAAwB,EACxB,UAA4B,EAC5B,mBAAmB,EACpB,EAAE,cAAc,qBAuJhB"}
@@ -0,0 +1,150 @@
1
+ 'use client';
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.CopyField = CopyField;
38
+ const jsx_runtime_1 = require("react/jsx-runtime");
39
+ const React = __importStar(require("react"));
40
+ const lucide_react_1 = require("lucide-react");
41
+ const icon_button_1 = require("../../../components/ui/icon-button");
42
+ const use_toast_1 = require("../../../hooks/use-toast");
43
+ const DEFAULT_COPY_LABEL = 'Copied to clipboard!';
44
+ const FALLBACK_COPY_LABEL = 'Copy not available — text selected, press Ctrl/Cmd+C';
45
+ const COPIED_ICON_TIMEOUT = 1500;
46
+ const isClipboardAvailable = () => typeof navigator !== 'undefined' &&
47
+ typeof navigator.clipboard?.writeText === 'function';
48
+ const isClipboardReadable = () => typeof navigator !== 'undefined' &&
49
+ typeof navigator.clipboard?.readText === 'function';
50
+ /**
51
+ * Wipes the clipboard, but only if it still holds `copiedValue` — the user may
52
+ * have copied something else in the meantime, and clobbering that would be
53
+ * worse than leaving the secret behind. Unverifiable (no `readText`, permission
54
+ * denied, unfocused document) means "leave it alone".
55
+ */
56
+ const clearClipboardIfUnchanged = async (copiedValue) => {
57
+ if (!isClipboardReadable()) {
58
+ return;
59
+ }
60
+ try {
61
+ if ((await navigator.clipboard.readText()) !== copiedValue) {
62
+ return;
63
+ }
64
+ await navigator.clipboard.writeText('');
65
+ }
66
+ catch {
67
+ // Read or write refused; the clipboard stays as-is.
68
+ }
69
+ };
70
+ function CopyField({ value, label, masked = false, onCopyLabel, revealLabel = 'Show value', hideLabel = 'Hide value', valueLabel = 'Value to copy', clearClipboardAfter }) {
71
+ const { toast } = (0, use_toast_1.useToast)();
72
+ const generatedId = React.useId();
73
+ const inputId = `${generatedId}-copy-field`;
74
+ const inputRef = React.useRef(null);
75
+ const copiedTimerRef = React.useRef(null);
76
+ const clearTimerRef = React.useRef(null);
77
+ const [revealed, setRevealed] = React.useState(false);
78
+ const [copied, setCopied] = React.useState(false);
79
+ const showAsText = !masked || revealed;
80
+ const copyAccessibleName = label ? `Copy ${label}` : 'Copy value';
81
+ React.useEffect(() => {
82
+ return () => {
83
+ if (copiedTimerRef.current) {
84
+ clearTimeout(copiedTimerRef.current);
85
+ }
86
+ // The clipboard-clear timer is deliberately *not* cancelled here: it
87
+ // touches no state (so it can't warn about an unmounted update) and the
88
+ // secret must still leave the clipboard when the dialog holding this
89
+ // field closes before the timeout elapses.
90
+ };
91
+ }, []);
92
+ const selectFieldText = () => {
93
+ const input = inputRef.current;
94
+ if (!input) {
95
+ return;
96
+ }
97
+ // Reveal so the user can copy the selection manually. Flip the DOM `type`
98
+ // imperatively *before* select(): `setRevealed` is batched, so a plain
99
+ // state update would leave the input as type="password" at select() time,
100
+ // and React's subsequent type -> "text" re-render clears the selection —
101
+ // the fallback would then select nothing. We still push the state update so
102
+ // the re-render stays consistent with the DOM we just mutated.
103
+ if (masked) {
104
+ input.type = 'text';
105
+ setRevealed(true);
106
+ }
107
+ input.focus();
108
+ input.select();
109
+ };
110
+ const handleFallback = () => {
111
+ selectFieldText();
112
+ toast({ title: FALLBACK_COPY_LABEL });
113
+ };
114
+ const handleCopy = async () => {
115
+ if (!isClipboardAvailable()) {
116
+ handleFallback();
117
+ return;
118
+ }
119
+ try {
120
+ await navigator.clipboard.writeText(value);
121
+ toast({ variant: 'success', title: onCopyLabel ?? DEFAULT_COPY_LABEL });
122
+ setCopied(true);
123
+ if (copiedTimerRef.current) {
124
+ clearTimeout(copiedTimerRef.current);
125
+ }
126
+ copiedTimerRef.current = setTimeout(() => setCopied(false), COPIED_ICON_TIMEOUT);
127
+ // Only a confirmed write earns a clear — the fallback path never wrote to
128
+ // the clipboard, so it has nothing of ours to wipe. `value` is captured
129
+ // per copy so a later prop change can't make us clear the wrong string.
130
+ if (clearTimerRef.current) {
131
+ clearTimeout(clearTimerRef.current);
132
+ }
133
+ if (clearClipboardAfter !== undefined && clearClipboardAfter > 0) {
134
+ const copiedValue = value;
135
+ clearTimerRef.current = setTimeout(() => {
136
+ void clearClipboardIfUnchanged(copiedValue);
137
+ }, clearClipboardAfter);
138
+ }
139
+ }
140
+ catch {
141
+ handleFallback();
142
+ }
143
+ };
144
+ return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "copy-field", className: "flex w-full flex-col gap-2", children: [label ? ((0, jsx_runtime_1.jsx)("label", { htmlFor: inputId, className: "text-muted-foreground text-sm font-semibold", children: label })) : null, (0, jsx_runtime_1.jsxs)("div", { "data-slot": "input-wrapper", className: "border-input-border focus-within:border-ring flex h-10 w-full cursor-text items-center gap-1 rounded-md border pr-1 pl-4 transition-[color,box-shadow]", children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, id: inputId, "data-slot": "input", "data-testid": "copy-field-input", type: showAsText ? 'text' : 'password', value: value, readOnly: true, "aria-label": label ? undefined : valueLabel,
145
+ // `min-w-0` lets this flex item shrink below its content width so a
146
+ // long value (e.g. a UUID recovery code) scrolls inside the field
147
+ // instead of overflowing its container. No `font-mono`: the value
148
+ // inherits the app sans font (Inter) so it matches every other field.
149
+ className: "text-input-foreground h-full min-w-0 flex-1 cursor-text border-none bg-transparent text-sm outline-none select-text focus:ring-0 focus:ring-offset-0" }), masked ? ((0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { type: "button", variant: "outline", size: "small", rounded: true, "aria-pressed": revealed, "aria-label": revealed ? hideLabel : revealLabel, onClick: () => setRevealed((prev) => !prev), children: revealed ? (0, jsx_runtime_1.jsx)(lucide_react_1.EyeOff, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Eye, {}) })) : null, (0, jsx_runtime_1.jsx)(icon_button_1.IconButton, { type: "button", variant: "outline", size: "small", rounded: true, "aria-label": copyAccessibleName, onClick: handleCopy, children: copied ? (0, jsx_runtime_1.jsx)(lucide_react_1.Check, {}) : (0, jsx_runtime_1.jsx)(lucide_react_1.Copy, {}) })] })] }));
150
+ }
@@ -1,16 +1,16 @@
1
1
  import * as React from 'react';
2
2
  import * as DialogPrimitive from '@radix-ui/react-dialog';
3
- declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
- declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
- declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
- declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
3
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
4
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
5
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
6
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
8
8
  declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
9
9
  showCloseButton?: boolean;
10
- }): import("react/jsx-runtime").JSX.Element;
11
- declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
12
- declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
13
- declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
14
- declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
10
+ }): React.JSX.Element;
11
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
12
+ declare function DialogFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
13
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
14
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
15
15
  export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription };
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dialog/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAA;AAKzD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAA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CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAQ1D;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,WAAW,EACX,aAAa,EACb,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,EAClB,CAAA"}
@@ -1,27 +1,27 @@
1
1
  import * as React from 'react';
2
2
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
3
- declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
5
- declare function DropdownMenuTrigger({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
- declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
- declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
3
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
4
+ declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
5
+ declare function DropdownMenuTrigger({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
6
+ declare function DropdownMenuContent({ className, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
7
+ declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
8
8
  declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
9
9
  inset?: boolean;
10
10
  variant?: 'default' | 'destructive';
11
- }): import("react/jsx-runtime").JSX.Element;
12
- declare function DropdownMenuItemIcon({ className, children, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
13
- declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): import("react/jsx-runtime").JSX.Element;
14
- declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
15
- declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): import("react/jsx-runtime").JSX.Element;
11
+ }): React.JSX.Element;
12
+ declare function DropdownMenuItemIcon({ className, children, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
13
+ declare function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>): React.JSX.Element;
14
+ declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
15
+ declare function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>): React.JSX.Element;
16
16
  declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
17
17
  inset?: boolean;
18
- }): import("react/jsx-runtime").JSX.Element;
19
- declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
20
- declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
21
- declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
18
+ }): React.JSX.Element;
19
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
20
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>): React.JSX.Element;
21
+ declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
22
22
  declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
23
23
  inset?: boolean;
24
- }): import("react/jsx-runtime").JSX.Element;
25
- declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
24
+ }): React.JSX.Element;
25
+ declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
26
26
  export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup };
27
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAA;AAKtE,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,2CAEzD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,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AC,2CAkB9D;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,GAAG;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,2CAYA;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,SAAS,CAAC,2CAQ9D;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,2CAW9B;AAED,iBAAS,eAAe,CAAC,EACvB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG,CAAC,2CAExD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG;IACjE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,2CAeA;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,2CAW/D;AAED,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,EACtB,sBAAsB,EACvB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/index.tsx"],"names":[],"mappings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