efficient-shell 12.17.1 → 12.19.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 (220) hide show
  1. package/README.md +3 -3
  2. package/dist/{Browser-A3JCQ6WZ.js → Browser-AUAKVIMA.js} +14 -14
  3. package/dist/Calculator-OUPD7SZV.js +29 -0
  4. package/dist/{CurrencyConverter-34AMD4W7.js → CurrencyConverter-CNGYEKE3.js} +9 -9
  5. package/dist/{Files-O5ZUWY44.js → Files-QL6GDJGG.js} +141 -141
  6. package/dist/{Notepad-ZIWRLVG5.js → Notepad-FFGF3MKM.js} +9 -9
  7. package/dist/{PdfViewer-F2TCC5UD.js → PdfViewer-UY5SRC63.js} +1 -1
  8. package/dist/{PomodoroTimer-6WR3UOOM.js → PomodoroTimer-I53C5QYM.js} +65 -65
  9. package/dist/{Preview-G2BMJF76.js → Preview-76X3G42U.js} +31 -31
  10. package/dist/{Sidebar-ADAIERCI.js → Sidebar-BKNCPUOE.js} +37 -37
  11. package/dist/{Stock-UAGSFAKY.js → Stock-JY3PJI2M.js} +2 -2
  12. package/dist/{Weather-G2VGEQX2.js → Weather-POQXLYFA.js} +17 -17
  13. package/dist/{WorldClock-43KK7OTT.js → WorldClock-FUJOPJ5G.js} +6 -6
  14. package/dist/ai/index.d.ts +59 -3
  15. package/dist/ai/index.js +110 -91
  16. package/dist/ai.css +1 -1
  17. package/dist/apps/index.js +1 -1
  18. package/dist/bin/media-host-check.js +1 -1
  19. package/dist/bin/ui-check.js +1 -1
  20. package/dist/brand.css +1 -1
  21. package/dist/charts/FlowChart.js +1 -1
  22. package/dist/charts/PieChart.js +1 -1
  23. package/dist/charts/RadarChart.js +1 -1
  24. package/dist/charts/RadialBarChart.js +1 -1
  25. package/dist/charts/SpecChart.js +1 -1
  26. package/dist/charts/TimeSeriesChart.js +1 -1
  27. package/dist/{chunk-OALFCXD6.js → chunk-2NZ7CVMW.js} +1 -1
  28. package/dist/{chunk-MFJHLC5M.js → chunk-34EBBZFK.js} +1 -1
  29. package/dist/{chunk-T3JSUBIF.js → chunk-34TQBJ7I.js} +1 -1
  30. package/dist/{chunk-EEAY7FJW.js → chunk-3CKYFCX4.js} +18 -18
  31. package/dist/{chunk-FQHPGREQ.js → chunk-3E3LR2PM.js} +12 -12
  32. package/dist/{chunk-KSMEWOCE.js → chunk-3J3FBYIZ.js} +1 -1
  33. package/dist/{chunk-JAVTQART.js → chunk-3JL4TCA7.js} +1 -1
  34. package/dist/{chunk-DVYBJOD3.js → chunk-436PJFHC.js} +10 -10
  35. package/dist/{chunk-JQWZ36JD.js → chunk-4PIQG2ZK.js} +1 -1
  36. package/dist/{chunk-DCNSQGHJ.js → chunk-4ZLFAXOC.js} +11 -11
  37. package/dist/{chunk-24LO6OH4.js → chunk-4ZRGMK7Y.js} +1 -1
  38. package/dist/{chunk-7ARBBWPQ.js → chunk-6FZ5JTBY.js} +2 -2
  39. package/dist/{chunk-7X2P6IH3.js → chunk-6GWYFUME.js} +5 -5
  40. package/dist/{chunk-ZKGUBIBT.js → chunk-6RK6R3RY.js} +1 -1
  41. package/dist/{chunk-XJW65EIG.js → chunk-7LTU5TJD.js} +1 -1
  42. package/dist/chunk-7U3BSTN2.js +1 -0
  43. package/dist/chunk-B4GCTNGM.js +9 -0
  44. package/dist/{chunk-XKJGJNY2.js → chunk-B4GRHE44.js} +3 -3
  45. package/dist/{chunk-ZE7OVMDM.js → chunk-BM2QIV64.js} +22 -22
  46. package/dist/{chunk-QPYVCG74.js → chunk-CCK2UWQ5.js} +10 -10
  47. package/dist/{chunk-WQ4YKWN2.js → chunk-CJHYOHMU.js} +1 -1
  48. package/dist/chunk-D2WJAF62.js +4 -0
  49. package/dist/{chunk-6TIJH2M6.js → chunk-DCCYUCBM.js} +1 -1
  50. package/dist/{chunk-JUFCEWE3.js → chunk-DG2TGWXI.js} +5 -5
  51. package/dist/{chunk-Y6E7IRK2.js → chunk-DK5SXOXJ.js} +1 -1
  52. package/dist/{chunk-Z62RBVEJ.js → chunk-DTSOYFQE.js} +1 -1
  53. package/dist/{chunk-VXDW6ZPG.js → chunk-EEB5XPWP.js} +2 -2
  54. package/dist/chunk-EFKJLUYP.js +2 -0
  55. package/dist/{chunk-I76W4ZNU.js → chunk-FBUFB536.js} +4 -4
  56. package/dist/{chunk-RMDVKQJE.js → chunk-FE5DH5OM.js} +2 -2
  57. package/dist/{chunk-LQVQX5B2.js → chunk-FQ4IRBMA.js} +1 -1
  58. package/dist/{chunk-W7DYKTHE.js → chunk-FTMCNC66.js} +1 -1
  59. package/dist/{chunk-RB7IU7ZK.js → chunk-FVKXDF2Q.js} +5 -5
  60. package/dist/chunk-GCTJIZTJ.js +2 -0
  61. package/dist/{chunk-LNZMA4PB.js → chunk-GEZM6ARD.js} +1 -1
  62. package/dist/{chunk-RAOM3WIQ.js → chunk-GLRRX4AL.js} +1 -1
  63. package/dist/chunk-HMT3MES3.js +27 -0
  64. package/dist/{chunk-QAS22BIS.js → chunk-HNIIDDLJ.js} +1 -1
  65. package/dist/{chunk-3A6FYWFQ.js → chunk-HOEHV2J5.js} +1 -1
  66. package/dist/{chunk-TW7SWDKZ.js → chunk-I5EVMLPB.js} +4 -4
  67. package/dist/{chunk-5MH5N76F.js → chunk-I7JU4IU3.js} +4 -4
  68. package/dist/{chunk-MBCUICY3.js → chunk-ILDPJ26Y.js} +1 -1
  69. package/dist/{chunk-XG5ER6GJ.js → chunk-JGRDG7CB.js} +5 -5
  70. package/dist/{chunk-HYPYNVQQ.js → chunk-JN5NUZ6D.js} +1 -1
  71. package/dist/chunk-JUXPKGO3.js +28 -0
  72. package/dist/{chunk-VYRVSTI6.js → chunk-KBI3T6UC.js} +9 -9
  73. package/dist/{chunk-UULBPDAH.js → chunk-KP2JYXEU.js} +8 -8
  74. package/dist/{chunk-H4ABSQS6.js → chunk-L543DFHF.js} +1 -1
  75. package/dist/chunk-LCEQIFPK.js +3 -0
  76. package/dist/{chunk-2DQHXJPM.js → chunk-LPPJNZQ6.js} +3 -3
  77. package/dist/{chunk-G3E4CD77.js → chunk-ME7XHU3P.js} +6 -6
  78. package/dist/{chunk-NKP5WCEA.js → chunk-MFEPLP7Y.js} +6 -6
  79. package/dist/{chunk-WYGUHCJ2.js → chunk-N32LNPPP.js} +8 -8
  80. package/dist/{chunk-YU52WMSH.js → chunk-N3R6N7LG.js} +1 -1
  81. package/dist/{chunk-ZQT3GNRU.js → chunk-NAN2IW2H.js} +2 -2
  82. package/dist/{chunk-ZTRKM3B5.js → chunk-OG53D3R5.js} +9 -9
  83. package/dist/{chunk-OFYNPYY2.js → chunk-OGWQABFP.js} +1 -1
  84. package/dist/{chunk-EDX55XGV.js → chunk-OLCRYT3N.js} +8 -8
  85. package/dist/chunk-OQ6TECLX.js +6 -0
  86. package/dist/{chunk-J2YURAQY.js → chunk-QG37GJP2.js} +6 -6
  87. package/dist/{chunk-42XSMAIK.js → chunk-QI4235JY.js} +1 -1
  88. package/dist/{chunk-JTGRLXZN.js → chunk-QMSINDXL.js} +1 -1
  89. package/dist/{chunk-H32UNWVU.js → chunk-QPSJYSET.js} +5 -5
  90. package/dist/{chunk-HJF4UZOA.js → chunk-QZCLHKCI.js} +8 -8
  91. package/dist/{chunk-3ZQT26GZ.js → chunk-R62JKPYY.js} +1 -1
  92. package/dist/{chunk-5DQE6RQJ.js → chunk-RKXCB5ZJ.js} +1 -1
  93. package/dist/{chunk-6A26HUVK.js → chunk-RY7JCGLI.js} +1 -1
  94. package/dist/{chunk-GOEHP2XM.js → chunk-S7MNRAYS.js} +4 -4
  95. package/dist/{chunk-YVHEKEHJ.js → chunk-SET3R227.js} +1 -1
  96. package/dist/chunk-SFULX4E3.js +7 -0
  97. package/dist/{chunk-YK64FFLW.js → chunk-SSNTJ3M4.js} +4 -4
  98. package/dist/{chunk-3FNBUOZK.js → chunk-SY66VJAI.js} +1 -1
  99. package/dist/{chunk-4I4WZHMV.js → chunk-T2TZBTSM.js} +1 -1
  100. package/dist/{chunk-2I7M4DCA.js → chunk-T6EB54LL.js} +1 -1
  101. package/dist/{chunk-ZICGXJUB.js → chunk-THLXDI76.js} +8 -8
  102. package/dist/{chunk-MJVFIH3J.js → chunk-TKUJUQK4.js} +9 -9
  103. package/dist/chunk-TM4CRQ3W.js +19 -0
  104. package/dist/chunk-TUPPFC74.js +14 -0
  105. package/dist/chunk-UP4HLGMZ.js +9 -0
  106. package/dist/{chunk-WLUJQLXG.js → chunk-UR2ECNBB.js} +1 -1
  107. package/dist/{chunk-OVD3ECM7.js → chunk-VLMBXPRM.js} +1 -1
  108. package/dist/{chunk-OHSRZLRD.js → chunk-VP2GI3UP.js} +2 -2
  109. package/dist/{chunk-MRLXGLNZ.js → chunk-VQ4X3OBR.js} +1 -1
  110. package/dist/{chunk-PDA77NNC.js → chunk-X34ZBXIU.js} +3 -3
  111. package/dist/{chunk-TKPUYQ3Q.js → chunk-XQNZJNEJ.js} +73 -73
  112. package/dist/{chunk-F37II2EH.js → chunk-XQWHKXLS.js} +13 -13
  113. package/dist/{chunk-B7EVVJHY.js → chunk-XVIJHDZ4.js} +3 -3
  114. package/dist/{chunk-JOAKKXTL.js → chunk-XZXFUZIK.js} +3 -2
  115. package/dist/{chunk-56XKHWNL.js → chunk-Y523KUQC.js} +1 -1
  116. package/dist/{chunk-ILIPEY3D.js → chunk-YI6SYUAK.js} +1 -1
  117. package/dist/{chunk-B2KQ3T7Q.js → chunk-YIUWX2IU.js} +6 -6
  118. package/dist/{chunk-PJE75B66.js → chunk-YRY64DQV.js} +1 -1
  119. package/dist/{chunk-I3TVRNUT.js → chunk-Z3CTYK3U.js} +1 -1
  120. package/dist/{chunk-YTZFWV2W.js → chunk-ZLKEPDJE.js} +1 -1
  121. package/dist/chunk-ZQ24H5UO.js +13 -0
  122. package/dist/data/EntityList.js +1 -1
  123. package/dist/data/ListLoadError.js +1 -1
  124. package/dist/data/ResizableTable.js +1 -1
  125. package/dist/forms/BorderInput.js +1 -1
  126. package/dist/forms/BrandAssetEditor.js +1 -1
  127. package/dist/forms/Calendar.js +1 -1
  128. package/dist/forms/ColorPicker.js +1 -1
  129. package/dist/forms/ComposerAttachments.js +1 -1
  130. package/dist/forms/CornersInput.js +1 -1
  131. package/dist/forms/DatePicker.js +1 -1
  132. package/dist/forms/DateRangePicker.js +1 -1
  133. package/dist/forms/DisplayChips.js +1 -1
  134. package/dist/forms/FilePicker.js +1 -1
  135. package/dist/forms/IconPicker.js +1 -1
  136. package/dist/forms/Input.js +1 -1
  137. package/dist/forms/InputNumber.js +1 -1
  138. package/dist/forms/LinkPicker.js +1 -1
  139. package/dist/forms/MediaLibrary.js +1 -1
  140. package/dist/forms/MediaUploadField.js +1 -1
  141. package/dist/forms/MediaUploadGrid.js +1 -1
  142. package/dist/forms/MediaUsedInList.js +1 -1
  143. package/dist/forms/PictureTiles.js +1 -1
  144. package/dist/forms/PositionInput.js +1 -1
  145. package/dist/forms/RenameField.js +1 -1
  146. package/dist/forms/Segmented.js +1 -1
  147. package/dist/forms/Select.js +1 -1
  148. package/dist/forms/SidesInput.js +1 -1
  149. package/dist/forms/Slider.js +1 -1
  150. package/dist/forms/Snippet.js +1 -1
  151. package/dist/forms/SplitButton.js +1 -1
  152. package/dist/forms/TagInput.js +1 -1
  153. package/dist/forms/TextToolbar.js +1 -1
  154. package/dist/forms/UnitMenu.js +1 -1
  155. package/dist/forms/WidthsBar.js +1 -1
  156. package/dist/forms/mediaLibraryMenu.js +1 -1
  157. package/dist/forms/textAlign.js +1 -1
  158. package/dist/icons/index.js +1 -1
  159. package/dist/index.js +500 -500
  160. package/dist/map/index.js +2 -2
  161. package/dist/markdown/index.js +1 -1
  162. package/dist/page-tabs/index.js +5 -5
  163. package/dist/pdf/index.js +1 -1
  164. package/dist/shell/AppUpdateBanner.js +1 -1
  165. package/dist/shell/Banner.js +1 -1
  166. package/dist/shell/Breadcrumbs.js +1 -1
  167. package/dist/shell/ColoredBadge.js +1 -1
  168. package/dist/shell/ConfirmDialog.js +1 -1
  169. package/dist/shell/ContextMenu.js +1 -1
  170. package/dist/shell/Dialog.js +1 -1
  171. package/dist/shell/Drawer.js +1 -1
  172. package/dist/shell/DropdownMenu.js +1 -1
  173. package/dist/shell/EmptyState.js +1 -1
  174. package/dist/shell/HelpCenter.js +1 -1
  175. package/dist/shell/ImageLightbox.js +1 -1
  176. package/dist/shell/LanguageSelect.js +1 -1
  177. package/dist/shell/Markdown.js +1 -1
  178. package/dist/shell/PageHeader.js +1 -1
  179. package/dist/shell/PopupMenu.js +1 -1
  180. package/dist/shell/ProductionTimeline.js +1 -1
  181. package/dist/shell/Result.js +1 -1
  182. package/dist/shell/SearchableSelect.js +1 -1
  183. package/dist/shell/SettingReset.js +1 -1
  184. package/dist/shell/SidebarLayout.js +1 -1
  185. package/dist/shell/SidebarNav.js +1 -1
  186. package/dist/shell/SortableList.js +1 -1
  187. package/dist/shell/StepChain.js +1 -1
  188. package/dist/shell/Stepper.js +1 -1
  189. package/dist/shell/Tabs.js +1 -1
  190. package/dist/shell/TopNav.js +1 -1
  191. package/dist/shell/Tree.js +1 -1
  192. package/dist/shell/discardGuard.js +1 -1
  193. package/dist/telemetry/index.js +1 -1
  194. package/dist/templates/AuthScreen.js +1 -1
  195. package/dist/templates/ChatTemplate.js +1 -1
  196. package/dist/templates/CheckoutTemplate.js +1 -1
  197. package/dist/templates/DashboardTemplate.js +1 -1
  198. package/dist/templates/DataTablePage.js +1 -1
  199. package/dist/templates/EmailTemplate.js +1 -1
  200. package/dist/templates/FormLayoutPage.js +1 -1
  201. package/dist/templates/GalleryTemplate.js +1 -1
  202. package/dist/ui/index.js +1 -1
  203. package/dist/version.js +1 -1
  204. package/package.json +1 -1
  205. package/dist/Calculator-4VBPCGRP.js +0 -29
  206. package/dist/chunk-25QDSYH5.js +0 -13
  207. package/dist/chunk-5QYKF7NK.js +0 -27
  208. package/dist/chunk-JDQGHQ2C.js +0 -2
  209. package/dist/chunk-L7MWAC2P.js +0 -6
  210. package/dist/chunk-LAOG7AED.js +0 -1
  211. package/dist/chunk-PMBCQWJW.js +0 -4
  212. package/dist/chunk-QBWMWK2W.js +0 -7
  213. package/dist/chunk-RMKC5POE.js +0 -3
  214. package/dist/chunk-S3OCHYGE.js +0 -14
  215. package/dist/chunk-UWLGKMH5.js +0 -9
  216. package/dist/chunk-VJXPT53M.js +0 -19
  217. package/dist/chunk-VPXAOSVH.js +0 -28
  218. package/dist/chunk-WCCGKDG6.js +0 -2
  219. package/dist/chunk-YFUY3VDW.js +0 -9
  220. /package/dist/{chunk-2VFSYSDS.js → chunk-5WK56FA3.js} +0 -0
package/README.md CHANGED
@@ -1712,9 +1712,9 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1712
1712
  | `Button`, `Input`, `Textarea`, `Select`, `Checkbox`, `Radio`, `Switch`, `FormField`, `Label` | Form controls — controlled (`value`/`onChange`); `Button`'s `variant` is `primary` (the default), `secondary` (outlined), `secondary-danger` (outlined in red: a destructive action in a footer of outlined buttons, e.g. Delete beside Archive — the same size and shape as `secondary`, red border and text, a light red wash on hover), `ghost`, `ghost-danger` (red text, no box: a destructive action among quiet `ghost` buttons), `danger` (solid red: the one action a confirm dialog asks for) or `link`; `Button` takes `pressed` (or follows `aria-pressed`) for a toggle that is on, with `IconButton`'s accent wash and ink on `ghost` and `secondary` (`secondary` keeps its border, tinted, so it does not move; `buttonClasses({ pressed })` gives a link the same); `Input`/`Textarea` forward native props for react-hook-form. `Button` and `Switch` take `disabledReason`: persistent text beside the control wired with `aria-describedby`, never a `title` — a tooltip needs a hover a disabled control does not reliably get. `Switch` also takes `disabledReasonId`, so a panel whose controls are all dead for one reason states it once and points every control at it. A `Select` option carries an optional `description`, rendered as a second muted line **in the open list only** — the closed trigger stays one line, so one explained option cannot change the height of every field in the row. `NativeSelect` (and so `Select` on touch) ignores it: an `<option>` holds text and nothing else. An option also takes `lang` (a BCP 47 tag) when its label is written in another language than the page's — a language picker naming each language in its own words: it goes on the option in the open list, on the native `<option>` and on the closed trigger's label while chosen, so a screen reader and the font fallback treat each name as its own language (WCAG 3.1.2). On the desktop listbox, `title` joins `aria-label` / `aria-labelledby` / `aria-describedby` on the VISIBLE trigger button — it used to ride the native spread onto the `sr-only` `<select>`, where a tooltip has no pointer that can reach it and a fallback name sits on an `aria-hidden` element. `name`, `required` and the forwarded ref stay on the native control, which is what it is for. A `Checkbox` or `Radio` with both a `label` and a `description` is NAMED by the label and DESCRIBED by the description (`aria-labelledby` / `aria-describedby`); the whole row is still its `<label>`, so its words still tick it. `FormField` points its one child at the hint or error on screen with `aria-describedby`, and marks it `aria-invalid` while `error` is set. A child that already has its own `aria-describedby` (a react-hook-form binding often does) keeps it: the ids are merged, the child's own first, and each id is said once — a repeated id is a message a screen reader reads twice. |
1713
1713
  | `buttonClasses`, `iconButtonClasses` | `Button`'s and `IconButton`'s look as a class string, for something that must navigate and so cannot be a `<button>`: `<Link href="/organisations/new" className={buttonClasses({ variant: 'secondary' })}>Add a business</Link>`. Same options and defaults as the component (`variant`, `size`, `block`, `className`), and the components render through these functions, so the two cannot drift. What the string cannot give an `<a>`: a disabled state (`disabled:` never matches an anchor — drop the `href`, add `role="link"` and `aria-disabled="true"`, or render a disabled `Button`), and the cursor (an `<a href>` gets the browser's pointer, a `<button>` the host's preflight; set it once for both). Keep its `inline-flex` — ask for `block` rather than passing a display utility. An icon-only link still needs the `aria-label` `IconButton` would have required. Client references, like every kit function: call them in a `'use client'` file. |
1714
1714
  | `labelClasses` | `Label`'s look as a class string, for a `<label>` a host lays out itself — beside a check box, in a row with its control, `sr-only`: `<label htmlFor="x" className={labelClasses({ inline: true, className: 'flex gap-2' })}>`. `inline: true` drops `Label`'s block layout (`mb-1 block`) and keeps its size, weight and ink; without it the string is exactly what `Label` renders. A client reference: call it in a `'use client'` file. |
1715
- | `Segmented` | A row of mutually exclusive options, all visible: a button group, or with `name` a real radio group that submits. It looks exactly like `Tabs variant="pill"`: the chosen option is solid blue with white text on the grey track, the others grey text. Both draw through one shared strip, so they cannot drift apart; only the roles differ (a value here, a tab panel there). `size` is `sm` / `md` / `lg` (24 / 32 / 40, the control-height ladder) or `touch` (56, as `Button size="touch"`). Icon-only: give the option its `icon` and its word as a visually hidden label (`sr-only`); the word names it and the icon is hidden from screen readers. Named by `label`, or by an element already on the page (`aria-labelledby`, a list row's own heading) and described by another (`aria-describedby`); an option's `title` says on hover what choosing it means. |
1715
+ | `Segmented` | A row of mutually exclusive options, all visible: a button group, or with `name` a real radio group that submits. It looks exactly like `Tabs variant="pill"`: the chosen option is solid blue with white text on the grey track, the others grey text. Both draw through one shared strip, so they cannot drift apart; only the roles differ (a value here, a tab panel there). `size` is `sm` / `md` / `lg` (24 / 32 / 40, the control-height ladder) or `touch` (56, as `Button size="touch"`). Icon-only: give the option its `icon` and its word as a visually hidden label (`sr-only`); the word names it and the icon is hidden from screen readers. A word is never cut and never broken inside itself, at any width and with no script measuring: with `block` every option is an equal share while the words fit; an option of several words wider than its share wraps at its spaces and grows (the size is a minimum height, so a one-line option keeps 24 / 32 / 40, with or without an icon up to that height); a single word wider than its share sends the options that do not fit to a second row of the track. Without `block` the track wraps first: a whole option moves to the second row before a label wraps. The track never scrolls. Named by `label`, or by an element already on the page (`aria-labelledby`, a list row's own heading) and described by another (`aria-describedby`); an option's `title` says on hover what choosing it means. |
1716
1716
  | `DisplayChips` | Which parts of a section are shown, one chip per part ("Breadcrumb", "Stats", "Intro text"): blue with an eye while shown, grey with a crossed eye while hidden, and a press flips it. The chips wrap, so a long list takes a few short lines instead of one switch row per part. Controlled: `items` (`{ id, label, shown, disabled?, disabledReason? }`) and `onChange(id, shown)`. The group is named by `label` or `aria-labelledby`. Each chip is a real toggle button (`aria-pressed`), named by its part and described by its state in words (`displayChips.shown` / `hidden`), with a hover label that says what a press does; Space and Enter are the button's own. A chip with `disabledReason` stays focusable, its press does nothing and the reason is said, as on `Button`. Not `Segmented` (one choice of several) and not `TagInput` (typing values in). |
1717
- | `PictureTiles` | Pick one of a few choices by its PICTURE: a grid of small tiles, each a toggle button (`aria-pressed`) holding the caller's drawing of what the choice makes (a wall layout, how a row's blocks share its width, what a header button will look like). `options` (`{ value, label, picture, disabled? }`), `value`, `onChange(value)`. `columns` fixes the tiles in a row (without it, as many 58px tiles as fit). `captions` writes each name under its picture, wrapping a long name onto a second line rather than cutting it; without it the name is the tile's accessible name and its hover label. `onClear` lets a press on the chosen tile clear the choice. The chosen tile wears the accent edge and ring and the accent text colour, so a picture drawn in `currentColor` follows it. Not `Segmented` (a few words in one track) and not `TileButton` (a large catalogue tile). |
1717
+ | `PictureTiles` | Pick one of a few choices by its PICTURE: a grid of small tiles, each a toggle button (`aria-pressed`) holding the caller's drawing of what the choice makes (a wall layout, how a row's blocks share its width, what a header button will look like). `options` (`{ value, label, picture, disabled? }`), `value`, `onChange(value)`. `columns` fixes the tiles in a row (without it, as many 58px tiles as fit). `captions` writes each name under its picture, wrapping a long name at its spaces onto a second line, never cutting it and never breaking a word inside itself; with captions the tiles flow, each its share of the row, and a tile whose longest word needs more than its share moves to the next row; with captions and no `columns` every tile stays 58px (wider only for a longer word) on every row, the last row too; without it the name is the tile's accessible name and its hover label. `onClear` lets a press on the chosen tile clear the choice. The chosen tile wears the accent edge and ring and the accent text colour, so a picture drawn in `currentColor` follows it. Not `Segmented` (a few words in one track) and not `TileButton` (a large catalogue tile). |
1718
1718
  | `RadioGroup` | One choice from a short visible list, with the group chrome each panel used to rebuild: a `role="radiogroup"` named by its own label (`aria-labelledby`, because `<label for>` cannot name a div), the `hint`/`error`/`required` wiring borrowed from `FormField`, and `orientation` for a row that wraps rather than compresses. The options are real native radios sharing one `name`, which is what gives the group its arrow keys, its disabled-skipping and its single tab stop — all from the user agent, none of it hand-rolled. `value: null` is "nothing chosen yet", not a silent first option. |
1719
1719
  | `Snippet` | A value the user copies rather than reads — an endpoint, a tenant id, a shell command. Monospace, truncated with the whole value on its `title` (`multiline` wraps instead), and a copy button that flips to a check for two seconds and says "Copied" through an `aria-live` region. `value` is what reaches the clipboard and `children` is what is shown, so a masked key displays masked and copies whole. `symbol` prints a leading glyph that is never copied and has **no default** — a URL has no `$` in front of it. A refused clipboard toasts rather than looking like it worked. Not a read-only `Input`: a value that can only be copied is not a control and should not take a tab stop or invite an edit. `id` and `aria-describedby` land on the COPY BUTTON — the only focusable thing in the row, and a labelable one — so a wrapping `FormField` really does label it and its hint is really announced; with `hideCopyButton` they fall back to the box, because an id that resolves to nothing is not wiring. |
1720
1720
  | `Kbd` | The badge the shortcut constants (`CMD_ENTER`, `ALT_SHIFT_E`, …) are shown in — a real `<kbd>`, two rungs, `className` layered on so a portal can tint it. `tone` says what it sits on: `neutral` (default, grey), `accent` (inside a primary or submit button: the `kbd-submit` chip, with no colour utility of its own) or `warning` (an amber button). It renders the string it is handed; which symbol a platform uses is what the constants already decide. |
@@ -1724,7 +1724,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
1724
1724
  | `Card`, `StatCard` | Surface panel (optional header/footer; `description` puts one sentence under the title, outside the heading; `headingLevel` makes the title a heading and the card a region named by it, and an `aria-label` names the region instead when the title is not the name, such as a count; `tone="warning"` draws the border amber for a card that needs attention, and the card's words still say why; `tone="current"` marks the current card in a list with a light-blue header band, a blue title and `aria-current`) + dashboard metric tile. |
1725
1725
  | `Avatar`, `AvatarGroup` | User avatar with initials fallback + status dot; overlapping stack with +N overflow. |
1726
1726
  | `Banner` | Static in-flow alert (`tone`: info / success / warning / danger / neutral). `neutral` is a note that is none of the other four ("Prices exclude GST"): grey in the kit's neutral, the same wash and ink as a neutral `StatusBadge` (`--status-neutral-soft` / `--status-neutral-soft-ink`, `--status-neutral-solid` when `emphasis="solid"`), with the info glyph. `action` renders a control at the right edge — after the text, so a screen reader reaches the problem before the remedy, and before the dismiss ×, so "Update card" is never past "close this". Vertically centred against the words and `shrink-0`, so a message that wraps does not drag the button down or squeeze it — and on a narrow banner (a phone, a narrow column: the words keep at least 12rem) it drops UNDER the words rather than leave them a column one word wide. A banner that names a condition and leaves the fix three menus away is the usual shape of a notice nobody acts on. |
1727
- | `Tabs`, `Accordion`, `Tooltip` | Controlled tab strip, collapsible sections, solid hover/focus tooltip. `Tabs variant="pill"` draws the same strip as `Segmented` (the active tab solid blue on the grey track); use it when each choice shows its own panel, and `Segmented` when the choice is a value. `block` gives every tab an equal share of the strip's width, in either look (the same word as `Segmented`'s `block`): the editors' settings panel uses it for its two icon-only tabs, Design (`adjust`) and Animation (`animation`), with the `underline` look, so the chosen tab is a blue icon over a blue underline. `labelsFit` shows an icon tab's word beside its icon only while the words fit the strip's parent, measured in the three steps `IconRail`'s `labelsFit` takes (every word, then only the chosen tab's, then icons only); a hidden word still names the tab, and the tab's Tooltip says it. Items with an `href` make the strip in-page links for one scrolling page: the same underline drawn as a `<nav>` of `<a>`, `aria-current="location"` on the section in view, the current item following the scroll through `onChange`, and a click scrolling its `#section` into view and focusing it. A tab's `dot` draws a small mark after its word to say the tab holds a value (the chosen tab's dot is the tab colour, another tab's the accent); `dotLabel` names it for a screen reader (default "Has a setting"). A tab's `tone="warning"` inks it amber while it is not the chosen one, in either mode's underline look. Each `Accordion` title is a heading holding its button, `<h3><button aria-expanded aria-controls>`, the WAI-ARIA accordion pattern; `level` (2–6, default 3) sets the heading under the host's own, and the heading draws nothing of its own. An open item's panel is a region named by its button. `AccordionHeading` is a title in a tier's look that folds nothing (the heading element itself, no button, no box round it), and `AccordionBody` is the band body's side inset with no band above it. A tooltip's `side` is a preference: near an edge the bubble slides along that side to stay 8 px clear of it, and flips to the opposite side when its own has no room, keeping inside the screen and inside the shell window that owns its trigger (UI-11). It never leaves that box: a bubble wider than the room wraps, and one taller than the room is cut off at it. The bubble is drawn on `<body>`, in a `fixed` layer laid over its trigger, so a scrolling pane or an `overflow-hidden` box around the trigger cannot cut it off; it follows the trigger when that moves and closes once the trigger has scrolled out of sight. A small arrow on the edge facing the trigger points at the trigger's centre wherever the bubble ended up, kept clear of the bubble's corners; it is the bubble's own surface (`.rosh-tooltip-arrow` in `ui.css`), seamless, and hidden from assistive technology. The bubble is SOLID, not glass, in every setting: the kit's solid popup surface (`--rosh-glass-surface`, `--rosh-glass-solid-border`, `--rosh-glass-solid-shadow`), so words behind a small bubble never mix with its own. `open` holds a tooltip open (or shut) whatever the pointer does: for a drag over a place that refuses the drop, when the browser sends no hover. |
1727
+ | `Tabs`, `Accordion`, `Tooltip` | Controlled tab strip, collapsible sections, solid hover/focus tooltip. `Tabs variant="pill"` draws the same strip as `Segmented` (the active tab solid blue on the grey track), so its words wrap the same way and never scroll out of sight; a tab that goes to a second row keeps one tab stop and the arrow keys; use it when each choice shows its own panel, and `Segmented` when the choice is a value. `block` gives every tab an equal share of the strip's width, in either look (the same word as `Segmented`'s `block`): the editors' settings panel uses it for its two icon-only tabs, Design (`adjust`) and Animation (`animation`), with the `underline` look, so the chosen tab is a blue icon over a blue underline. `labelsFit` shows an icon tab's word beside its icon only while the words fit the strip's parent, measured in the three steps `IconRail`'s `labelsFit` takes (every word, then only the chosen tab's, then icons only); a hidden word still names the tab, and the tab's Tooltip says it. Items with an `href` make the strip in-page links for one scrolling page: the same underline drawn as a `<nav>` of `<a>`, `aria-current="location"` on the section in view, the current item following the scroll through `onChange`, and a click scrolling its `#section` into view and focusing it. A tab's `dot` draws a small mark after its word to say the tab holds a value (the chosen tab's dot is the tab colour, another tab's the accent); `dotLabel` names it for a screen reader (default "Has a setting"). A tab's `tone="warning"` inks it amber while it is not the chosen one, in either mode's underline look. Each `Accordion` title is a heading holding its button, `<h3><button aria-expanded aria-controls>`, the WAI-ARIA accordion pattern; `level` (2–6, default 3) sets the heading under the host's own, and the heading draws nothing of its own. An open item's panel is a region named by its button. `AccordionHeading` is a title in a tier's look that folds nothing (the heading element itself, no button, no box round it), and `AccordionBody` is the band body's side inset with no band above it. A tooltip's `side` is a preference: near an edge the bubble slides along that side to stay 8 px clear of it, and flips to the opposite side when its own has no room, keeping inside the screen and inside the shell window that owns its trigger (UI-11). It never leaves that box: a bubble wider than the room wraps, and one taller than the room is cut off at it. The bubble is drawn on `<body>`, in a `fixed` layer laid over its trigger, so a scrolling pane or an `overflow-hidden` box around the trigger cannot cut it off; it follows the trigger when that moves and closes once the trigger has scrolled out of sight. A small arrow on the edge facing the trigger points at the trigger's centre wherever the bubble ended up, kept clear of the bubble's corners; it is the bubble's own surface (`.rosh-tooltip-arrow` in `ui.css`), seamless, and hidden from assistive technology. The bubble is SOLID, not glass, in every setting: the kit's solid popup surface (`--rosh-glass-surface`, `--rosh-glass-solid-border`, `--rosh-glass-solid-shadow`), so words behind a small bubble never mix with its own. `open` holds a tooltip open (or shut) whatever the pointer does: for a drag over a place that refuses the drop, when the browser sends no hover. |
1728
1728
  | `StepChain`, `StepChainItem` | A chain of steps for work in progress — a one-line summary that opens to steps, each with a status glyph (`pending`, `active`, `complete`, `failed`, `stopped`, `waiting`, `skipped`), a label, a one-line `description` and folded detail. Open while `busy`, folded to its summary when the work is done, and a click always wins; `aria-expanded` on the toggle, the summary is a polite live region, the spinner and chevron respect reduced motion. Modelled on the "Chain of Thought" shape of Vercel AI Elements (no code copied). The assistant chat's tool calls and a plan checklist draw with it. |
1729
1729
  | `Stepper` | A linear wizard's progress strip — numbered circles, connectors, `aria-current="step"`. Controlled like Tabs; completed steps are clickable to go back (when `onChange` is wired), upcoming steps never are — moving forward belongs to the wizard's own Continue button, behind its validation. |
1730
1730
  | `DataTable` | Read-only table for server-driven lists: it renders and reports, and never sorts or pages its own `data`. Controlled sort and pager, row selection, column groups, pinned columns, windowed rendering. `onRow` gives a row `onClick`, a `className`, any `data-*` attributes for its `<tr>` — a test's or a stylesheet's hook (`data-testid`, `data-state`) — the pointer and the keyboard coming in and out (`onMouseEnter` … `onBlur`) and `current`. `rowHref` makes each row one real link (`onRowPress` a button) with its controls still pressable — see [DataTable rows that are links](#datatable-rows-that-are-links). `stackOnNarrow` turns each row into a labelled card on a narrow container — see [DataTable on a narrow screen](#datatable-on-a-narrow-screen). |
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-ZKGUBIBT.js";import"./chunk-QBWMWK2W.js";import"./chunk-W7DYKTHE.js";import"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-B7EVVJHY.js";import{WindowTitle as n}from"./chunk-TKPUYQ3Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y6E7IRK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-WLUJQLXG.js";import{confirm as s}from"./chunk-5QYKF7NK.js";import"./chunk-PMBCQWJW.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-2VFSYSDS.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WQ4YKWN2.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-LAOG7AED.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-ZICGXJUB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as a}from"./chunk-JOAKKXTL.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,W]=c(w),[S,R]=c([w]),[z,D]=c(0),[L,J]=c(0),[E,K]=c(x),[M,T]=c(!1),[G,U]=c(null),Q=i(null),Y=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(E))}catch{}},[E]);const H=e=>{const t=f(e);t&&(v(t),W(t),R(e=>{const o=e.slice(0,z+1);return o.push(t),o}),D(e=>e+1),T(!1))},A=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},B=()=>{const e=G?.trim();e?(K(t=>[...t,{label:e,url:w}]),U(null)):U(null)};l(()=>{if(null===G)return;Q.current?.focus(),Q.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||U(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==G]);const I=e=>{K(t=>t.filter((t,o)=>o!==e))},O=z>0,F=z<S.length-1,P=E.some(e=>e.url===w),V="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-6RK6R3RY.js";import"./chunk-SFULX4E3.js";import"./chunk-FTMCNC66.js";import"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-XVIJHDZ4.js";import{WindowTitle as n}from"./chunk-XQNZJNEJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import{confirm as s}from"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-7U3BSTN2.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as a}from"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as l,useState as c}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),l(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=c(y),[w,v]=c(k||b),[C,W]=c(w),[R,S]=c([w]),[D,z]=c(0),[J,M]=c(0),[E,H]=c(x),[L,T]=c(!1),[U,X]=c(null),A=i(null),F=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(E))}catch{}},[E]);const G=e=>{const t=f(e);t&&(v(t),W(t),S(e=>{const o=e.slice(0,D+1);return o.push(t),o}),z(e=>e+1),T(!1))},I=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},K=()=>{const e=U?.trim();e?(H(t=>[...t,{label:e,url:w}]),X(null)):X(null)};l(()=>{if(null===U)return;A.current?.focus(),A.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||X(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const O=e=>{H(t=>t.filter((t,o)=>o!==e))},Z=D>0,Y=D<R.length-1,B=E.some(e=>e.url===w),Q="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
2
2
  return m("div",{className:"relative flex flex-col h-full bg-white",children:[
3
3
  /* @__PURE__ */u(n,{title:`Browser - ${N(w)}`}),
4
4
  /* @__PURE__ */u(r,{app:"browser"}),
5
5
  /* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
6
- /* @__PURE__ */u("button",{onClick:()=>{if(z>0){const e=z-1;D(e),v(S[e]),W(S[e]),T(!1)}},disabled:!O,className:V,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(z<S.length-1){const e=z+1;D(e),v(S[e]),W(S[e]),T(!1)}},disabled:!F,className:V,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>J(e=>e+1),className:V,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>H(b),className:V,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
- /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),H(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
6
+ /* @__PURE__ */u("button",{onClick:()=>{if(D>0){const e=D-1;z(e),v(R[e]),W(R[e]),T(!1)}},disabled:!Z,className:Q,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(D<R.length-1){const e=D+1;z(e),v(R[e]),W(R[e]),T(!1)}},disabled:!Y,className:Q,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>M(e=>e+1),className:Q,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
+ /* @__PURE__ */u("button",{onClick:()=>G(b),className:Q,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
+ /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),G(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
11
11
  /* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
12
12
  /* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>W(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
13
13
  /* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>W(w)}})})]})}),
14
- /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>P?I(E.findIndex(e=>e.url===w)):void U(N(w)),className:V+" "+(P?"text-yellow-500":""),title:P?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:P?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:A,className:V,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>T(e=>!e),className:V,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==G&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>B?O(E.findIndex(e=>e.url===w)):void X(N(w)),className:Q+" "+(B?"text-yellow-500":""),title:B?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:B?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:I,className:Q,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
+ /* @__PURE__ */u("button",{onClick:()=>T(e=>!e),className:Q,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
17
17
  /* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
18
18
  /* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
19
- /* @__PURE__ */u("input",{ref:Q,type:"text",value:G,onChange:e=>U(e.target.value),onKeyDown:e=>{"Enter"===e.key?B():"Escape"===e.key&&U(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
19
+ /* @__PURE__ */u("input",{ref:A,type:"text",value:U,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key?K():"Escape"===e.key&&X(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
20
20
  /* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
21
- /* @__PURE__ */u("button",{onClick:()=>U(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:B,disabled:!G.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
- /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===E.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),E.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>H(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&I(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
21
+ /* @__PURE__ */u("button",{onClick:()=>X(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
+ /* @__PURE__ */u("button",{onClick:K,disabled:!U.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
23
+ /* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===E.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),E.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>G(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&O(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
24
24
  /* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
25
25
  /* @__PURE__ */u("div",{className:"flex-1"}),
26
26
  /* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(p,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
27
- /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:L,iframeRef:Y,openExternal:A,showHelp:M,dismissHelp:()=>T(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
27
+ /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:J,iframeRef:F,openExternal:I,showHelp:L,dismissHelp:()=>T(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=c(!1);l(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
28
28
  /* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
29
29
  /* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[N(e)," can't be embedded"]}),
30
30
  /* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
@@ -0,0 +1,29 @@
1
+ import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-ZLKEPDJE.js";import{useWidgetSettings as n}from"./chunk-XQNZJNEJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as r}from"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[y,x]=c(""),[C,f]=c([]),[v,$]=c(!1),[E,J]=c(()=>e(h)),[D,M]=c(!1),[T,W]=c(E),S=i(null);n(o(()=>{W({...E}),M(!0)},[E]));const A=o(e=>{x(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),F=o(()=>{k("0"),d(null),g(null),N(!1)},[]),X=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),w=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=X(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,X]),U=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=X(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,X]),Z=o(()=>{k(e=>String(parseFloat(e)/100))},[]),G=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?A(e.key):"."===e.key?A("."):"+"===e.key?w("+"):"-"===e.key?w("-"):"*"===e.key?w("×"):"/"===e.key?(e.preventDefault(),w("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&S.current?.contains(e.target)&&e.preventDefault(),U()):"Escape"===e.key?F():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&Z())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[A,w,U,F,Z]);const H="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",K=`${H} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,L=`${H} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,Q=`${H} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,B=`${H} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
2
+ return l(a,{children:[
3
+ /* @__PURE__ */l("div",{ref:S,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
4
+ /* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
5
+ /* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:C.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${j?"":m}`}),
6
+ /* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
7
+ /* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
8
+ /* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
9
+ /* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
10
+ /* @__PURE__ */u("button",{onClick:F,className:Q,children:"AC"}),
11
+ /* @__PURE__ */u("button",{onClick:G,className:Q,children:"+/−"}),
12
+ /* @__PURE__ */u("button",{onClick:Z,className:Q,children:"%"}),
13
+ /* @__PURE__ */u("button",{onClick:()=>w("÷"),className:`${L} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
14
+ /* @__PURE__ */u("button",{onClick:()=>A("7"),className:K,children:"7"}),
15
+ /* @__PURE__ */u("button",{onClick:()=>A("8"),className:K,children:"8"}),
16
+ /* @__PURE__ */u("button",{onClick:()=>A("9"),className:K,children:"9"}),
17
+ /* @__PURE__ */u("button",{onClick:()=>w("×"),className:`${L} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
18
+ /* @__PURE__ */u("button",{onClick:()=>A("4"),className:K,children:"4"}),
19
+ /* @__PURE__ */u("button",{onClick:()=>A("5"),className:K,children:"5"}),
20
+ /* @__PURE__ */u("button",{onClick:()=>A("6"),className:K,children:"6"}),
21
+ /* @__PURE__ */u("button",{onClick:()=>w("-"),className:`${L} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
22
+ /* @__PURE__ */u("button",{onClick:()=>A("1"),className:K,children:"1"}),
23
+ /* @__PURE__ */u("button",{onClick:()=>A("2"),className:K,children:"2"}),
24
+ /* @__PURE__ */u("button",{onClick:()=>A("3"),className:K,children:"3"}),
25
+ /* @__PURE__ */u("button",{onClick:()=>w("+"),className:`${L} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
26
+ /* @__PURE__ */u("button",{onClick:()=>A("0"),className:`${K} col-span-2`,children:"0"}),
27
+ /* @__PURE__ */u("button",{onClick:()=>A("."),className:K,children:"."}),
28
+ /* @__PURE__ */u("button",{onClick:U,className:B,children:"="})]})]}),
29
+ /* @__PURE__ */u(t,{open:D,onClose:()=>M(!1),title:"Calculator Settings",appearance:T,onAppearanceChange:W,onSave:()=>{J(T),localStorage.setItem(h,JSON.stringify(T)),M(!1)}})]})}export{m as default};
@@ -1,6 +1,6 @@
1
- import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-YTZFWV2W.js";import{useWidgetSettings as r}from"./chunk-TKPUYQ3Q.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-Y6E7IRK2.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-WLUJQLXG.js";import"./chunk-5QYKF7NK.js";import"./chunk-PMBCQWJW.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-2VFSYSDS.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-WQ4YKWN2.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-ZICGXJUB.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-JOAKKXTL.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,x]=s(()=>t(h)),[y,b]=s({}),[S,D]=s(!1),[C,v]=s(!1),[J,U]=s([]),[W,Y]=s(f),[G,M]=s("USD"),[A,K]=s("CNY");r(o(()=>{U([...u]),Y({...f}),v(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){D(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(b(r),D(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
1
+ import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-ZLKEPDJE.js";import{useWidgetSettings as r}from"./chunk-XQNZJNEJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DK5SXOXJ.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-UR2ECNBB.js";import"./chunk-HMT3MES3.js";import"./chunk-D2WJAF62.js";import"./chunk-MWTCGJAI.js";import"./chunk-RIG5FEVS.js";import"./chunk-5WK56FA3.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-CJHYOHMU.js";import"./chunk-JZBLOIL7.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-THLXDI76.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import"./chunk-XZXFUZIK.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-JSHMIMAJ.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,x]=s(()=>t(h)),[y,D]=s({}),[b,S]=s(!1),[J,C]=s(!1),[v,U]=s([]),[M,A]=s(f),[H,B]=s("USD"),[G,R]=s("CNY");r(o(()=>{U([...u]),A({...f}),C(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(D(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
2
2
  return i(a,{children:[
3
- /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[S&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
3
+ /* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
4
4
  return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
5
5
  /* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
6
6
  /* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
@@ -9,13 +9,13 @@ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
9
9
  /* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
10
10
  /* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
11
11
  /* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
12
- /* @__PURE__ */m(e,{open:C,onClose:()=>v(!1),title:"Currency Settings",appearance:W,onAppearanceChange:Y,onSave:()=>{if(0===J.length)return;const t=J.slice(0,4);d(t),x(W),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(W)),v(!1)},children:/* @__PURE__ */i("div",{children:[
12
+ /* @__PURE__ */m(e,{open:J,onClose:()=>C(!1),title:"Currency Settings",appearance:M,onAppearanceChange:A,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);d(t),x(M),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(M)),C(!1)},children:/* @__PURE__ */i("div",{children:[
13
13
  /* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
14
- /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",J.length,"/",4,")"]})]}),
15
- /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:J.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
14
+ /* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",v.length,"/",4,")"]})]}),
15
+ /* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:v.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
16
16
  /* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
17
- /* @__PURE__ */m("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),J.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
- /* @__PURE__ */m("select",{value:G,onChange:t=>M(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
17
+ /* @__PURE__ */m("button",{onClick:()=>U(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),v.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
18
+ /* @__PURE__ */m("select",{value:H,onChange:t=>B(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
19
19
  /* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
20
- /* @__PURE__ */m("select",{value:A,onChange:t=>K(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
- /* @__PURE__ */m("button",{onClick:()=>{G!==A&&J.length<4&&U(t=>[...t,[G,A]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
20
+ /* @__PURE__ */m("select",{value:G,onChange:t=>R(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
21
+ /* @__PURE__ */m("button",{onClick:()=>{H!==G&&v.length<4&&U(t=>[...t,[H,G]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};