@hearthscale/app-ui 0.2.0 → 0.2.2

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/dist/TOKENS.md CHANGED
@@ -58,7 +58,7 @@ one family apart.
58
58
  | `--hov-page` | `color-mix(in srgb, var(--card) 65%, var(--win))` | | yes | yes | |
59
59
  | `--plate` | `color-mix(in srgb, var(--card) 60%, var(--win))` | | yes | yes | |
60
60
  | `--hov-plate` | `color-mix(in srgb, var(--text) 7%, var(--plate))` | | yes | yes | |
61
- | `--press` | `none` | | yes | no | |
61
+ | `--pressed` | `color-mix(in srgb, var(--text) 14%, transparent)` | | yes | yes | |
62
62
  | `--act` | `rgba(158, 166, 182, 0.19)` | `rgba(255, 255, 255, 0.55)` | yes | yes | |
63
63
  | `--accent` | `#ff9d2e` | | yes | yes | |
64
64
  | `--link` | `var(--accent)` | | yes | yes | |
@@ -307,6 +307,7 @@ one family apart.
307
307
  | `--dur-arrive` | `0.6s` | | yes | no | reduced motion: `0s` |
308
308
  | `--dur-glow` | `0.35s` | | yes | no | |
309
309
  | `--dur-scroll` | `25ms` | | yes | no | reduced motion: `0s` |
310
+ | `--press` | `none` | | yes | no | |
310
311
  | `--press-fade` | `1` | | yes | no | |
311
312
  | `--hov-lift` | `none` | | yes | no | |
312
313
  | `--fs-mono-xs` | `10.5px` | | yes | no | |
@@ -84,6 +84,7 @@ var REMIX = {
84
84
  link: "M18.3638 15.5355L16.9496 14.1213L18.3638 12.7071C20.3164 10.7545 20.3164 7.58866 18.3638 5.63604C16.4112 3.68341 13.2453 3.68341 11.2927 5.63604L9.87849 7.05025L8.46428 5.63604L9.87849 4.22182C12.6122 1.48815 17.0443 1.48815 19.778 4.22182C22.5117 6.95549 22.5117 11.3876 19.778 14.1213L18.3638 15.5355ZM15.5353 18.364L14.1211 19.7782C11.3875 22.5118 6.95531 22.5118 4.22164 19.7782C1.48797 17.0445 1.48797 12.6123 4.22164 9.87868L5.63585 8.46446L7.05007 9.87868L5.63585 11.2929C3.68323 13.2455 3.68323 16.4113 5.63585 18.364C7.58847 20.3166 10.7543 20.3166 12.7069 18.364L14.1211 16.9497L15.5353 18.364ZM14.8282 7.75736L16.2425 9.17157L9.17139 16.2426L7.75717 14.8284L14.8282 7.75736Z",
85
85
  "lock-fill": "M19 10H20C20.5523 10 21 10.4477 21 11V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V11C3 10.4477 3.44772 10 4 10H5V9C5 5.13401 8.13401 2 12 2C15.866 2 19 5.13401 19 9V10ZM17 10V9C17 6.23858 14.7614 4 12 4C9.23858 4 7 6.23858 7 9V10H17ZM11 14V18H13V14H11Z",
86
86
  "lock-unlock-line": "M7 10H20C20.5523 10 21 10.4477 21 11V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V11C3 10.4477 3.44772 10 4 10H5V9C5 5.13401 8.13401 2 12 2C14.7405 2 17.1131 3.5748 18.2624 5.86882L16.4731 6.76344C15.6522 5.12486 13.9575 4 12 4C9.23858 4 7 6.23858 7 9V10ZM5 12V20H19V12H5ZM10 15H14V17H10V15Z",
87
+ "logout-box-r-line": "M5 22C4.44772 22 4 21.5523 4 21V3C4 2.44772 4.44772 2 5 2H19C19.5523 2 20 2.44772 20 3V6H18V4H6V20H18V18H20V21C20 21.5523 19.5523 22 19 22H5ZM18 16V13H11V11H18V8L23 12L18 16Z",
87
88
  "mail-line": "M3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM20 7.23792L12.0718 14.338L4 7.21594V19H20V7.23792ZM4.51146 5L12.0619 11.662L19.501 5H4.51146Z",
88
89
  "menu-line": "M3 4H21V6H3V4ZM3 11H21V13H3V11ZM3 18H21V20H3V18Z",
89
90
  "mic-fill": "M11.9998 1C14.7612 1 16.9998 3.23858 16.9998 6V10C16.9998 12.7614 14.7612 15 11.9998 15C9.23833 15 6.99976 12.7614 6.99976 10V6C6.99976 3.23858 9.23833 1 11.9998 1ZM3.05469 11H5.07065C5.55588 14.3923 8.47329 17 11.9998 17C15.5262 17 18.4436 14.3923 18.9289 11H20.9448C20.4837 15.1716 17.1714 18.4839 12.9998 18.9451V23H10.9998V18.9451C6.82814 18.4839 3.51584 15.1716 3.05469 11Z",
@@ -285,6 +286,7 @@ var TranslateGlyph = remix("translate", "translate-2");
285
286
  var LinkGlyph = remix("link", "link");
286
287
  var MailGlyph = remix("mail", "mail-line");
287
288
  var KeyGlyph = remix("key", "key-2-line");
289
+ var SignOutGlyph = remix("sign-out", "logout-box-r-line");
288
290
  var RestartGlyph = remix("restart", "restart-line");
289
291
  var PROGRESS = [
290
292
  remix("progress-1", "progress-1-fill"),
@@ -319,6 +321,7 @@ var FolderAddGlyph = remix("folder-add", "folder-add-line");
319
321
 
320
322
  export {
321
323
  HelpGlyph,
324
+ TrashGlyph,
322
325
  ChevronRightGlyph,
323
326
  ChevronDownGlyph,
324
327
  CheckGlyph,
package/dist/index.d.ts CHANGED
@@ -394,6 +394,7 @@ declare function useFloatingTips(placement?: TipPlacement): (key: string, text:
394
394
  hover: {
395
395
  onMouseEnter: (e: MouseEvent<HTMLElement>) => void;
396
396
  onMouseLeave: () => void;
397
+ onMouseDown: () => void;
397
398
  };
398
399
  tip: react.JSX.Element | null;
399
400
  };
@@ -406,13 +407,16 @@ interface ShellConfirmProps {
406
407
  /** The action's look: `danger` where the action destroys something,
407
408
  * `primary` where it installs or buys. */
408
409
  tone?: 'danger' | 'primary';
410
+ /** The mark before the action's label. A `danger` action without one
411
+ * carries the delete mark. */
412
+ icon?: ReactNode;
409
413
  onConfirm: () => void;
410
414
  onCancel: () => void;
411
415
  }
412
416
  /** A confirmation dialog styled by the theme, with presence and operability
413
417
  * maintained by the guard layer. It asks the person while it shows.
414
418
  * @category Overlays */
415
- declare function ShellConfirm({ title, body, action, tone, onConfirm, onCancel, }: ShellConfirmProps): react.JSX.Element;
419
+ declare function ShellConfirm({ title, body, action, tone, icon, onConfirm, onCancel, }: ShellConfirmProps): react.JSX.Element;
416
420
 
417
421
  interface OverlayScrollProps {
418
422
  /** The scroller's own classes: its overflow, its padding and the gap
package/dist/index.js CHANGED
@@ -8,8 +8,9 @@ import {
8
8
  ExternalGlyph,
9
9
  HelpGlyph,
10
10
  PackageGlyph,
11
- SearchGlyph
12
- } from "./chunks/chunk-E3RFTBRS.js";
11
+ SearchGlyph,
12
+ TrashGlyph
13
+ } from "./chunks/chunk-SFZCPZQD.js";
13
14
 
14
15
  // ../ui/dist/Button.js
15
16
  import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
@@ -422,9 +423,12 @@ function useFloatingTips(placement) {
422
423
  const [shown, setShown] = useState(null);
423
424
  const [hide] = useState(() => () => setShown(null));
424
425
  return (key, text, chip) => ({
426
+ // A press closes the tip until the pointer leaves, as the CSS tip does,
427
+ // so no tip stays under a menu its element opens.
425
428
  hover: {
426
429
  onMouseEnter: (e) => setShown({ key, anchor: e.currentTarget }),
427
- onMouseLeave: () => setShown(null)
430
+ onMouseLeave: () => setShown(null),
431
+ onMouseDown: () => setShown(null)
428
432
  },
429
433
  tip: text && shown?.key === key && shown.anchor.isConnected ? _jsx5(FloatingTip, { anchor: shown.anchor, text, chip, ...placement && { placement }, onPress: hide }) : null
430
434
  });
@@ -434,7 +438,7 @@ function useFloatingTips(placement) {
434
438
  function Chip({ children, tone = "neutral", icon, title, selected, onClick }) {
435
439
  const tips = useFloatingTips();
436
440
  const { hover, tip } = tips("chip", title);
437
- const content = _jsxs4(_Fragment2, { children: [icon && _jsx6("span", { className: "hs-chip-mark", children: icon }), _jsx6("span", { className: "hs-chip-text", children }), tip] });
441
+ const content = _jsxs4(_Fragment2, { children: [icon && _jsx6("span", { className: "hs-chip-mark", children: icon }), _jsx6("span", { className: "hs-chip-text", ...selected !== void 0 && typeof children === "string" && { "data-text": children }, children }), tip] });
438
442
  if (selected !== void 0) {
439
443
  return _jsx6("button", { type: "button", className: "hs-chip", "data-sel": selected ? "true" : "false", "aria-pressed": selected, onClick, ...hover, children: content });
440
444
  }
@@ -616,7 +620,7 @@ function useAsksPerson(on) {
616
620
  }
617
621
 
618
622
  // ../ui/dist/ShellConfirm.js
619
- function ShellConfirm({ title, body, action, tone = "danger", onConfirm, onCancel }) {
623
+ function ShellConfirm({ title, body, action, tone = "danger", icon = tone === "danger" ? _jsx14(TrashGlyph, { size: 13 }) : void 0, onConfirm, onCancel }) {
620
624
  useAsksPerson(true);
621
625
  useEffect5(() => {
622
626
  const onKey = (e) => {
@@ -631,7 +635,7 @@ function ShellConfirm({ title, body, action, tone = "danger", onConfirm, onCance
631
635
  return _jsx14("div", { className: "hs-confirm", onClick: (e) => {
632
636
  e.stopPropagation();
633
637
  onCancel();
634
- }, children: _jsxs8("div", { className: "hs-confirm-box", role: "dialog", onClick: (e) => e.stopPropagation(), children: [_jsx14("span", { className: "hs-confirm-title", children: title }), _jsx14("span", { className: "hs-confirm-body", children: body }), _jsxs8("div", { className: "hs-confirm-footer", children: [_jsx14(Button, { className: "hs-confirm-cancel", onClick: onCancel, children: "Cancel" }), _jsx14(Button, { className: "hs-confirm-action", variant: tone, onClick: onConfirm, children: action })] })] }) });
638
+ }, children: _jsxs8("div", { className: "hs-confirm-box", role: "dialog", onClick: (e) => e.stopPropagation(), children: [_jsx14("span", { className: "hs-confirm-title", children: title }), _jsx14("span", { className: "hs-confirm-body", children: body }), _jsxs8("div", { className: "hs-confirm-footer", children: [_jsx14(Button, { className: "hs-confirm-cancel", onClick: onCancel, children: "Cancel" }), _jsx14(Button, { className: "hs-confirm-action", variant: tone, icon, onClick: onConfirm, children: action })] })] }) });
635
639
  }
636
640
 
637
641
  // ../ui/dist/OverlayScroll.js
package/dist/markdown.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CopyGlyph
3
- } from "./chunks/chunk-E3RFTBRS.js";
3
+ } from "./chunks/chunk-SFZCPZQD.js";
4
4
 
5
5
  // ../ui/dist/chat/markdown.js
6
6
  import { jsx as _jsx5, Fragment as _Fragment } from "react/jsx-runtime";
package/dist/ui.css CHANGED
@@ -3670,6 +3670,17 @@
3670
3670
  align-items: center;
3671
3671
  gap: calc(var(--space) * 1.25);
3672
3672
  }
3673
+ .hs-chip[data-sel] > .hs-chip-text[data-text] {
3674
+ display: inline-flex;
3675
+ flex-direction: column;
3676
+ }
3677
+ .hs-chip[data-sel] > .hs-chip-text[data-text]::after {
3678
+ content: attr(data-text);
3679
+ height: 0;
3680
+ overflow: hidden;
3681
+ visibility: hidden;
3682
+ font-weight: var(--fw-semi);
3683
+ }
3673
3684
  .hs-chip[data-sel='true'] {
3674
3685
  background: var(--hov);
3675
3686
  border-color: var(--tipline);
@@ -3873,6 +3884,7 @@
3873
3884
  line-height: 1.15;
3874
3885
  color: var(--text);
3875
3886
  text-align: center;
3887
+ text-wrap: balance;
3876
3888
  }
3877
3889
  .hs-walk-sub {
3878
3890
  margin-top: calc(var(--space) * 2);
@@ -5451,7 +5463,7 @@
5451
5463
  color: var(--text);
5452
5464
  }
5453
5465
  .hs-button:is( [data-variant='secondary'], [data-variant='danger'], [data-variant='ghost'] ):active:not(:disabled) {
5454
- background: var(--press);
5466
+ background: var(--pressed);
5455
5467
  }
5456
5468
  .hs-button:focus-visible {
5457
5469
  outline: none;
@@ -5498,7 +5510,7 @@
5498
5510
  border: 0;
5499
5511
  border-radius: var(--r-ctl);
5500
5512
  background: transparent;
5501
- color: var(--dim);
5513
+ color: var(--mut);
5502
5514
  cursor: pointer;
5503
5515
  }
5504
5516
  .hs-icon-button[data-size='sm'] {
@@ -5519,7 +5531,7 @@
5519
5531
  color: var(--text);
5520
5532
  }
5521
5533
  .hs-icon-button:active:not(:disabled) {
5522
- background: var(--press);
5534
+ background: var(--pressed);
5523
5535
  color: var(--text);
5524
5536
  }
5525
5537
  .hs-icon-button:focus-visible {
@@ -10497,9 +10509,9 @@
10497
10509
  @supports (color: color-mix(in lab, red, red)) {
10498
10510
  --hov-plate: color-mix(in srgb, var(--text) 7%, var(--plate));
10499
10511
  }
10500
- --press: var(--text);
10512
+ --pressed: var(--text);
10501
10513
  @supports (color: color-mix(in lab, red, red)) {
10502
- --press: color-mix(in srgb, var(--text) 14%, transparent);
10514
+ --pressed: color-mix(in srgb, var(--text) 14%, transparent);
10503
10515
  }
10504
10516
  --act: rgba(158, 166, 182, 0.19);
10505
10517
  --accent: #ff9d2e;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hearthscale/app-ui",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "The UI kit of a Hearthscale app's view: the design system's tokens, hs-* classes and React parts, and the whole Remix Icon set.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://hearthscale.com/docs/developers/views/kit",