efficient-shell 12.14.0 → 12.16.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.
- package/README.md +53 -2
- package/dist/{Browser-V35ERC75.js → Browser-7JNZKYCH.js} +14 -14
- package/dist/{Calculator-FY7CWH3U.js → Calculator-4VBPCGRP.js} +23 -23
- package/dist/{CurrencyConverter-X2ZMKSB6.js → CurrencyConverter-34AMD4W7.js} +5 -5
- package/dist/{Files-5QCSSGZO.js → Files-2CUER7VQ.js} +92 -92
- package/dist/{Notepad-2AXGNMRM.js → Notepad-S2COZUMR.js} +9 -9
- package/dist/{PomodoroTimer-LQM4OSNO.js → PomodoroTimer-6WR3UOOM.js} +69 -69
- package/dist/{Preview-NI7HTAAW.js → Preview-C3JK6FBV.js} +31 -31
- package/dist/{Stock-ENUIGK4M.js → Stock-UAGSFAKY.js} +2 -2
- package/dist/{Weather-QRQVA3LE.js → Weather-G2VGEQX2.js} +19 -19
- package/dist/{WorldClock-QJOV3TND.js → WorldClock-43KK7OTT.js} +6 -6
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +20 -20
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/{chunk-3HZS3BAZ.js → chunk-25QDSYH5.js} +13 -13
- package/dist/chunk-27RPYRRI.js +2 -0
- package/dist/chunk-3UKNOOSL.js +4 -0
- package/dist/chunk-3W4JUMFI.js +1 -0
- package/dist/{chunk-2ZPNA7L7.js → chunk-5DQE6RQJ.js} +1 -1
- package/dist/chunk-5HLLCX6X.js +2 -0
- package/dist/{chunk-QU23OGAX.js → chunk-5QYKF7NK.js} +17 -17
- package/dist/chunk-5XCASBGK.js +5 -0
- package/dist/chunk-5ZT3FJ2W.js +2 -0
- package/dist/{chunk-LFYZ7NQ4.js → chunk-64RHGJXK.js} +4 -4
- package/dist/chunk-6RHKNP2Q.js +2 -0
- package/dist/chunk-6V3BNCDT.js +2 -0
- package/dist/chunk-ABQWWMTO.js +2 -0
- package/dist/chunk-ASPLTZBH.js +2 -0
- package/dist/chunk-BAWT5QBA.js +2 -0
- package/dist/chunk-CDGK3TOO.js +2 -0
- package/dist/chunk-CYU454QR.js +2 -0
- package/dist/chunk-DLOTU5XU.js +5 -0
- package/dist/chunk-DRMIQ3YE.js +1 -0
- package/dist/chunk-DRSPB4ZE.js +2 -0
- package/dist/chunk-DSOV33XA.js +1 -0
- package/dist/{chunk-UEEELXEN.js → chunk-DVYBJOD3.js} +10 -10
- package/dist/chunk-DWGYC7OD.js +1 -0
- package/dist/chunk-ECJSGHFD.js +2 -0
- package/dist/chunk-EJRRJXDG.js +2 -0
- package/dist/chunk-FIW2BUK2.js +2 -0
- package/dist/{chunk-KX53AB74.js → chunk-H4ABSQS6.js} +1 -1
- package/dist/chunk-H7RDZRJ4.js +2 -0
- package/dist/chunk-HBDNQ3ER.js +4 -0
- package/dist/chunk-HNBMBC77.js +1 -0
- package/dist/{chunk-FUTLZ6BC.js → chunk-HYPYNVQQ.js} +1 -1
- package/dist/{chunk-NBNYKV3D.js → chunk-IFGNAY56.js} +9 -9
- package/dist/chunk-J3Z4U2CT.js +2 -0
- package/dist/{chunk-CJ3MI2NH.js → chunk-JQWZ36JD.js} +1 -1
- package/dist/chunk-KELGQ7WI.js +2 -0
- package/dist/{chunk-LTUVKDTO.js → chunk-LNZMA4PB.js} +1 -1
- package/dist/chunk-LSADTBPH.js +4 -0
- package/dist/{chunk-XDJQWP5K.js → chunk-MBCUICY3.js} +1 -1
- package/dist/chunk-MEF5E2JA.js +2 -0
- package/dist/{chunk-IIC76MWQ.js → chunk-MFJHLC5M.js} +1 -1
- package/dist/{chunk-DJYZ2EF4.js → chunk-MJVFIH3J.js} +11 -11
- package/dist/chunk-MUNG4VXE.js +2 -0
- package/dist/chunk-N3THYDNV.js +2 -0
- package/dist/{chunk-5WZ53AS5.js → chunk-OFYNPYY2.js} +1 -1
- package/dist/chunk-OYJAXZFU.js +2 -0
- package/dist/{chunk-BWYOTLJL.js → chunk-PDA77NNC.js} +3 -3
- package/dist/{chunk-SDL4VWFU.js → chunk-PJE75B66.js} +1 -1
- package/dist/chunk-PMBCQWJW.js +4 -0
- package/dist/chunk-PTJIGNKA.js +4 -0
- package/dist/{chunk-KCAUYEYR.js → chunk-QBWMWK2W.js} +6 -6
- package/dist/chunk-QIFGQE6V.js +2 -0
- package/dist/chunk-RIG5FEVS.js +1 -0
- package/dist/chunk-RMKC5POE.js +3 -0
- package/dist/chunk-SRR4MAA6.js +4 -0
- package/dist/chunk-SZ6J44ZK.js +2 -0
- package/dist/chunk-THRSU75M.js +2 -0
- package/dist/{chunk-G6LSBF3P.js → chunk-TKPUYQ3Q.js} +29 -29
- package/dist/chunk-TO6CUG4Y.js +4 -0
- package/dist/chunk-TUA2VQO7.js +4 -0
- package/dist/{chunk-QJGZOD6X.js → chunk-TW7SWDKZ.js} +7 -4
- package/dist/chunk-U77527G3.js +2 -0
- package/dist/{chunk-R7QEGRKE.js → chunk-UHK4MAFE.js} +1 -1
- package/dist/chunk-US6NOIGO.js +6 -0
- package/dist/chunk-VIWM4GD7.js +2 -0
- package/dist/chunk-VL6SOWP5.js +2 -0
- package/dist/chunk-VPXAOSVH.js +28 -0
- package/dist/chunk-WBLA7EHW.js +2 -0
- package/dist/{chunk-OCI3PZDU.js → chunk-WCCGKDG6.js} +2 -2
- package/dist/chunk-WPT5DUCQ.js +2 -0
- package/dist/chunk-WWABT3IW.js +5 -0
- package/dist/chunk-WX5KKB3X.js +4 -0
- package/dist/chunk-X7BRR6UW.js +5 -0
- package/dist/chunk-XAC2GAOD.js +4 -0
- package/dist/chunk-XL4QM2D3.js +5 -0
- package/dist/chunk-XLWPIUZB.js +2 -0
- package/dist/chunk-XN3KM6YE.js +4 -0
- package/dist/chunk-XW336CNF.js +2 -0
- package/dist/{chunk-5VGIIMON.js → chunk-YC42NCCA.js} +1 -1
- package/dist/chunk-YFUY3VDW.js +9 -0
- package/dist/{chunk-AELSVMXH.js → chunk-YTZFWV2W.js} +1 -1
- package/dist/{chunk-ICZUWLVU.js → chunk-YVHEKEHJ.js} +1 -1
- package/dist/{chunk-LIX6KTZJ.js → chunk-Z62RBVEJ.js} +1 -1
- package/dist/{chunk-EZ6O5TQ3.js → chunk-ZE7OVMDM.js} +16 -16
- package/dist/chunk-ZILBCVKS.js +2 -0
- package/dist/{chunk-CU3ZE25J.js → chunk-ZKGUBIBT.js} +1 -1
- package/dist/{chunk-6KITIRNZ.js → chunk-ZQT3GNRU.js} +2 -2
- package/dist/format/index.d.ts +152 -1
- package/dist/format/index.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/Input.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/PictureTiles.js +1 -1
- package/dist/forms/RenameField.js +1 -1
- package/dist/forms/Select.d.ts +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/TextToolbar.d.ts +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/textAlign.d.ts +1 -1
- package/dist/icons/efficient-glyphs.d.ts +16 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +32 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +16 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +16 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/EntranceBounceIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceBounceIcon.js +1 -0
- package/dist/icons/glyphs/EntranceFadeIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceFadeIcon.js +1 -0
- package/dist/icons/glyphs/EntranceFlipIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceFlipIcon.js +1 -0
- package/dist/icons/glyphs/EntranceGlideIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceGlideIcon.js +1 -0
- package/dist/icons/glyphs/EntranceRevealIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceRevealIcon.js +1 -0
- package/dist/icons/glyphs/EntranceRiseIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceRiseIcon.js +1 -0
- package/dist/icons/glyphs/EntranceScaleIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceScaleIcon.js +1 -0
- package/dist/icons/glyphs/EntranceSpinIcon.d.ts +8 -0
- package/dist/icons/glyphs/EntranceSpinIcon.js +1 -0
- package/dist/icons/glyphs/LoopMarqueeIcon.d.ts +8 -0
- package/dist/icons/glyphs/LoopMarqueeIcon.js +1 -0
- package/dist/icons/glyphs/ScrollFadeInIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollFadeInIcon.js +1 -0
- package/dist/icons/glyphs/ScrollFadeOutIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollFadeOutIcon.js +1 -0
- package/dist/icons/glyphs/ScrollMoveDownIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollMoveDownIcon.js +1 -0
- package/dist/icons/glyphs/ScrollMoveUpIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollMoveUpIcon.js +1 -0
- package/dist/icons/glyphs/ScrollParallaxIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollParallaxIcon.js +1 -0
- package/dist/icons/glyphs/ScrollZoomInIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollZoomInIcon.js +1 -0
- package/dist/icons/glyphs/ScrollZoomOutIcon.d.ts +8 -0
- package/dist/icons/glyphs/ScrollZoomOutIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/EntranceBounceMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceBounceMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceBounceSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceBounceSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceFadeMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceFadeMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceFadeSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceFadeSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceFlipMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceFlipMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceFlipSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceFlipSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceGlideMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceGlideMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceGlideSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceGlideSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceRevealMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceRevealMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceRevealSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceRevealSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceRiseMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceRiseMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceRiseSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceRiseSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceScaleMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceScaleMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceScaleSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceScaleSolidIcon.js +1 -0
- package/dist/icons/looks/EntranceSpinMiniIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceSpinMiniIcon.js +1 -0
- package/dist/icons/looks/EntranceSpinSolidIcon.d.ts +8 -0
- package/dist/icons/looks/EntranceSpinSolidIcon.js +1 -0
- package/dist/icons/looks/LoopMarqueeMiniIcon.d.ts +8 -0
- package/dist/icons/looks/LoopMarqueeMiniIcon.js +1 -0
- package/dist/icons/looks/LoopMarqueeSolidIcon.d.ts +8 -0
- package/dist/icons/looks/LoopMarqueeSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollFadeInMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollFadeInMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollFadeInSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollFadeInSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollFadeOutMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollFadeOutMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollFadeOutSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollFadeOutSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollMoveDownMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollMoveDownMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollMoveDownSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollMoveDownSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollMoveUpMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollMoveUpMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollMoveUpSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollMoveUpSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollParallaxMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollParallaxMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollParallaxSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollParallaxSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollZoomInMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollZoomInMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollZoomInSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollZoomInSolidIcon.js +1 -0
- package/dist/icons/looks/ScrollZoomOutMiniIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollZoomOutMiniIcon.js +1 -0
- package/dist/icons/looks/ScrollZoomOutSolidIcon.d.ts +8 -0
- package/dist/icons/looks/ScrollZoomOutSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +505 -505
- package/dist/motion.css +130 -1
- package/dist/{names-Cj_F68_V.d.ts → names-BNKpHeTy.d.ts} +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +1 -1
- package/dist/shell/Popover.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/Tabs.d.ts +9 -0
- package/dist/shell/Tabs.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/discardGuard.js +1 -1
- package/dist/shell/focusTrap.d.ts +6 -1
- package/dist/shell/focusTrap.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/AuthScreen.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/templates/GalleryTemplate.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3DVNXNTF.js +0 -1
- package/dist/chunk-AQZUTW7N.js +0 -9
- package/dist/chunk-CDAJKLGL.js +0 -1
- package/dist/chunk-FYNPQAFI.js +0 -1
- package/dist/chunk-LZKPV3XR.js +0 -3
- package/dist/chunk-MLPXTFDS.js +0 -1
- package/dist/chunk-PCZSE6CC.js +0 -5
- package/dist/chunk-SNLGA2PZ.js +0 -1
- package/dist/chunk-YHB6MJYD.js +0 -28
- package/dist/chunk-YYW4VNWL.js +0 -1
- /package/dist/{chunk-3N5OI6VM.js → chunk-2VFSYSDS.js} +0 -0
- /package/dist/{chunk-NQJXHV4K.js → chunk-VT7QZPIO.js} +0 -0
package/README.md
CHANGED
|
@@ -1707,7 +1707,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
|
|
|
1707
1707
|
| `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. |
|
|
1708
1708
|
| `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. |
|
|
1709
1709
|
| `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). |
|
|
1710
|
-
| `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; 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). |
|
|
1710
|
+
| `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). |
|
|
1711
1711
|
| `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. |
|
|
1712
1712
|
| `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. |
|
|
1713
1713
|
| `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. |
|
|
@@ -1717,7 +1717,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
|
|
|
1717
1717
|
| `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. |
|
|
1718
1718
|
| `Avatar`, `AvatarGroup` | User avatar with initials fallback + status dot; overlapping stack with +N overflow. |
|
|
1719
1719
|
| `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. |
|
|
1720
|
-
| `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 `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. |
|
|
1720
|
+
| `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. |
|
|
1721
1721
|
| `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. |
|
|
1722
1722
|
| `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. |
|
|
1723
1723
|
| `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). |
|
|
@@ -2402,6 +2402,57 @@ the inline `--motion-entrance-duration` / `--motion-entrance-delay`.
|
|
|
2402
2402
|
plays it once when it arrives; `playEntrance(el)` plays it now. With reduced
|
|
2403
2403
|
motion nothing waits and nothing plays. The keyframes are in `motion.css`.
|
|
2404
2404
|
|
|
2405
|
+
**Scroll.** A part plays an effect as the visitor scrolls, and a section can
|
|
2406
|
+
stay pinned to the screen while its parts play. `SCROLL_EFFECTS` (None, Zoom
|
|
2407
|
+
in, Zoom out, Fade in, Fade out, Move up, Move down, Reveal, Parallax);
|
|
2408
|
+
`SCROLL_EFFECTS_WITH_ZOOM` names the two that take a Zoom. `SCROLL_ZOOM` is the
|
|
2409
|
+
size added to the whole picture in percent (0–100, step 10, default 30 = 1.3
|
|
2410
|
+
times), toward the picture's focus point. `SCROLL_START` / `SCROLL_END` are
|
|
2411
|
+
where in the scroll the part plays (0–100 %). `PIN_LENGTH` is how long a
|
|
2412
|
+
section stays pinned, in screens (0–4, default 2; 0 = the next section slides
|
|
2413
|
+
over at once). `readScroll(effect, zoom, start, end)` and `readPin(on, length)`
|
|
2414
|
+
read stored values (an End before its Start swaps with it).
|
|
2415
|
+
`scrollAttrs(value, origin?)` and `pinAttrs(value)` give the element its
|
|
2416
|
+
attributes (`data-motion-scroll`, `data-motion-pin`) and, only when changed,
|
|
2417
|
+
the inline custom properties; the pinned frame carries `data-motion-pin-frame`.
|
|
2418
|
+
This is the one pin of the system, in two forms (`PIN_FORMS`,
|
|
2419
|
+
`pinAttrs(value, form)`): `track` (the default: a one-screen frame inside a
|
|
2420
|
+
track of effect screens, then the next section slides over) and `stick` (the
|
|
2421
|
+
section itself, at its own height, stays from its stop until its parent ends,
|
|
2422
|
+
and every later section slides over it: a host's "stick to top" and a
|
|
2423
|
+
slide-over intro). A host draws every pin with it, never with a sticky rule of
|
|
2424
|
+
its own, so one section never carries two pins. The shell has no screen
|
|
2425
|
+
widths, so a host gives each of its views an answer in its own media query:
|
|
2426
|
+
the track reads `--motion-pin-on` (1 pinned, the default; 0 drawn as a plain
|
|
2427
|
+
section), `--motion-pin-top` (where the frame stops, default `0px`; a host with
|
|
2428
|
+
a pinned header gives its height) and `--motion-pin-length`; the stick form
|
|
2429
|
+
reads `--motion-pin-top` and `--motion-pin-position` (`sticky`, the default;
|
|
2430
|
+
`static` for a view where it is off). The track and frame take minimum
|
|
2431
|
+
heights, so a frame with more content than one screen grows. Inside a track,
|
|
2432
|
+
Start and End (written 0-100, no unit) are shares of the effect screens,
|
|
2433
|
+
counted from the moment the frame sticks, so a stop is exact. `--motion-scroll-distance` (default `20vh`) tunes Move up and Move down,
|
|
2434
|
+
and `--motion-parallax-distance` (default `12%`) the parallax.
|
|
2435
|
+
Inside a pinned section a part's progress is the scroll through the pin's
|
|
2436
|
+
effect screens; outside one it is the part's own pass through the screen. Only
|
|
2437
|
+
opacity, transform and clip-path move. One element plays one animation: an
|
|
2438
|
+
element that also has an Entrance keeps it and plays no scroll effect, so a
|
|
2439
|
+
host that offers both puts the scroll attributes on a wrapper. A browser
|
|
2440
|
+
without scroll timelines gets `armScrollProgress(root)`, which writes
|
|
2441
|
+
`--motion-p` once per frame, measured from the layout box (`layoutBox`), so the
|
|
2442
|
+
effect's own translate or scale does not move it;
|
|
2443
|
+
`scrollProgress` is the same sum, for a host that needs the number. With
|
|
2444
|
+
reduced motion a track does not pin and every part shows its own look, with
|
|
2445
|
+
no effect; a stuck section (the stick form) still sticks, as nothing moves on it.
|
|
2446
|
+
|
|
2447
|
+
**Hover.** `HOVER_KINDS` is the one list of hover kinds, in panel order (None,
|
|
2448
|
+
Next image, Rotate, Zoom, Lift, Black and white). `hoverKindsOf(offered)` gives
|
|
2449
|
+
the kinds one thing offers, in the list's order. The words and what each kind
|
|
2450
|
+
draws stay with the host.
|
|
2451
|
+
|
|
2452
|
+
The Animation tab's tiles draw from the icon set: `Entrance*Icon` for each
|
|
2453
|
+
Entrance kind, `Scroll*Icon` for each Scroll effect (Reveal is
|
|
2454
|
+
`EntranceRevealIcon`, None is `NoSymbolIcon`) and `LoopMarqueeIcon`.
|
|
2455
|
+
|
|
2405
2456
|
**Corners.** A component does not pick a step of the scale for itself; it asks
|
|
2406
2457
|
for the radius of what it is. Five role tokens, each defaulting to the step that
|
|
2407
2458
|
role has always drawn, so they change nothing until you set one:
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import{InputEndActionButton as e}from"./chunk-
|
|
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-YC42NCCA.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-3W4JUMFI.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),[J,L]=c(0),[M,K]=c(x),[T,U]=c(!1),[E,G]=c(null),Q=i(null),Y=i(null);l(()=>{try{localStorage.setItem(d,JSON.stringify(M))}catch{}},[M]);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),U(!1))},A=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},I=()=>{const e=E?.trim();e?(K(t=>[...t,{label:e,url:w}]),G(null)):G(null)};l(()=>{if(null===E)return;Q.current?.focus(),Q.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||G(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==E]);const B=e=>{K(t=>t.filter((t,o)=>o!==e))},F=z>0,O=z<S.length-1,P=M.some(e=>e.url===w),X="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(
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(S
|
|
8
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
9
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
10
|
-
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),
|
|
6
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(z>0){const e=z-1;D(e),v(S[e]),W(S[e]),U(!1)}},disabled:!F,className:X,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]),U(!1)}},disabled:!O,className:X,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */u("button",{onClick:()=>L(e=>e+1),className:X,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
9
|
+
/* @__PURE__ */u("button",{onClick:()=>H(b),className:X,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:[
|
|
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?
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>U(e=>!e),className:
|
|
14
|
+
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>P?B(M.findIndex(e=>e.url===w)):void G(N(w)),className:X+" "+(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:X,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>U(e=>!e),className:X,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==E&&/* @__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:
|
|
19
|
+
/* @__PURE__ */u("input",{ref:Q,type:"text",value:E,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?I():"Escape"===e.key&&G(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:()=>
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:
|
|
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===
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>G(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:I,disabled:!E.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===M.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),M.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"})&&B(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:
|
|
27
|
+
/* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:J,iframeRef:Y,openExternal:A,showHelp:T,dismissHelp:()=>U(!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 ",
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-
|
|
1
|
+
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-YTZFWV2W.js";import{useWidgetSettings 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"./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{Icon as r}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{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),[W,J]=c(()=>e(h)),[T,S]=c(!1),[E,D]=c(W),M=i(null);n(o(()=>{D({...W}),S(!0)},[W]));const Q=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)},[]),G=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}},[]),K=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=G(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,G]),w=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=G(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,G]),A=o(()=>{k(e=>String(parseFloat(e)/100))},[]),U=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"?Q(e.key):"."===e.key?Q("."):"+"===e.key?K("+"):"-"===e.key?K("-"):"*"===e.key?K("×"):"/"===e.key?(e.preventDefault(),K("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&M.current?.contains(e.target)&&e.preventDefault(),w()):"Escape"===e.key?F():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&A())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[Q,K,w,F,A]);const Y="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",L=`${Y} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,X=`${Y} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,Z=`${Y} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,B=`${Y} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
2
|
return l(a,{children:[
|
|
3
|
-
/* @__PURE__ */l("div",{ref:
|
|
3
|
+
/* @__PURE__ */l("div",{ref:M,className:"flex flex-col h-full",style:{opacity:W.activeOpacity/100,backdropFilter:W.activeBlur>0?`blur(${W.activeBlur}px)`:void 0},children:[
|
|
4
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:
|
|
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
6
|
/* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
|
|
7
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
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
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:
|
|
11
|
-
/* @__PURE__ */u("button",{onClick:U,className:
|
|
12
|
-
/* @__PURE__ */u("button",{onClick:
|
|
13
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
14
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
17
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
18
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
19
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
20
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
21
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
23
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
24
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
25
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
26
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
27
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
28
|
-
/* @__PURE__ */u("button",{onClick:w,className:
|
|
29
|
-
/* @__PURE__ */u(t,{open:T,onClose:()=>
|
|
10
|
+
/* @__PURE__ */u("button",{onClick:F,className:Z,children:"AC"}),
|
|
11
|
+
/* @__PURE__ */u("button",{onClick:U,className:Z,children:"+/−"}),
|
|
12
|
+
/* @__PURE__ */u("button",{onClick:A,className:Z,children:"%"}),
|
|
13
|
+
/* @__PURE__ */u("button",{onClick:()=>K("÷"),className:`${X} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("7"),className:L,children:"7"}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("8"),className:L,children:"8"}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("9"),className:L,children:"9"}),
|
|
17
|
+
/* @__PURE__ */u("button",{onClick:()=>K("×"),className:`${X} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("4"),className:L,children:"4"}),
|
|
19
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("5"),className:L,children:"5"}),
|
|
20
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("6"),className:L,children:"6"}),
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>K("-"),className:`${X} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("1"),className:L,children:"1"}),
|
|
23
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("2"),className:L,children:"2"}),
|
|
24
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("3"),className:L,children:"3"}),
|
|
25
|
+
/* @__PURE__ */u("button",{onClick:()=>K("+"),className:`${X} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("0"),className:`${L} col-span-2`,children:"0"}),
|
|
27
|
+
/* @__PURE__ */u("button",{onClick:()=>Q("."),className:L,children:"."}),
|
|
28
|
+
/* @__PURE__ */u("button",{onClick:w,className:B,children:"="})]})]}),
|
|
29
|
+
/* @__PURE__ */u(t,{open:T,onClose:()=>S(!1),title:"Calculator Settings",appearance:E,onAppearanceChange:D,onSave:()=>{J(E),localStorage.setItem(h,JSON.stringify(E)),S(!1)}})]})}export{m as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-
|
|
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__ */
|
|
2
2
|
return i(a,{children:[
|
|
3
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__ */
|
|
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:[
|
|
@@ -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:
|
|
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:[
|
|
13
13
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
|
|
14
14
|
/* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",J.length,"/",4,")"]})]}),
|
|
15
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:[
|
|
16
16
|
/* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
|
|
17
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:
|
|
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))}),
|
|
19
19
|
/* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
|
|
20
|
-
/* @__PURE__ */m("select",{value:
|
|
21
|
-
/* @__PURE__ */m("button",{onClick:()=>{
|
|
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};
|