@flood-md/react 0.2.8 → 0.2.9

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 CHANGED
@@ -6,9 +6,12 @@ HTML semantics and refs, no third-party component library or Tailwind dependency
6
6
  Named imports support tree shaking in optimizing ES-module bundlers. Import the
7
7
  shared stylesheet explicitly; styles are not split by component.
8
8
 
9
- This package documents the **0.2.8** source API. Keep Flood package versions aligned and follow the guide matching
9
+ This package documents the **0.2.9** source API. Keep Flood package versions aligned and follow the guide matching
10
10
  your installed declarations; source changes do not modify an existing npm release.
11
11
 
12
+ Version 0.2.9 improves constrained file rows, Drawer readability and Select pointer
13
+ focus without changing public signatures or token values.
14
+
12
15
  Version 0.2.8 adds TimePicker, DateTimeRangePicker, unified Calendar day/month/year views,
13
16
  HoverCard, ColorSwatch, ColorPicker, TreeSelect,
14
17
  DateTimePicker, DataList, DataListItem, CheckCard, RadioCard, DataTable, FileItem/FileList, FileMeta, UploadItem/UploadList and ImagePreview. Color values are opaque RGB hex; TreeSelect selects one item;
@@ -892,7 +892,7 @@
892
892
  }
893
893
 
894
894
  /* Drawer keeps the modal runtime; only geometry and body containment differ. */
895
- .flood-root .flood-drawer { --flood-drawer-size: 26rem; --flood-drawer-x: 0%; --flood-drawer-y: 0%; position: fixed; inset: 0; margin: 0; box-sizing: border-box; display: grid; grid-template-areas: "header" "description" "body" "footer"; grid-template-rows: auto auto minmax(0, 1fr) auto; inline-size: min(var(--flood-drawer-size), 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; border-radius: 0; overflow: hidden; padding-block-start: max(var(--flood-sys-space-4), env(safe-area-inset-top)); padding-block-end: max(var(--flood-sys-space-6), env(safe-area-inset-bottom)); }
895
+ .flood-root .flood-drawer { --flood-drawer-size: 26rem; --flood-drawer-x: 0%; --flood-drawer-y: 0%; position: fixed; inset: 0; margin: 0; box-sizing: border-box; display: grid; grid-template-areas: "header" "description" "body" "footer"; grid-template-rows: auto auto minmax(calc(min(8rem, 30dvh) + var(--flood-sys-space-4)), 1fr) auto; inline-size: min(var(--flood-drawer-size), 100vw); max-inline-size: 100vw; block-size: 100dvh; max-block-size: 100dvh; border-radius: 0; overflow: auto; container-type: inline-size; container-name: flood-drawer; padding-inline: min(var(--flood-sys-space-6), 5vi); padding-block-start: max(min(var(--flood-sys-space-4), 4dvh), env(safe-area-inset-top)); padding-block-end: max(min(var(--flood-sys-space-6), 4dvh), env(safe-area-inset-bottom)); }
896
896
  .flood-root .flood-drawer[data-size="sm"] { --flood-drawer-size: 20rem; }
897
897
  .flood-root .flood-drawer[data-size="lg"] { --flood-drawer-size: 34rem; }
898
898
  .flood-root .flood-drawer[data-side="end"] { inset-inline-start: auto; inset-inline-end: 0; border-start-start-radius: var(--flood-sys-radius-block); border-end-start-radius: var(--flood-sys-radius-block); --flood-drawer-x: 100%; }
@@ -906,7 +906,7 @@
906
906
  .flood-root .flood-drawer > .flood-overlay-description { grid-area: description; }
907
907
  .flood-root .flood-drawer__body { grid-area: body; min-block-size: 0; min-inline-size: 0; margin-block-start: var(--flood-sys-space-4); }
908
908
  .flood-root .flood-drawer .flood-overlay-body { margin: 0; }
909
- .flood-root .flood-drawer__footer { grid-area: footer; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--flood-sys-space-2); margin-block-start: var(--flood-sys-space-4); padding-block-start: var(--flood-sys-space-4); border-block-start: var(--flood-sys-stroke-width) solid var(--flood-sys-color-border-decorative); }
909
+ .flood-root .flood-drawer__footer { grid-area: footer; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--flood-sys-space-2); margin-block-start: min(var(--flood-sys-space-4), 2dvh); padding-block-start: min(var(--flood-sys-space-4), 2dvh); border-block-start: var(--flood-sys-stroke-width) solid var(--flood-sys-color-border-decorative); }
910
910
  .flood-root .flood-drawer__footer > * { max-inline-size: 100%; }
911
911
  @keyframes flood-drawer-enter { from { transform: translate(var(--flood-drawer-x), var(--flood-drawer-y)); } to { transform: translate(0, 0); } }
912
912
  @media (prefers-reduced-motion: no-preference) { .flood-root .flood-drawer[open] { animation: flood-drawer-enter var(--flood-sys-motion-duration-fast) var(--flood-sys-motion-easing); } }
@@ -915,6 +915,9 @@
915
915
  .flood-root .flood-drawer > .flood-overlay-header { position: relative; padding-inline-end: calc(max(var(--flood-sys-control-sm-height), var(--flood-sys-size-touch)) + var(--flood-sys-space-2)); align-items: flex-start; }
916
916
  .flood-root .flood-drawer > .flood-overlay-header > .flood-overlay-close { position: absolute; inset-block-start: 0; inset-inline-end: 0; }
917
917
  .flood-root .flood-drawer > .flood-overlay-description { margin-block-start: var(--flood-sys-space-1); padding-inline-end: calc(max(var(--flood-sys-control-sm-height), var(--flood-sys-size-touch)) + var(--flood-sys-space-2)); }
918
+ @container flood-drawer (max-width:20rem) {
919
+ .flood-root .flood-drawer > .flood-overlay-description { padding-inline-end: 0; }
920
+ }
918
921
 
919
922
  /* Floating surfaces use a distinct material; modal surfaces retain their fill. */
920
923
  .flood-root :is(.flood-overlay-panel, .flood-select__menu) { background: var(--flood-sys-color-surface-floating); border-color: var(--flood-sys-color-border-floating); box-shadow: 0 var(--flood-sys-effect-floating-shadow-offset) var(--flood-sys-effect-floating-shadow-blur) var(--flood-sys-color-shadow-floating); }
@@ -1487,13 +1490,14 @@
1487
1490
  .flood-root .flood-data-table__footer nav { margin-inline-start:auto; max-inline-size:100%; }
1488
1491
  @media(forced-colors:active) { .flood-root .flood-data-table tr[data-selected] { outline:1px solid Highlight; } }
1489
1492
 
1490
- .flood-root .flood-file-list { box-sizing:border-box; padding-inline:var(--flood-sys-space-4); border:var(--flood-sys-stroke-width) solid var(--flood-sys-color-border-decorative); border-radius:var(--flood-sys-radius-field); background:var(--flood-sys-color-surface-default); }
1493
+ .flood-root .flood-file-list { box-sizing:border-box; padding-inline:var(--flood-sys-space-4); border:var(--flood-sys-stroke-width) solid var(--flood-sys-color-border-decorative); border-radius:var(--flood-sys-radius-field); background:var(--flood-sys-color-surface-default); container-type:inline-size; container-name:flood-files; }
1491
1494
  .flood-root .flood-file-item__thumbnail { display:grid; place-items:center; flex:none; inline-size:var(--flood-sys-control-md-height); block-size:var(--flood-sys-control-md-height); border-radius:var(--flood-sys-radius-action); color:var(--flood-sys-color-content-subtle); overflow:hidden; background:var(--flood-sys-color-field-background); }
1492
1495
  .flood-root .flood-file-item__thumbnail img { display:block; inline-size:100%; block-size:100%; object-fit:cover; }
1493
1496
  .flood-root .flood-file-item__name { overflow-wrap:anywhere; }
1494
1497
  .flood-root .flood-file-item__heading { display:flex; align-items:center; flex-wrap:wrap; gap:var(--flood-sys-space-1) var(--flood-sys-space-2); min-inline-size:0; }
1495
1498
  .flood-root .flood-file-item__heading>.flood-file-item__name { min-inline-size:0; }
1496
- .flood-root .flood-file-meta { flex:none; white-space:nowrap; color:var(--flood-sys-color-content-subtle); font-weight:400; }
1499
+ .flood-root .flood-file-meta { flex:0 1 auto; max-inline-size:100%; flex-wrap:wrap; white-space:normal; overflow-wrap:anywhere; color:var(--flood-sys-color-content-subtle); font-weight:400; }
1500
+ .flood-root .flood-file-meta>span { min-inline-size:0; }
1497
1501
  .flood-root .flood-file-item .flood-data-list-item__trailing { flex:none; max-inline-size:none; }
1498
1502
  .flood-root .flood-upload-item .flood-data-list-item__copy { align-self:center; }
1499
1503
  .flood-root .flood-upload-item__status-row { display:flex; align-items:center; gap:var(--flood-sys-space-2); min-inline-size:0; }
@@ -1509,6 +1513,14 @@
1509
1513
  .flood-root .flood-image-preview__caption { margin-block-start:var(--flood-sys-space-2); font-size:var(--flood-sys-type-compact-size); line-height:var(--flood-sys-type-compact-line-height); color:var(--flood-sys-color-content-subtle); }
1510
1514
  .flood-root .flood-image-preview__actions { display:flex; justify-content:flex-end; margin-block-start:var(--flood-sys-space-4); }
1511
1515
  @media(max-width:30rem){.flood-root .flood-file-list>.flood-file-item { flex-wrap:nowrap; }.flood-root .flood-file-item__thumbnail{inline-size:var(--flood-sys-control-sm-height);block-size:var(--flood-sys-control-sm-height);}}
1516
+ @container flood-files (max-width:16rem){
1517
+ .flood-root .flood-file-list>.flood-file-item:not([hidden]) { display:grid; grid-template-columns:minmax(0,1fr); }
1518
+ .flood-root .flood-file-item .flood-data-list-item__trailing { justify-content:flex-start; }
1519
+ .flood-root .flood-file-item .flood-data-list-item__actions { flex-wrap:wrap; }
1520
+ .flood-root .flood-upload-item__status-row { flex-wrap:wrap; }
1521
+ .flood-root .flood-upload-item__status-row[data-progress]>.flood-status-indicator { flex:0 1 auto; min-inline-size:0; white-space:normal; }
1522
+ .flood-root .flood-upload-item .flood-indicator { flex-basis:100%; }
1523
+ }
1512
1524
 
1513
1525
  .flood-root .flood-time-picker__panel { inline-size:min(var(--flood-time-picker-width,22rem),var(--flood-overlay-available-width,calc(100dvw - 1rem))); padding:var(--flood-sys-space-1); }
1514
1526
  .flood-root .flood-time-picker__scroll { max-block-size:min(15rem,calc(var(--flood-overlay-available-height,60dvh) - 1rem)); }
package/dist/select.js CHANGED
@@ -269,11 +269,22 @@ export const SingleSelect = /* @__PURE__ */ forwardRef(function SingleSelect({ c
269
269
  commit(index); }, children: [_jsx("span", { children: choice.label }), _jsx("span", { className: "flood-select__selected", "aria-hidden": "true", children: choice.value === currentValue ? "✓" : "" })] }, `${index}-${choice.value}`);
270
270
  return _jsxs("span", { className: `flood-select flood-select--custom flood-control--${controlSize}`, dir: nativeProps.dir, lang: nativeProps.lang, hidden: nativeProps.hidden, children: [_jsx("button", { ...visibleAttributes, ref: trigger, id: triggerId, type: "button", role: "combobox", disabled: disabled, tabIndex: nativeProps.tabIndex, accessKey: nativeProps.accessKey, dir: nativeProps.dir, lang: nativeProps.lang, hidden: nativeProps.hidden, className: ["flood-input flood-select__control", `flood-control--${controlSize}`, className].filter(Boolean).join(" "), style: style, title: title, "aria-label": ariaLabel, "aria-labelledby": labelledBy, "aria-describedby": descriptions, "data-status": resolveFieldStatus(status, invalid || Boolean(validation), ariaInvalid), "aria-invalid": invalid || status === "error" || ariaInvalid || Boolean(validation) || undefined, "aria-required": required || undefined, "aria-expanded": open, "aria-haspopup": "listbox", "aria-controls": menuId, "aria-activedescendant": open && active >= 0 && choices[active] && !choices[active].hidden ? `${menuId}-${active}` : undefined, onFocus: (event) => { if (onFocus)
271
271
  mirror(new FocusEvent("focusin", { bubbles: true, relatedTarget: event.relatedTarget })); }, onBlur: (event) => { if (onBlur)
272
- mirror(new FocusEvent("focusout", { bubbles: true, relatedTarget: event.relatedTarget })); }, onClick: () => { if (onClick && !mirror(new MouseEvent("click", { bubbles: true, cancelable: true })))
273
- return; if (open)
274
- setOpen(false);
275
- else
276
- openMenu(); }, onKeyUp: (event) => { if (onKeyUp)
272
+ mirror(new FocusEvent("focusout", { bubbles: true, relatedTarget: event.relatedTarget })); }, onMouseDown: (event) => {
273
+ // Keep an already-focused combobox from blurring to the page before
274
+ // Safari's click. Activation below owns focus; touch scrolling is native.
275
+ if (event.button === 0)
276
+ event.preventDefault();
277
+ }, onClick: (event) => {
278
+ // Safari does not give buttons mouse focus. The combobox must own keys
279
+ // before opening; focus first so a host click callback can still move it.
280
+ event.currentTarget.focus({ preventScroll: true });
281
+ if (onClick && !mirror(new MouseEvent("click", { bubbles: true, cancelable: true })))
282
+ return;
283
+ if (open)
284
+ setOpen(false);
285
+ else
286
+ openMenu();
287
+ }, onKeyUp: (event) => { if (onKeyUp)
277
288
  mirror(new KeyboardEvent("keyup", { key: event.key, bubbles: true, cancelable: true })); }, onKeyDown: (event) => {
278
289
  if (onKeyDown && !mirror(new KeyboardEvent("keydown", { key: event.key, code: event.code, bubbles: true, cancelable: true, ctrlKey: event.ctrlKey, shiftKey: event.shiftKey, altKey: event.altKey, metaKey: event.metaKey }))) {
279
290
  event.preventDefault();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flood-md/react",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "type": "module",
5
5
  "description": "Original Flood components for React and Next.js.",
6
6
  "license": "MIT",
@@ -30,7 +30,7 @@
30
30
  "react-dom": "^18.3.0 || ^19.0.0"
31
31
  },
32
32
  "dependencies": {
33
- "@flood-md/tokens": "0.2.8"
33
+ "@flood-md/tokens": "0.2.9"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"