@ntmats/hc-ui 0.7.0 → 0.9.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/dist/index.d.ts CHANGED
@@ -310,6 +310,7 @@ export interface DialogProps extends Omit<HTMLAttributes<HTMLDialogElement>, 'ti
310
310
  */
311
311
  export declare const Dialog: ForwardRefExoticComponent<DialogProps & RefAttributes<HTMLDialogElement>>;
312
312
  export type SheetPresentation = 'bottom' | 'center' | 'auto';
313
+ export type SheetHeight = 'content' | 'half';
313
314
  interface SheetBaseProps extends Omit<DialogProps, 'size' | 'actions' | 'description' | 'closeLabel' | 'title'> {
314
315
  /** Slot under the scrolling body, for the buttons (Clear | Done). */
315
316
  footer?: ReactNode;
@@ -321,6 +322,13 @@ interface SheetBaseProps extends Omit<DialogProps, 'size' | 'actions' | 'descrip
321
322
  presentation?: SheetPresentation;
322
323
  /** Maximum width of the centered panel, in px. Default 440. */
323
324
  width?: number;
325
+ /**
326
+ * Resting height at the bottom. `content` (default) grows with the content up to almost the
327
+ * whole screen. `half` rests at half the screen, so what is behind stays in sight (dimmed),
328
+ * and the content scrolls inside; a drag up from the grabber or header still goes to full
329
+ * height, and a drag down from there comes back to half. No effect on the centered panel.
330
+ */
331
+ height?: SheetHeight;
324
332
  }
325
333
  /**
326
334
  * `Sheet` props. By default the sheet has a header with the title (its accessible name) and a
@@ -346,7 +354,8 @@ export type SheetProps = SheetBaseProps & ({
346
354
  * Tab trap, Esc, focus return, scroll lock, stacking and controlled `open`/`onClose`.
347
355
  * At the bottom it has a grabber, drag to close (past 20% of its height or a quick
348
356
  * flick) and drag up from the grabber or header to full height; content that has
349
- * scrolled down scrolls back before the sheet moves.
357
+ * scrolled down scrolls back before the sheet moves. `height="half"` rests at half the
358
+ * screen instead of growing with the content.
350
359
  */
351
360
  export declare const Sheet: ForwardRefExoticComponent<SheetProps & RefAttributes<HTMLDialogElement>>;
352
361
  export interface SheetOption<T extends string> {
@@ -944,9 +953,18 @@ export interface CombatDialViewProps {
944
953
  /**
945
954
  * `comfortable` (default): 40px cells. `compact`: 34px cells, 6px gaps, 13px numbers and
946
955
  * tighter point chips, for dense lists (HCUI's compact dial of the unit view on phones).
956
+ * `dense`: 25px cells and rows, 3px between rows, 11–12px numbers, the compact header,
957
+ * for a dial next to other content (the Arena's table card).
947
958
  * The printed presentation keeps its own measures.
948
959
  */
949
- density?: 'comfortable' | 'compact';
960
+ density?: 'comfortable' | 'compact' | 'dense';
961
+ /**
962
+ * How the current click is marked. `bar` (default): a muted column with a thin accent
963
+ * bar on top. `framed`: the column is framed in light gray behind the cells and the click
964
+ * number becomes a filled circle in the text color, easier to find mid-game; the power
965
+ * colors stay intact. Ignored by the printed presentation.
966
+ */
967
+ currentMark?: 'bar' | 'framed';
950
968
  /** Without it the dial is static: it neither marks nor changes the click; only cells with a tip react. */
951
969
  onClickChange?: (click: number) => void;
952
970
  onSelectPoint: (point: CombatDialPoint) => void;
package/dist/index.js CHANGED
@@ -602,7 +602,7 @@ function useSheetDrag(sheet, latest) {
602
602
  };
603
603
  }, [sheet, latest]);
604
604
  }
605
- var Sheet = forwardRef(function Sheet2({ presentation = "auto", width = 440, footer, dismissible = true, header = true, onClose, className, style, ...props }, ref) {
605
+ var Sheet = forwardRef(function Sheet2({ presentation = "auto", width = 440, height = "content", footer, dismissible = true, header = true, onClose, className, style, ...props }, ref) {
606
606
  const [node, setNode] = useState(null);
607
607
  const setRef = useCallback((element) => {
608
608
  setNode(element);
@@ -626,7 +626,8 @@ var Sheet = forwardRef(function Sheet2({ presentation = "auto", width = 440, foo
626
626
  headerless: !header,
627
627
  className: classes("hc-ui-sheet", className),
628
628
  style: sized,
629
- "data-presentation": presentation
629
+ "data-presentation": presentation,
630
+ "data-height": height === "half" ? "half" : void 0
630
631
  }
631
632
  );
632
633
  });
@@ -1573,6 +1574,7 @@ var CombatDialView = forwardRef(function CombatDialView2({
1573
1574
  labels,
1574
1575
  presentation = "default",
1575
1576
  density = "comfortable",
1577
+ currentMark = "bar",
1576
1578
  onClickChange,
1577
1579
  onSelectPoint,
1578
1580
  tip,
@@ -1676,7 +1678,7 @@ var CombatDialView = forwardRef(function CombatDialView2({
1676
1678
  COMBAT_DIAL_STATS.map((stat) => /* @__PURE__ */ jsx("div", { className: "hc-ui-combat-dial__cell", "data-kind": "ko", children: labels.koCell }, stat))
1677
1679
  ] })
1678
1680
  ] }, rowIndex);
1679
- return /* @__PURE__ */ jsxs("section", { ref, className: "hc-ui-combat-dial", "data-presentation": presentation, "data-density": density === "compact" ? "compact" : void 0, "data-static": flag(!tracksClick), children: [
1681
+ return /* @__PURE__ */ jsxs("section", { ref, className: "hc-ui-combat-dial", "data-presentation": presentation, "data-density": density === "comfortable" ? void 0 : density, "data-current-mark": currentMark === "framed" ? "framed" : void 0, "data-static": flag(!tracksClick), children: [
1680
1682
  presentation !== "printed" && /* @__PURE__ */ jsxs("header", { className: "hc-ui-combat-dial__header", children: [
1681
1683
  /* @__PURE__ */ jsxs("div", { className: "hc-ui-combat-dial__header-top", children: [
1682
1684
  /* @__PURE__ */ jsx("span", { className: "hc-ui-combat-dial__label", children: labels.heading }),
package/dist/styles.css CHANGED
@@ -854,6 +854,11 @@
854
854
  border-radius: 20px 20px 0 0;
855
855
  }
856
856
  [data-hc-ds] .hc-ui-sheet[data-presentation='bottom'][data-closing] { animation: hc-ui-sheet-down var(--hc-dur-medium) var(--hc-ease-emphasized-accel) forwards; }
857
+ /* height="half": rests at half the screen; the body scrolls. Expanded still wins (full height). */
858
+ [data-hc-ds] .hc-ui-sheet[data-presentation='bottom'][data-height='half']:not([data-expanded]) {
859
+ height: 50dvh;
860
+ max-height: 50dvh;
861
+ }
857
862
 
858
863
  @media (max-width: 959.98px) {
859
864
  [data-hc-ds] .hc-ui-sheet[data-presentation='auto'] {
@@ -888,6 +893,10 @@
888
893
  border-radius: 20px 20px 0 0;
889
894
  }
890
895
  [data-hc-ds] .hc-ui-sheet[data-presentation='auto'][data-closing] { animation: hc-ui-sheet-down var(--hc-dur-medium) var(--hc-ease-emphasized-accel) forwards; }
896
+ [data-hc-ds] .hc-ui-sheet[data-presentation='auto'][data-height='half']:not([data-expanded]) {
897
+ height: 50dvh;
898
+ max-height: 50dvh;
899
+ }
891
900
  }
892
901
 
893
902
  /* Closing by drag: the backdrop fades with the sheet instead of waiting for the exit. */
@@ -1906,6 +1915,47 @@
1906
1915
  [data-hc-ds] .hc-ui-combat-dial[data-density='compact']:not([data-presentation='printed']) :is(.hc-ui-combat-dial__cell[data-kind='value'], .hc-ui-combat-dial__range) { font-size: var(--hc-font-size-sm); }
1907
1916
  [data-hc-ds] .hc-ui-combat-dial[data-density='compact']:not([data-presentation='printed']) .hc-ui-combat-dial__special-icon { width: 18px; height: 18px; }
1908
1917
 
1918
+ /* `density="dense"`: the compact header (point chips) with 25px cells and rows, 3px between
1919
+ rows and 6px between clicks, 11px click numbers and 12px values, 15px special icons:
1920
+ a dial that sits beside other content (the Arena's table card). */
1921
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__header { gap: 0; }
1922
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__points { gap: var(--hc-space-1); padding: var(--hc-space-1) 0; }
1923
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__chip { gap: var(--hc-space-2); padding: var(--hc-space-2); border-radius: var(--hc-radius-lg); }
1924
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__grid-wrap { padding: 5px 0; }
1925
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__grid { gap: 6px; }
1926
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__col { grid-template-rows: repeat(5, 25px); gap: 3px; }
1927
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__col[data-start]::before { top: 28px; }
1928
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__cell { width: 25px; height: 25px; }
1929
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__cell[data-tip]::after { inset: -2px; }
1930
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__cell[data-kind='number'] { font-size: 11px; }
1931
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) :is(.hc-ui-combat-dial__cell:is([data-kind='value'], [data-kind='ko']), .hc-ui-combat-dial__range) { font-size: 12px; }
1932
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__special-icon { width: 15px; height: 15px; }
1933
+ [data-hc-ds] .hc-ui-combat-dial[data-density='dense']:not([data-presentation='printed']) .hc-ui-combat-dial__bolt { height: 11px; }
1934
+
1935
+ /* `currentMark="framed"`: the current click's column is framed in light gray behind its
1936
+ cells (a little larger than them) and its number becomes a filled circle in the text
1937
+ color. Shape and contrast mark it without relying on color; the power colors stay. */
1938
+ [data-hc-ds] .hc-ui-combat-dial[data-current-mark='framed']:not([data-presentation='printed']) .hc-ui-combat-dial__col[data-current] {
1939
+ isolation: isolate;
1940
+ background: none;
1941
+ box-shadow: none;
1942
+ }
1943
+ [data-hc-ds] .hc-ui-combat-dial[data-current-mark='framed']:not([data-presentation='printed']) .hc-ui-combat-dial__col[data-current]::after {
1944
+ content: '';
1945
+ position: absolute;
1946
+ inset: -4px -3px;
1947
+ z-index: -1;
1948
+ border-radius: 8px;
1949
+ background: var(--hc-color-bg-muted-2);
1950
+ box-shadow: inset 0 0 0 1px var(--hc-color-border);
1951
+ }
1952
+ [data-hc-ds] .hc-ui-combat-dial[data-current-mark='framed']:not([data-presentation='printed']) .hc-ui-combat-dial__col[data-current] .hc-ui-combat-dial__cell[data-kind='number'] {
1953
+ border-radius: 50%;
1954
+ background: var(--hc-color-text-primary);
1955
+ color: var(--hc-color-text-inverse);
1956
+ font-weight: 800;
1957
+ }
1958
+
1909
1959
  /* `presentation="printed"`: the physical card's dial, at HCUnits' measures (20px
1910
1960
  cells, 23px between clicks, 24px between rows); the white legend sits on the
1911
1961
  card's dark window. Its numbers use the `font` shorthand, with ROND right after it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ntmats/hc-ui",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "description": "Shared HCUI/Arena React presentation primitives.",
6
6
  "license": "UNLICENSED",