@mcurcio/patchbay 0.3.0 → 0.5.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 +4 -4
- package/dist/composites.css +1 -1
- package/dist/composites.js +573 -53
- package/dist/composites.js.map +1 -1
- package/dist/graph.css +1 -0
- package/dist/graph.js +123 -0
- package/dist/graph.js.map +1 -0
- package/dist/hooks.js +433 -28
- package/dist/hooks.js.map +1 -1
- package/dist/primitives.css +1 -1
- package/dist/primitives.js +39 -20
- package/dist/primitives.js.map +1 -1
- package/dist/types/composites/command-palette/CommandPalette.d.ts +68 -0
- package/dist/types/composites/command-palette/index.d.ts +4 -0
- package/dist/types/composites/command-palette/rank.d.ts +39 -0
- package/dist/types/composites/index.d.ts +3 -0
- package/dist/types/composites/shortcut-sheet/ShortcutSheet.d.ts +41 -0
- package/dist/types/composites/shortcut-sheet/index.d.ts +2 -0
- package/dist/types/composites/toaster/Toaster.d.ts +38 -0
- package/dist/types/composites/toaster/index.d.ts +2 -0
- package/dist/types/graph/index.d.ts +1 -1
- package/dist/types/graph/meter/Meter.d.ts +56 -0
- package/dist/types/graph/meter/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts +4 -0
- package/dist/types/hooks/use-live-value/index.d.ts +2 -0
- package/dist/types/hooks/use-live-value/useLiveValue.d.ts +9 -0
- package/dist/types/hooks/use-media-breakpoint/index.d.ts +2 -0
- package/dist/types/hooks/use-media-breakpoint/useMediaBreakpoint.d.ts +25 -0
- package/dist/types/hooks/use-shortcuts/index.d.ts +2 -0
- package/dist/types/hooks/use-shortcuts/useShortcuts.d.ts +58 -0
- package/dist/types/hooks/use-toasts/index.d.ts +4 -0
- package/dist/types/hooks/use-toasts/toastQueue.d.ts +76 -0
- package/dist/types/hooks/use-toasts/useToasts.d.ts +31 -0
- package/dist/types/primitives/badge/Badge.d.ts +10 -3
- package/dist/types/primitives/badge/index.d.ts +1 -1
- package/dist/types/primitives/button/Button.d.ts +4 -1
- package/dist/types/primitives/pill/Pill.d.ts +1 -1
- package/package.json +1 -1
package/dist/primitives.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pb-badge{box-sizing:border-box;align-items:center;gap:var(--pb-space-2);border:1px solid var(--pb-line);border-radius:var(--pb-radius-pill);background:var(--pb-sunken);color:var(--pb-muted);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);white-space:nowrap;padding:0 6px;font-weight:600;line-height:18px;display:inline-flex}.pb-badge[data-tone=ok]{color:var(--pb-ok);border-color:currentColor}.pb-badge[data-tone=warn]{background:var(--pb-warn-soft);color:var(--pb-warn);border-color:currentColor}.pb-badge[data-tone=err]{background:var(--pb-err-soft);color:var(--pb-err);border-color:currentColor}.pb-badge[data-tone=quiet]{color:var(--pb-quiet);border-color:currentColor}.pb-badge[data-tone=off]{color:var(--pb-off)}.pb-spinner:not(.pb-spinner-labelled),.pb-spinner-ring{box-sizing:border-box;vertical-align:-.1em;border-radius:var(--pb-radius-pill);width:.8em;height:.8em;animation:pb-spin var(--pb-motion-spin) linear infinite;border:2px solid;border-right-color:#0000;display:inline-block}.pb-spinner-labelled{align-items:center;display:inline-flex}.pb-spinner-label{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@keyframes pb-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.pb-spinner:not(.pb-spinner-labelled),.pb-spinner-ring{animation:none}}.pb-button{justify-content:center;align-items:center;gap:var(--pb-space-2);box-sizing:border-box;min-height:28px;padding:0 var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast), border-color var(--pb-motion-fast), color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;margin:0;line-height:1.2;display:inline-flex;position:relative}.pb-button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-button:hover:not(:disabled,[aria-busy=true]){background:var(--pb-sunken)}.pb-button[aria-pressed=true]{color:var(--pb-accent);background:var(--pb-sunken)}.pb-button[data-tone=primary]{color:var(--pb-on-strong);background:var(--pb-accent);border-color:var(--pb-accent)}.pb-button[data-tone=primary]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-accent-hover)}.pb-button[data-tone=danger]{color:var(--pb-err)}.pb-button[data-tone=danger]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-err-soft);border-color:var(--pb-err)}.pb-button:disabled{color:var(--pb-muted);background:var(--pb-raised);border-color:var(--pb-line);cursor:default}.pb-button[aria-busy=true]{cursor:progress}.pb-button[data-size=sm]{min-height:var(--pb-row);padding:0 var(--pb-space-2);font-size:var(--pb-text-sm)}.pb-button-content{align-items:center;gap:var(--pb-space-2);display:inline-flex}.pb-button[aria-busy=true]>.pb-button-content{opacity:0}.pb-button>.pb-button-spinner{margin:auto;position:absolute;inset:0}@media (hover:none) and (pointer:coarse){.pb-button,.pb-button[data-size=sm]{min-height:36px}}@media (forced-colors:active){.pb-button{border-color:buttontext}.pb-button:disabled{color:graytext;border-color:graytext}}.pb-checkbox{width:16px;height:16px;accent-color:var(--pb-accent);cursor:pointer;flex:none;margin:0}.pb-checkbox:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-checkbox[aria-invalid=true]:not(:focus-visible){outline:1px solid var(--pb-err);outline-offset:1px}.pb-checkbox:disabled{cursor:default}.pb-checkbox-row{align-items:center;gap:var(--pb-space-3);min-height:28px;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);cursor:pointer;-webkit-tap-highlight-color:transparent;display:inline-flex}.pb-checkbox-row[data-disabled]{color:var(--pb-muted);cursor:default}@media (hover:none) and (pointer:coarse){.pb-checkbox{width:20px;height:20px}.pb-checkbox-row{min-height:36px;font-size:16px}}.pb-button.pb-icon-button{background:0 0;border-color:#0000;width:28px;min-width:28px;height:28px;padding:0}.pb-button.pb-icon-button[data-size=sm]{width:var(--pb-row);min-width:var(--pb-row);height:var(--pb-row)}.pb-button.pb-icon-button:hover:not(:disabled,[aria-busy=true]),.pb-button.pb-icon-button[aria-pressed=true]{background:var(--pb-sunken)}.pb-button.pb-icon-button[data-tone=primary]{background:var(--pb-accent);border-color:var(--pb-accent)}.pb-button.pb-icon-button[data-tone=primary]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-accent-hover)}.pb-button.pb-icon-button[data-tone=danger]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-err-soft);border-color:var(--pb-err)}.pb-button.pb-icon-button:disabled{background:0 0;border-color:#0000}.pb-icon-button-glyph{justify-content:center;align-items:center;font-size:1.15em;line-height:1;display:inline-flex}@media (hover:none) and (pointer:coarse){.pb-button.pb-icon-button,.pb-button.pb-icon-button[data-size=sm]{width:36px;min-width:36px;height:36px}}@media (forced-colors:active){.pb-button.pb-icon-button{border-color:#0000}.pb-button.pb-icon-button[aria-pressed=true]{border-color:highlight}}.pb-dialog-scrim{z-index:100;box-sizing:border-box;padding:max(10vh, env(safe-area-inset-top)) max(var(--pb-space-5), env(safe-area-inset-right)) max(var(--pb-space-5), env(safe-area-inset-bottom)) max(var(--pb-space-5), env(safe-area-inset-left));background:var(--pb-scrim);animation:pb-dialog-fade var(--pb-motion-fast) ease-out;justify-content:center;align-items:flex-start;display:flex;position:fixed;inset:0}.pb-dialog{box-sizing:border-box;width:min(520px,100%);max-height:100%;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line);border-radius:var(--pb-radius-box);box-shadow:var(--pb-shadow-lifted);animation:pb-dialog-rise var(--pb-motion-slow) ease-out;flex-direction:column;display:flex}.pb-dialog:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-dialog-head{align-items:center;gap:var(--pb-space-3);padding:var(--pb-space-4) var(--pb-space-4) var(--pb-space-3) var(--pb-space-5);display:flex}.pb-dialog-title{min-width:0;font-size:var(--pb-text-md);flex:auto;margin:0;font-weight:600}.pb-button.pb-dialog-close{color:var(--pb-muted);flex:none}.pb-button.pb-dialog-close:hover{color:var(--pb-text)}.pb-dialog-body{min-height:0;padding:0 var(--pb-space-5) var(--pb-space-5);flex:auto;overflow:auto}.pb-dialog-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}.pb-dialog-actions{justify-content:flex-end;gap:var(--pb-space-3);padding:var(--pb-space-4) var(--pb-space-5);border-top:1px solid var(--pb-line);flex-wrap:wrap;display:flex}@keyframes pb-dialog-fade{0%{opacity:0}}@keyframes pb-dialog-rise{0%{opacity:0;transform:translateY(var(--pb-space-3))}}@media (max-width:599px){.pb-dialog-scrim{padding-top:max(var(--pb-space-5), env(safe-area-inset-top));padding-right:max(var(--pb-space-4), env(safe-area-inset-right));padding-left:max(var(--pb-space-4), env(safe-area-inset-left))}}@media (prefers-reduced-motion:reduce){.pb-dialog-scrim,.pb-dialog{animation:none}}.pb-field{gap:var(--pb-space-2);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);grid-template-columns:minmax(0,1fr);display:grid}.pb-field[data-layout=inline]{column-gap:var(--pb-space-4);grid-template-columns:130px minmax(0,1fr);align-items:baseline}.pb-field-label{color:var(--pb-text)}.pb-field-control{gap:var(--pb-space-2);min-width:0;display:grid}.pb-field-hint{font-size:var(--pb-text-sm);color:var(--pb-muted)}.pb-field-error{font-size:var(--pb-text-sm);color:var(--pb-err)}.pb-key-value{box-sizing:border-box;gap:var(--pb-space-1) var(--pb-space-4);color:var(--pb-text);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);grid-template-columns:max-content minmax(0,1fr);margin:0;display:grid}.pb-key-value-row{display:contents}.pb-key-value dt{color:var(--pb-muted)}.pb-key-value dd{font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-width:0;margin:0}.pb-key-value-row[data-tone=ok] dd{color:var(--pb-ok)}.pb-key-value-row[data-tone=warn] dd{color:var(--pb-warn)}.pb-key-value-row[data-tone=err] dd{color:var(--pb-err)}.pb-key-value-row[data-tone=quiet] dd{color:var(--pb-quiet)}.pb-key-value-row[data-tone=off] dd{color:var(--pb-off)}.pb-panel{box-sizing:border-box;min-height:0;max-height:100%;color:var(--pb-text);background:var(--pb-raised);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);flex-direction:column;display:flex}.pb-panel-header{align-items:center;gap:var(--pb-space-3);box-sizing:border-box;min-height:var(--pb-bar);padding:var(--pb-space-3) var(--pb-space-4);border-bottom:1px solid var(--pb-line);flex:none;display:flex}.pb-panel-actions{align-items:center;gap:var(--pb-space-2);flex:none;margin-left:auto;display:flex}.pb-panel-title{min-width:0;font-size:var(--pb-text-md);overflow-wrap:anywhere;flex:auto;margin:0;font-weight:600;line-height:1.3}.pb-panel-body{box-sizing:border-box;min-height:0;padding:var(--pb-space-3) var(--pb-space-4);overscroll-behavior:contain;flex:auto;overflow-y:auto}.pb-panel-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}.pb-pill{box-sizing:border-box;align-items:center;gap:var(--pb-space-2);border-radius:var(--pb-radius-pill);background:var(--pb-sunken);color:var(--pb-muted);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);white-space:nowrap;padding:0 7px 0 5px;font-weight:600;line-height:18px;display:inline-flex}.pb-pill-dot{border-radius:var(--pb-radius-pill);background:currentColor;flex:none;width:7px;height:7px}.pb-pill[data-tone=ok]{color:var(--pb-ok)}.pb-pill[data-tone=warn]{color:var(--pb-warn)}.pb-pill[data-tone=err]{color:var(--pb-err)}.pb-pill[data-tone=quiet]{color:var(--pb-quiet)}.pb-pill[data-tone=off]{color:var(--pb-off)}.pb-pill-detail{font-family:var(--pb-font-code);font-weight:400}.pb-pill[data-pulse] .pb-pill-dot{animation:pb-pill-pulse var(--pb-motion-pulse) ease-in-out infinite}@keyframes pb-pill-pulse{50%{opacity:.4}}@media (prefers-reduced-motion:reduce){.pb-pill[data-pulse] .pb-pill-dot{animation:none}}.pb-radio-group{gap:var(--pb-space-2);min-width:0;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);border:0;margin:0;padding:0;display:grid}.pb-radio-group-legend{float:left;width:100%;margin-bottom:var(--pb-space-2);color:var(--pb-text);padding:0}.pb-radio-group-legend[data-hidden]{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;margin:0;position:absolute;overflow:hidden}.pb-radio-group-options{clear:both;flex-direction:column;align-items:flex-start;display:flex}.pb-radio-group[data-layout=inline] .pb-radio-group-options{column-gap:var(--pb-space-5);flex-flow:wrap}.pb-radio-row{align-items:center;gap:var(--pb-space-3);cursor:pointer;-webkit-tap-highlight-color:transparent;min-height:28px;display:inline-flex}.pb-radio-row[data-disabled]{color:var(--pb-muted);cursor:default}.pb-radio{width:16px;height:16px;accent-color:var(--pb-accent);cursor:pointer;flex:none;margin:0}.pb-radio:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-radio-group[aria-invalid=true] .pb-radio:not(:focus-visible){outline:1px solid var(--pb-err);outline-offset:1px}.pb-radio:disabled{cursor:default}.pb-radio-group-hint{font-size:var(--pb-text-sm);color:var(--pb-muted)}.pb-radio-group-error{font-size:var(--pb-text-sm);color:var(--pb-err)}@media (hover:none) and (pointer:coarse){.pb-radio{width:20px;height:20px}.pb-radio-row{min-height:36px;font-size:16px}}.pb-section-title{box-sizing:border-box;align-items:center;gap:var(--pb-space-3);margin:var(--pb-space-3) 0;color:var(--pb-text);font-family:var(--pb-font-ui);display:flex}.pb-section-title-text{min-width:0;font-size:var(--pb-text-md);overflow-wrap:anywhere;flex:auto;margin:0;font-weight:600}.pb-section-title-actions{align-items:center;gap:var(--pb-space-2);flex:none;display:flex}.pb-select{box-sizing:border-box;width:100%;min-height:28px;padding:var(--pb-space-2) var(--pb-space-2);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:border-color var(--pb-motion-fast);margin:0;line-height:1.2}.pb-select[data-font=code]{font-family:var(--pb-font-code)}.pb-select:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-select[aria-invalid=true]{border-color:var(--pb-err)}.pb-select:disabled{color:var(--pb-muted);background:var(--pb-sunken);border-color:var(--pb-line);cursor:default}@media (hover:none) and (pointer:coarse){.pb-select{min-height:36px;font-size:16px}}@media (forced-colors:active){.pb-select{border-color:fieldtext}.pb-select:disabled{border-color:graytext}}.pb-sheet{z-index:10;box-sizing:border-box;width:min(clamp(280px, var(--pb-sheet-width,360px), 560px), calc(100% - 48px));font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border-left:1px solid var(--pb-line);box-shadow:var(--pb-shadow-lifted);animation:pb-sheet-from-right var(--pb-motion-slow) ease-out;flex-direction:column;display:flex;position:absolute;top:0;bottom:0;right:0}.pb-sheet[data-side=bottom]{width:auto;max-height:62%;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid var(--pb-line);border-radius:var(--pb-radius-box) var(--pb-radius-box) 0 0;border-left:none;animation-name:pb-sheet-from-bottom;top:auto;left:0}.pb-sheet-head{align-items:center;gap:var(--pb-space-3);padding:var(--pb-space-3) var(--pb-space-3) var(--pb-space-2) var(--pb-space-4);flex:none;display:flex}.pb-sheet-title{min-width:0;font-size:var(--pb-text-md);flex:auto;margin:0;font-weight:600}.pb-button.pb-sheet-close{color:var(--pb-muted);flex:none}.pb-button.pb-sheet-close:hover{color:var(--pb-text)}.pb-sheet-body{min-height:0;padding:0 var(--pb-space-4) var(--pb-space-3);flex:auto;overflow-y:auto}.pb-sheet-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}@keyframes pb-sheet-from-right{0%{transform:translateX(var(--pb-space-5));opacity:0}}@keyframes pb-sheet-from-bottom{0%{transform:translateY(var(--pb-space-5));opacity:0}}@media (prefers-reduced-motion:reduce){.pb-sheet,.pb-sheet[data-side=bottom]{animation:none}}.pb-splitter{z-index:5;box-sizing:border-box;touch-action:none;transition:background-color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;background:0 0;position:absolute}.pb-splitter[data-orientation=vertical]{cursor:col-resize;width:6px;top:0;bottom:0}.pb-splitter[data-orientation=vertical][data-edge=start]{left:-3px}.pb-splitter[data-orientation=vertical][data-edge=end]{right:-3px}.pb-splitter[data-orientation=horizontal]{cursor:row-resize;height:6px;left:0;right:0}.pb-splitter[data-orientation=horizontal][data-edge=start]{top:-3px}.pb-splitter[data-orientation=horizontal][data-edge=end]{bottom:-3px}.pb-splitter:hover,.pb-splitter:focus-visible,.pb-splitter[data-dragging]{background:var(--pb-accent);outline:none}@media (hover:none) and (pointer:coarse){.pb-splitter:before{content:"";position:absolute}.pb-splitter[data-orientation=vertical]:before{inset:0 -15px}.pb-splitter[data-orientation=horizontal]:before{inset:-15px 0}}@media (forced-colors:active){.pb-splitter:hover,.pb-splitter:focus-visible,.pb-splitter[data-dragging]{background:highlight}}.pb-text-input{box-sizing:border-box;width:100%;min-height:28px;padding:var(--pb-space-2) var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);transition:border-color var(--pb-motion-fast);margin:0;line-height:1.2}.pb-text-input[data-font=code]{font-family:var(--pb-font-code)}.pb-text-input::placeholder{color:var(--pb-muted);opacity:1}.pb-text-input:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-text-input[aria-invalid=true]{border-color:var(--pb-err)}.pb-text-input:disabled,.pb-text-input:read-only{background:var(--pb-sunken)}.pb-text-input:disabled{color:var(--pb-muted);border-color:var(--pb-line);cursor:default}@media (hover:none) and (pointer:coarse){.pb-text-input{min-height:36px;font-size:16px}}@media (forced-colors:active){.pb-text-input{border-color:fieldtext}.pb-text-input:disabled{border-color:graytext}}.pb-theme-switch{align-items:center;gap:var(--pb-space-2);box-sizing:border-box;min-height:28px;padding:0 var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);white-space:nowrap;color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;margin:0;line-height:1.2;display:inline-flex}.pb-theme-switch:hover{background:var(--pb-sunken)}.pb-theme-switch:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-theme-switch-icon{flex:none}@media (max-width:599px){.pb-theme-switch{padding:0 var(--pb-space-2)}.pb-theme-switch-word{display:none}}@media (hover:none) and (pointer:coarse){.pb-theme-switch{justify-content:center;min-width:36px;min-height:36px}}.pb-toolbar{align-items:center;gap:var(--pb-space-2);box-sizing:border-box;flex-wrap:wrap;display:flex}.pb-toolbar[aria-orientation=vertical]{flex-flow:column;align-items:stretch}.pb-toolbar.pb-tool-group{gap:var(--pb-space-1);background:var(--pb-raised);border:1px solid var(--pb-line);border-radius:var(--pb-radius-box);box-shadow:var(--pb-shadow);flex-wrap:nowrap;padding:3px;display:inline-flex}.pb-tool-group button{box-sizing:border-box;width:28px;height:28px;font-family:var(--pb-font-ui);color:var(--pb-text);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast), color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;background:0 0;border:none;justify-content:center;align-items:center;margin:0;padding:0;font-size:15px;line-height:1;display:inline-flex}.pb-tool-group button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-tool-group button:hover:not(:disabled),.pb-tool-group button[aria-pressed=true]{background:var(--pb-sunken)}.pb-tool-group button[aria-pressed=true]{color:var(--pb-accent)}.pb-tool-group button:disabled{color:var(--pb-muted);cursor:default}@media (hover:none) and (pointer:coarse){.pb-tool-group button,.pb-tool-group .pb-button.pb-icon-button,.pb-tool-group .pb-button.pb-icon-button[data-size=sm]{width:40px;min-width:40px;height:40px}}@media (forced-colors:active){.pb-toolbar.pb-tool-group{border-color:canvastext}.pb-tool-group button[aria-pressed=true]{outline:1px solid highlight}}.pb-warn-mark{box-sizing:border-box;border-radius:var(--pb-radius-pill);background:var(--pb-warn);width:12px;height:12px;color:var(--pb-on-strong);font-family:var(--pb-font-ui);text-align:center;vertical-align:middle;flex:none;font-size:9px;font-weight:700;line-height:12px;display:inline-block}.pb-warn-mark-text{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}
|
|
1
|
+
.pb-badge{--_pb-badge-ink:var(--pb-muted);--_pb-badge-soft:var(--pb-sunken);box-sizing:border-box;align-items:center;gap:var(--pb-space-2);border-radius:var(--pb-radius-pill);background:var(--_pb-badge-soft);color:var(--_pb-badge-ink);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);white-space:nowrap;border:1px solid;padding:0 6px;font-weight:600;line-height:18px;display:inline-flex}.pb-badge:not([data-variant]){border-color:var(--pb-line)}.pb-badge[data-tone=ok],.pb-badge[data-tone=warn],.pb-badge[data-tone=err],.pb-badge[data-tone=quiet],.pb-badge[data-tone=accent],.pb-badge[data-tone=muted],.pb-badge[data-tone=added],.pb-badge[data-tone=removed],.pb-badge[data-tone=renamed],.pb-badge[data-tone=changed]{border-color:currentColor}.pb-badge[data-tone=ok]{--_pb-badge-ink:var(--pb-ok)}.pb-badge[data-tone=warn]{--_pb-badge-ink:var(--pb-warn);--_pb-badge-soft:var(--pb-warn-soft)}.pb-badge[data-tone=err]{--_pb-badge-ink:var(--pb-err);--_pb-badge-soft:var(--pb-err-soft)}.pb-badge[data-tone=quiet]{--_pb-badge-ink:var(--pb-quiet)}.pb-badge[data-tone=off]{--_pb-badge-ink:var(--pb-off)}.pb-badge[data-tone=accent]{--_pb-badge-ink:var(--pb-accent)}.pb-badge[data-tone=muted]{--_pb-badge-ink:var(--pb-muted)}.pb-badge[data-tone=added]{--_pb-badge-ink:var(--pb-added)}.pb-badge[data-tone=removed]{--_pb-badge-ink:var(--pb-removed)}.pb-badge[data-tone=renamed]{--_pb-badge-ink:var(--pb-renamed)}.pb-badge[data-tone=changed]{--_pb-badge-ink:var(--pb-warn);--_pb-badge-soft:var(--pb-warn-soft)}.pb-badge[data-variant=filled]{border-color:var(--_pb-badge-ink);background:var(--_pb-badge-ink);color:var(--pb-on-strong)}.pb-spinner:not(.pb-spinner-labelled),.pb-spinner-ring{box-sizing:border-box;vertical-align:-.1em;border-radius:var(--pb-radius-pill);width:.8em;height:.8em;animation:pb-spin var(--pb-motion-spin) linear infinite;border:2px solid;border-right-color:#0000;display:inline-block}.pb-spinner-labelled{align-items:center;display:inline-flex}.pb-spinner-label{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@keyframes pb-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.pb-spinner:not(.pb-spinner-labelled),.pb-spinner-ring{animation:none}}.pb-button{justify-content:center;align-items:center;gap:var(--pb-space-2);box-sizing:border-box;min-height:28px;padding:0 var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast), border-color var(--pb-motion-fast), color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;margin:0;line-height:1.2;display:inline-flex;position:relative}.pb-button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-button:hover:not(:disabled,[aria-busy=true]){background:var(--pb-sunken)}.pb-button[aria-pressed=true]{color:var(--pb-accent);background:var(--pb-sunken)}.pb-button[data-tone=primary]{color:var(--pb-on-strong);background:var(--pb-accent);border-color:var(--pb-accent)}.pb-button[data-tone=primary]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-accent-hover)}.pb-button[data-tone=danger]{color:var(--pb-err)}.pb-button[data-tone=danger]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-err-soft);border-color:var(--pb-err)}.pb-button:disabled{color:var(--pb-muted);background:var(--pb-raised);border-color:var(--pb-line);cursor:default}.pb-button[aria-busy=true]{cursor:progress}.pb-button[data-size=sm]{min-height:var(--pb-row);padding:0 var(--pb-space-2);font-size:var(--pb-text-sm)}.pb-button-content{align-items:center;gap:var(--pb-space-2);display:inline-flex}.pb-button[aria-busy=true]>.pb-button-content{opacity:0}.pb-button>.pb-button-spinner{margin:auto;position:absolute;inset:0}.pb-button-stack{display:inline-grid}.pb-button-stack>.pb-button-content{grid-area:1/1;justify-content:center}.pb-button-stack>[aria-hidden=true]{visibility:hidden}.pb-button-announce{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}@media (hover:none) and (pointer:coarse){.pb-button,.pb-button[data-size=sm]{min-height:36px}}@media (forced-colors:active){.pb-button{border-color:buttontext}.pb-button:disabled{color:graytext;border-color:graytext}}.pb-checkbox{width:16px;height:16px;accent-color:var(--pb-accent);cursor:pointer;flex:none;margin:0}.pb-checkbox:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-checkbox[aria-invalid=true]:not(:focus-visible){outline:1px solid var(--pb-err);outline-offset:1px}.pb-checkbox:disabled{cursor:default}.pb-checkbox-row{align-items:center;gap:var(--pb-space-3);min-height:28px;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);cursor:pointer;-webkit-tap-highlight-color:transparent;display:inline-flex}.pb-checkbox-row[data-disabled]{color:var(--pb-muted);cursor:default}@media (hover:none) and (pointer:coarse){.pb-checkbox{width:20px;height:20px}.pb-checkbox-row{min-height:36px;font-size:16px}}.pb-button.pb-icon-button{background:0 0;border-color:#0000;width:28px;min-width:28px;height:28px;padding:0}.pb-button.pb-icon-button[data-size=sm]{width:var(--pb-row);min-width:var(--pb-row);height:var(--pb-row)}.pb-button.pb-icon-button:hover:not(:disabled,[aria-busy=true]),.pb-button.pb-icon-button[aria-pressed=true]{background:var(--pb-sunken)}.pb-button.pb-icon-button[data-tone=primary]{background:var(--pb-accent);border-color:var(--pb-accent)}.pb-button.pb-icon-button[data-tone=primary]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-accent-hover)}.pb-button.pb-icon-button[data-tone=danger]:hover:not(:disabled,[aria-busy=true]){background:var(--pb-err-soft);border-color:var(--pb-err)}.pb-button.pb-icon-button:disabled{background:0 0;border-color:#0000}.pb-icon-button-glyph{justify-content:center;align-items:center;font-size:1.15em;line-height:1;display:inline-flex}@media (hover:none) and (pointer:coarse){.pb-button.pb-icon-button,.pb-button.pb-icon-button[data-size=sm]{width:36px;min-width:36px;height:36px}}@media (forced-colors:active){.pb-button.pb-icon-button{border-color:#0000}.pb-button.pb-icon-button[aria-pressed=true]{border-color:highlight}}.pb-dialog-scrim{z-index:100;box-sizing:border-box;padding:max(10vh, env(safe-area-inset-top)) max(var(--pb-space-5), env(safe-area-inset-right)) max(var(--pb-space-5), env(safe-area-inset-bottom)) max(var(--pb-space-5), env(safe-area-inset-left));background:var(--pb-scrim);animation:pb-dialog-fade var(--pb-motion-fast) ease-out;justify-content:center;align-items:flex-start;display:flex;position:fixed;inset:0}.pb-dialog{box-sizing:border-box;width:min(520px,100%);max-height:100%;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line);border-radius:var(--pb-radius-box);box-shadow:var(--pb-shadow-lifted);animation:pb-dialog-rise var(--pb-motion-slow) ease-out;flex-direction:column;display:flex}.pb-dialog:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-dialog-head{align-items:center;gap:var(--pb-space-3);padding:var(--pb-space-4) var(--pb-space-4) var(--pb-space-3) var(--pb-space-5);display:flex}.pb-dialog-title{min-width:0;font-size:var(--pb-text-md);flex:auto;margin:0;font-weight:600}.pb-button.pb-dialog-close{color:var(--pb-muted);flex:none}.pb-button.pb-dialog-close:hover{color:var(--pb-text)}.pb-dialog-body{min-height:0;padding:0 var(--pb-space-5) var(--pb-space-5);flex:auto;overflow:auto}.pb-dialog-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}.pb-dialog-actions{justify-content:flex-end;gap:var(--pb-space-3);padding:var(--pb-space-4) var(--pb-space-5);border-top:1px solid var(--pb-line);flex-wrap:wrap;display:flex}@keyframes pb-dialog-fade{0%{opacity:0}}@keyframes pb-dialog-rise{0%{opacity:0;transform:translateY(var(--pb-space-3))}}@media (max-width:599px){.pb-dialog-scrim{padding-top:max(var(--pb-space-5), env(safe-area-inset-top));padding-right:max(var(--pb-space-4), env(safe-area-inset-right));padding-left:max(var(--pb-space-4), env(safe-area-inset-left))}}@media (prefers-reduced-motion:reduce){.pb-dialog-scrim,.pb-dialog{animation:none}}.pb-field{gap:var(--pb-space-2);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);grid-template-columns:minmax(0,1fr);display:grid}.pb-field[data-layout=inline]{column-gap:var(--pb-space-4);grid-template-columns:130px minmax(0,1fr);align-items:baseline}.pb-field-label{color:var(--pb-text)}.pb-field-control{gap:var(--pb-space-2);min-width:0;display:grid}.pb-field-hint{font-size:var(--pb-text-sm);color:var(--pb-muted)}.pb-field-error{font-size:var(--pb-text-sm);color:var(--pb-err)}.pb-key-value{box-sizing:border-box;gap:var(--pb-space-1) var(--pb-space-4);color:var(--pb-text);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);grid-template-columns:max-content minmax(0,1fr);margin:0;display:grid}.pb-key-value-row{display:contents}.pb-key-value dt{color:var(--pb-muted)}.pb-key-value dd{font-variant-numeric:tabular-nums;overflow-wrap:anywhere;min-width:0;margin:0}.pb-key-value-row[data-tone=ok] dd{color:var(--pb-ok)}.pb-key-value-row[data-tone=warn] dd{color:var(--pb-warn)}.pb-key-value-row[data-tone=err] dd{color:var(--pb-err)}.pb-key-value-row[data-tone=quiet] dd{color:var(--pb-quiet)}.pb-key-value-row[data-tone=off] dd{color:var(--pb-off)}.pb-panel{box-sizing:border-box;min-height:0;max-height:100%;color:var(--pb-text);background:var(--pb-raised);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);flex-direction:column;display:flex}.pb-panel-header{align-items:center;gap:var(--pb-space-3);box-sizing:border-box;min-height:var(--pb-bar);padding:var(--pb-space-3) var(--pb-space-4);border-bottom:1px solid var(--pb-line);flex:none;display:flex}.pb-panel-actions{align-items:center;gap:var(--pb-space-2);flex:none;margin-left:auto;display:flex}.pb-panel-title{min-width:0;font-size:var(--pb-text-md);overflow-wrap:anywhere;flex:auto;margin:0;font-weight:600;line-height:1.3}.pb-panel-body{box-sizing:border-box;min-height:0;padding:var(--pb-space-3) var(--pb-space-4);overscroll-behavior:contain;flex:auto;overflow-y:auto}.pb-panel-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}.pb-pill{box-sizing:border-box;align-items:center;gap:var(--pb-space-2);border-radius:var(--pb-radius-pill);background:var(--pb-sunken);color:var(--pb-muted);font-family:var(--pb-font-ui);font-size:var(--pb-text-sm);white-space:nowrap;padding:0 7px 0 5px;font-weight:600;line-height:18px;display:inline-flex}.pb-pill-dot{border-radius:var(--pb-radius-pill);background:currentColor;flex:none;width:7px;height:7px}.pb-pill[data-tone=ok]{color:var(--pb-ok)}.pb-pill[data-tone=warn]{color:var(--pb-warn)}.pb-pill[data-tone=err]{color:var(--pb-err)}.pb-pill[data-tone=quiet]{color:var(--pb-quiet)}.pb-pill[data-tone=off]{color:var(--pb-off)}.pb-pill[data-tone=accent]{color:var(--pb-accent)}.pb-pill[data-tone=muted]{color:var(--pb-muted)}.pb-pill-detail{font-family:var(--pb-font-code);font-weight:400}.pb-pill[data-pulse] .pb-pill-dot{animation:pb-pill-pulse var(--pb-motion-pulse) ease-in-out infinite}@keyframes pb-pill-pulse{50%{opacity:.4}}@media (prefers-reduced-motion:reduce){.pb-pill[data-pulse] .pb-pill-dot{animation:none}}@media (forced-colors:active){.pb-pill-dot{forced-color-adjust:none;background:canvastext}}.pb-radio-group{gap:var(--pb-space-2);min-width:0;font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);border:0;margin:0;padding:0;display:grid}.pb-radio-group-legend{float:left;width:100%;margin-bottom:var(--pb-space-2);color:var(--pb-text);padding:0}.pb-radio-group-legend[data-hidden]{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;margin:0;position:absolute;overflow:hidden}.pb-radio-group-options{clear:both;flex-direction:column;align-items:flex-start;display:flex}.pb-radio-group[data-layout=inline] .pb-radio-group-options{column-gap:var(--pb-space-5);flex-flow:wrap}.pb-radio-row{align-items:center;gap:var(--pb-space-3);cursor:pointer;-webkit-tap-highlight-color:transparent;min-height:28px;display:inline-flex}.pb-radio-row[data-disabled]{color:var(--pb-muted);cursor:default}.pb-radio{width:16px;height:16px;accent-color:var(--pb-accent);cursor:pointer;flex:none;margin:0}.pb-radio:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-radio-group[aria-invalid=true] .pb-radio:not(:focus-visible){outline:1px solid var(--pb-err);outline-offset:1px}.pb-radio:disabled{cursor:default}.pb-radio-group-hint{font-size:var(--pb-text-sm);color:var(--pb-muted)}.pb-radio-group-error{font-size:var(--pb-text-sm);color:var(--pb-err)}@media (hover:none) and (pointer:coarse){.pb-radio{width:20px;height:20px}.pb-radio-row{min-height:36px;font-size:16px}}.pb-section-title{box-sizing:border-box;align-items:center;gap:var(--pb-space-3);margin:var(--pb-space-3) 0;color:var(--pb-text);font-family:var(--pb-font-ui);display:flex}.pb-section-title-text{min-width:0;font-size:var(--pb-text-md);overflow-wrap:anywhere;flex:auto;margin:0;font-weight:600}.pb-section-title-actions{align-items:center;gap:var(--pb-space-2);flex:none;display:flex}.pb-select{box-sizing:border-box;width:100%;min-height:28px;padding:var(--pb-space-2) var(--pb-space-2);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:border-color var(--pb-motion-fast);margin:0;line-height:1.2}.pb-select[data-font=code]{font-family:var(--pb-font-code)}.pb-select:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-select[aria-invalid=true]{border-color:var(--pb-err)}.pb-select:disabled{color:var(--pb-muted);background:var(--pb-sunken);border-color:var(--pb-line);cursor:default}@media (hover:none) and (pointer:coarse){.pb-select{min-height:36px;font-size:16px}}@media (forced-colors:active){.pb-select{border-color:fieldtext}.pb-select:disabled{border-color:graytext}}.pb-sheet{z-index:10;box-sizing:border-box;width:min(clamp(280px, var(--pb-sheet-width,360px), 560px), calc(100% - 48px));font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border-left:1px solid var(--pb-line);box-shadow:var(--pb-shadow-lifted);animation:pb-sheet-from-right var(--pb-motion-slow) ease-out;flex-direction:column;display:flex;position:absolute;top:0;bottom:0;right:0}.pb-sheet[data-side=bottom]{width:auto;max-height:62%;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid var(--pb-line);border-radius:var(--pb-radius-box) var(--pb-radius-box) 0 0;border-left:none;animation-name:pb-sheet-from-bottom;top:auto;left:0}.pb-sheet-head{align-items:center;gap:var(--pb-space-3);padding:var(--pb-space-3) var(--pb-space-3) var(--pb-space-2) var(--pb-space-4);flex:none;display:flex}.pb-sheet-title{min-width:0;font-size:var(--pb-text-md);flex:auto;margin:0;font-weight:600}.pb-button.pb-sheet-close{color:var(--pb-muted);flex:none}.pb-button.pb-sheet-close:hover{color:var(--pb-text)}.pb-sheet-body{min-height:0;padding:0 var(--pb-space-4) var(--pb-space-3);flex:auto;overflow-y:auto}.pb-sheet-body:focus-visible{outline:2px solid var(--pb-accent);outline-offset:-2px}@keyframes pb-sheet-from-right{0%{transform:translateX(var(--pb-space-5));opacity:0}}@keyframes pb-sheet-from-bottom{0%{transform:translateY(var(--pb-space-5));opacity:0}}@media (prefers-reduced-motion:reduce){.pb-sheet,.pb-sheet[data-side=bottom]{animation:none}}.pb-splitter{z-index:5;box-sizing:border-box;touch-action:none;transition:background-color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;background:0 0;position:absolute}.pb-splitter[data-orientation=vertical]{cursor:col-resize;width:6px;top:0;bottom:0}.pb-splitter[data-orientation=vertical][data-edge=start]{left:-3px}.pb-splitter[data-orientation=vertical][data-edge=end]{right:-3px}.pb-splitter[data-orientation=horizontal]{cursor:row-resize;height:6px;left:0;right:0}.pb-splitter[data-orientation=horizontal][data-edge=start]{top:-3px}.pb-splitter[data-orientation=horizontal][data-edge=end]{bottom:-3px}.pb-splitter:hover,.pb-splitter:focus-visible,.pb-splitter[data-dragging]{background:var(--pb-accent);outline:none}@media (hover:none) and (pointer:coarse){.pb-splitter:before{content:"";position:absolute}.pb-splitter[data-orientation=vertical]:before{inset:0 -15px}.pb-splitter[data-orientation=horizontal]:before{inset:-15px 0}}@media (forced-colors:active){.pb-splitter:hover,.pb-splitter:focus-visible,.pb-splitter[data-dragging]{background:highlight}}.pb-text-input{box-sizing:border-box;width:100%;min-height:28px;padding:var(--pb-space-2) var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);transition:border-color var(--pb-motion-fast);margin:0;line-height:1.2}.pb-text-input[data-font=code]{font-family:var(--pb-font-code)}.pb-text-input::placeholder{color:var(--pb-muted);opacity:1}.pb-text-input:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-text-input[aria-invalid=true]{border-color:var(--pb-err)}.pb-text-input:disabled,.pb-text-input:read-only{background:var(--pb-sunken)}.pb-text-input:disabled{color:var(--pb-muted);border-color:var(--pb-line);cursor:default}@media (hover:none) and (pointer:coarse){.pb-text-input{min-height:36px;font-size:16px}}@media (forced-colors:active){.pb-text-input{border-color:fieldtext}.pb-text-input:disabled{border-color:graytext}}.pb-theme-switch{align-items:center;gap:var(--pb-space-2);box-sizing:border-box;min-height:28px;padding:0 var(--pb-space-3);font-family:var(--pb-font-ui);font-size:var(--pb-text-md);white-space:nowrap;color:var(--pb-text);background:var(--pb-raised);border:1px solid var(--pb-line-strong);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;margin:0;line-height:1.2;display:inline-flex}.pb-theme-switch:hover{background:var(--pb-sunken)}.pb-theme-switch:focus-visible{outline:2px solid var(--pb-accent);outline-offset:2px}.pb-theme-switch-icon{flex:none}@media (max-width:599px){.pb-theme-switch{padding:0 var(--pb-space-2)}.pb-theme-switch-word{display:none}}@media (hover:none) and (pointer:coarse){.pb-theme-switch{justify-content:center;min-width:36px;min-height:36px}}.pb-toolbar{align-items:center;gap:var(--pb-space-2);box-sizing:border-box;flex-wrap:wrap;display:flex}.pb-toolbar[aria-orientation=vertical]{flex-flow:column;align-items:stretch}.pb-toolbar.pb-tool-group{gap:var(--pb-space-1);background:var(--pb-raised);border:1px solid var(--pb-line);border-radius:var(--pb-radius-box);box-shadow:var(--pb-shadow);flex-wrap:nowrap;padding:3px;display:inline-flex}.pb-tool-group button{box-sizing:border-box;width:28px;height:28px;font-family:var(--pb-font-ui);color:var(--pb-text);border-radius:var(--pb-radius-control);cursor:pointer;transition:background-color var(--pb-motion-fast), color var(--pb-motion-fast);-webkit-tap-highlight-color:transparent;background:0 0;border:none;justify-content:center;align-items:center;margin:0;padding:0;font-size:15px;line-height:1;display:inline-flex}.pb-tool-group button:focus-visible{outline:2px solid var(--pb-accent);outline-offset:1px}.pb-tool-group button:hover:not(:disabled),.pb-tool-group button[aria-pressed=true]{background:var(--pb-sunken)}.pb-tool-group button[aria-pressed=true]{color:var(--pb-accent)}.pb-tool-group button:disabled{color:var(--pb-muted);cursor:default}@media (hover:none) and (pointer:coarse){.pb-tool-group button,.pb-tool-group .pb-button.pb-icon-button,.pb-tool-group .pb-button.pb-icon-button[data-size=sm]{width:40px;min-width:40px;height:40px}}@media (forced-colors:active){.pb-toolbar.pb-tool-group{border-color:canvastext}.pb-tool-group button[aria-pressed=true]{outline:1px solid highlight}}.pb-warn-mark{box-sizing:border-box;border-radius:var(--pb-radius-pill);background:var(--pb-warn);width:12px;height:12px;color:var(--pb-on-strong);font-family:var(--pb-font-ui);text-align:center;vertical-align:middle;flex:none;font-size:9px;font-weight:700;line-height:12px;display:inline-block}@media (forced-colors:active){.pb-warn-mark{forced-color-adjust:none;color:canvas;background:canvastext}}.pb-warn-mark-text{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}
|
package/dist/primitives.js
CHANGED
|
@@ -2,12 +2,13 @@ import "./primitives.css";import { Fragment as e, jsx as t, jsxs as n } from "re
|
|
|
2
2
|
import { cloneElement as r, isValidElement as i, useCallback as a, useEffect as o, useId as s, useLayoutEffect as c, useRef as l } from "react";
|
|
3
3
|
import { createPortal as u } from "react-dom";
|
|
4
4
|
// src/primitives/badge/Badge.tsx
|
|
5
|
-
function d({ tone: e,
|
|
5
|
+
function d({ tone: e, variant: n = "outlined", children: r, title: i, className: a }) {
|
|
6
6
|
return /* @__PURE__ */ t("span", {
|
|
7
|
-
className:
|
|
7
|
+
className: a === void 0 ? "pb-badge" : `pb-badge ${a}`,
|
|
8
8
|
"data-tone": e,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
"data-variant": n === "filled" ? "filled" : void 0,
|
|
10
|
+
title: i,
|
|
11
|
+
children: r
|
|
11
12
|
});
|
|
12
13
|
}
|
|
13
14
|
// src/primitives/spinner/Spinner.tsx
|
|
@@ -31,24 +32,41 @@ function f({ label: e, className: r, ...i }) {
|
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
// src/primitives/button/Button.tsx
|
|
34
|
-
function p({ tone:
|
|
35
|
-
function
|
|
36
|
-
|
|
35
|
+
function p({ tone: r = "neutral", size: i = "md", busy: a = !1, busyLabel: o, type: s = "button", className: c, children: l, onClick: u, ...d }) {
|
|
36
|
+
function p(e) {
|
|
37
|
+
a ? e.preventDefault() : u?.(e);
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
-
...
|
|
40
|
-
type:
|
|
41
|
-
className:
|
|
42
|
-
"data-tone":
|
|
43
|
-
"data-size":
|
|
44
|
-
"aria-busy":
|
|
45
|
-
"aria-disabled":
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
let m = o !== void 0 && o !== "", h = d["aria-label"] !== void 0, g = /* @__PURE__ */ t("button", {
|
|
40
|
+
...d,
|
|
41
|
+
type: s,
|
|
42
|
+
className: c === void 0 ? "pb-button" : `pb-button ${c}`,
|
|
43
|
+
"data-tone": r,
|
|
44
|
+
"data-size": i,
|
|
45
|
+
"aria-busy": a || void 0,
|
|
46
|
+
"aria-disabled": a || d["aria-disabled"] || void 0,
|
|
47
|
+
"aria-label": a && m && h ? o : d["aria-label"],
|
|
48
|
+
onClick: p,
|
|
49
|
+
children: m && !h ? /* @__PURE__ */ n("span", {
|
|
50
|
+
className: "pb-button-stack",
|
|
51
|
+
children: [/* @__PURE__ */ t("span", {
|
|
52
|
+
className: "pb-button-content",
|
|
53
|
+
"aria-hidden": a || void 0,
|
|
54
|
+
children: l
|
|
55
|
+
}), /* @__PURE__ */ n("span", {
|
|
56
|
+
className: "pb-button-content pb-button-busy",
|
|
57
|
+
"aria-hidden": !a || void 0,
|
|
58
|
+
children: [/* @__PURE__ */ t(f, {}), o]
|
|
59
|
+
})]
|
|
60
|
+
}) : /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("span", {
|
|
48
61
|
className: "pb-button-content",
|
|
49
|
-
children:
|
|
50
|
-
}),
|
|
62
|
+
children: l
|
|
63
|
+
}), a && /* @__PURE__ */ t(f, { className: "pb-button-spinner" })] })
|
|
51
64
|
});
|
|
65
|
+
return m ? /* @__PURE__ */ n(e, { children: [g, /* @__PURE__ */ t("span", {
|
|
66
|
+
className: "pb-button-announce",
|
|
67
|
+
"aria-live": "polite",
|
|
68
|
+
children: a ? o : ""
|
|
69
|
+
})] }) : g;
|
|
52
70
|
}
|
|
53
71
|
// src/primitives/checkbox/Checkbox.tsx
|
|
54
72
|
function m(e, t) {
|
|
@@ -78,11 +96,12 @@ function h({ label: e, indeterminate: r = !1, className: i, ref: o, ...s }) {
|
|
|
78
96
|
}
|
|
79
97
|
// src/primitives/icon-button/IconButton.tsx
|
|
80
98
|
function g({ label: e, title: n, className: r, children: i, ...a }) {
|
|
99
|
+
let o = a.busy === !0 && a.busyLabel !== void 0 && a.busyLabel !== "" ? a.busyLabel : e;
|
|
81
100
|
return /* @__PURE__ */ t(p, {
|
|
82
101
|
...a,
|
|
83
102
|
className: r === void 0 ? "pb-icon-button" : `pb-icon-button ${r}`,
|
|
84
103
|
"aria-label": e,
|
|
85
|
-
title: n ??
|
|
104
|
+
title: n ?? o,
|
|
86
105
|
children: /* @__PURE__ */ t("span", {
|
|
87
106
|
className: "pb-icon-button-glyph",
|
|
88
107
|
"aria-hidden": "true",
|
package/dist/primitives.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitives.js","names":["present","_Fragment","Badge","className","tone","Spinner","rest","classes","label","Button","click","busy","event","onClick","size","assign","ref","value","Checkbox","own","useRef","setRef","useCallback","node","indeterminate","box","IconButton","title","CloseGlyph","focusable","tabbable","root","element","topmost","open","OpenDialog","boxRef","bodyRef","titleId","useId","onCloseRef","onClose","useEffect","before","body","keepFocus","controls","first","last","active","closeLabel","actions","Dialog","createPortal","present$1","Field","base","control","children","isValidElement","controlId","hintId","hint","errorId","error","describedBy","id","wired","cloneElement","layout","KeyValue","rows","row","index","overflows","useScrollFocus","settle","sizes","observeChildren","child","content","Panel","Heading","level","header","Pill","pulse","detail","present","RadioGroup","describedByOwn","invalidOwn","groupName","name","legendHidden","legend","options","option","SectionTitle","Select","font","OpenSheet","sheetRef","cameFrom","sheet","back","onFocus","from","onKeyDown","style","width","side","Sheet","clamp","max","bounds","dragged","start","sign","travel","growKey","orientation","edge","opposite","keyed","key","grow","step","Splitter","drag","along","down","onPointerDown","target","\"dragging\"","move","started","next","onChange","end","onPointerCancel","onPointerUp","min","TextInput","defaultThemeSwitchLabels","order","following","choice","themeSwitchTitle","labels","ThemeSwitch","words","itemSelector","items","toolbar","item","setTabStop","stop","current","all","moved","count","forth","rtl","editsText","Toolbar","watch","focus","ToolGroup","WarnMark","Fragment"],"sources":["../src/primitives/badge/Badge.tsx","../src/primitives/spinner/Spinner.tsx","../src/primitives/button/Button.tsx","../src/primitives/checkbox/Checkbox.tsx","../src/primitives/icon-button/IconButton.tsx","../src/primitives/dialog/CloseGlyph.tsx","../src/primitives/dialog/Dialog.tsx","../src/primitives/field/Field.tsx","../src/primitives/key-value/KeyValue.tsx","../src/primitives/panel/scroll-focus.ts","../src/primitives/panel/Panel.tsx","../src/primitives/pill/Pill.tsx","../src/primitives/radio-group/RadioGroup.tsx","../src/primitives/section-title/SectionTitle.tsx","../src/primitives/select/Select.tsx","../src/primitives/sheet/Sheet.tsx","../src/primitives/splitter/splitter-math.ts","../src/primitives/splitter/Splitter.tsx","../src/primitives/text-input/TextInput.tsx","../src/primitives/theme-switch/ThemeSwitch.tsx","../src/primitives/toolbar/roving.ts","../src/primitives/toolbar/Toolbar.tsx","../src/primitives/tool-group/ToolGroup.tsx","../src/primitives/warn-mark/WarnMark.tsx"],"sourcesContent":["// A badge: a short word or count in a rounded chip, tinted by its tone (a count of retries, a \"not ready\"). A tone it\n// does not know is drawn neutrally.\nimport type { ReactNode } from \"react\";\nimport \"./Badge.css\";\n\n/** The tones a badge draws; any other string is drawn neutrally. */\nexport type BadgeTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type BadgeProps = {\n /** The badge's tone: its text and border colour, and for warn and err a soft surface. */\n tone: BadgeTone;\n /** What the badge says: a word, a count, a WarnMark beside them. */\n children: ReactNode;\n /** Shown on hover: what the badge means. */\n title?: string;\n /** A class added to the badge. */\n className?: string;\n};\n\n/** Draws a short word or count in a chip of its tone. */\nexport function Badge({ tone, children, title, className }: BadgeProps) {\n return (\n <span className={className === undefined ? \"pb-badge\" : `pb-badge ${className}`} data-tone={tone} title={title}>\n {children}\n </span>\n );\n}\n","// The busy mark: an open ring in the current text colour that turns once per --pb-motion-spin, and under reduced\n// motion stands still (the open ring is still the mark). Without a label it is decoration, hidden from screen\n// readers, as inside a busy Button, whose own words and aria-busy say what is happening. With a label it is a status\n// that screen readers announce.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./Spinner.css\";\n\nexport type SpinnerProps = Omit<ComponentPropsWithRef<\"span\">, \"children\"> & {\n /** What is being waited for, read by screen readers; without it the spinner is hidden from them. */\n label?: string;\n};\n\nexport function Spinner({ label, className, ...rest }: SpinnerProps) {\n const classes = className === undefined ? \"pb-spinner\" : `pb-spinner ${className}`;\n if (label === undefined || label === \"\") {\n return <span {...rest} className={classes} aria-hidden=\"true\" />;\n }\n return (\n <span {...rest} className={`${classes} pb-spinner-labelled`} role=\"status\">\n <span className=\"pb-spinner-ring\" aria-hidden=\"true\" />\n <span className=\"pb-spinner-label\">{label}</span>\n </span>\n );\n}\n","// A push button in the library's look. Its tone (neutral, primary, danger, or any other word, drawn neutral) and size\n// are data attributes its stylesheet keys on. While busy it shows a Spinner over its words, which keep their place so\n// the button keeps its width, says aria-busy, and ignores presses (it stays focusable, unlike a disabled button, so\n// focus is not lost while a request is on its way).\nimport type { ComponentPropsWithRef, MouseEvent } from \"react\";\nimport { Spinner } from \"../spinner\";\nimport \"./Button.css\";\n\n/** What the button does, by colour: neutral (the default), primary (the one main action), danger; others draw neutral. */\nexport type ButtonTone = \"neutral\" | \"primary\" | \"danger\" | (string & {});\n\n/** md (the default) or sm, the compact one for dense rows; others draw as md. On touch both are at least 36 px tall. */\nexport type ButtonSize = \"md\" | \"sm\" | (string & {});\n\nexport type ButtonProps = ComponentPropsWithRef<\"button\"> & {\n tone?: ButtonTone;\n size?: ButtonSize;\n /** A request is on its way: a spinner over the words, aria-busy, and presses ignored. */\n busy?: boolean;\n};\n\nexport function Button({\n tone = \"neutral\",\n size = \"md\",\n busy = false,\n type = \"button\",\n className,\n children,\n onClick,\n ...rest\n}: ButtonProps) {\n function click(event: MouseEvent<HTMLButtonElement>) {\n if (busy) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n }\n return (\n <button\n {...rest}\n // A submit or reset button is asked for by name; a bare button inside a form never submits it.\n type={type}\n className={className === undefined ? \"pb-button\" : `pb-button ${className}`}\n data-tone={tone}\n data-size={size}\n aria-busy={busy || undefined}\n aria-disabled={busy || rest[\"aria-disabled\"] || undefined}\n onClick={click}\n >\n <span className=\"pb-button-content\">{children}</span>\n {busy && <Spinner className=\"pb-button-spinner\" />}\n </button>\n );\n}\n","// A tick box: a native checkbox (every native prop passes through, ref included, and id and aria props reach the\n// input, so Field can wire it), ticked in the accent. With a label it is wrapped in its own label, so a press on the\n// words ticks it too, and the row is a target a finger can find. Indeterminate (some of a group ticked) is a prop,\n// since HTML has it only as a DOM property.\nimport { useCallback, useLayoutEffect, useRef, type ComponentPropsWithRef, type ReactNode, type Ref } from \"react\";\nimport \"./Checkbox.css\";\n\nexport type CheckboxProps = Omit<ComponentPropsWithRef<\"input\">, \"type\"> & {\n /** The words beside the box, which tick it too; without them, name the box by a Field or aria-label. */\n label?: ReactNode;\n /** Neither ticked nor not: drawn as a dash and read as \"mixed\". */\n indeterminate?: boolean;\n};\n\nfunction assign<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n\nexport function Checkbox({ label, indeterminate = false, className, ref, ...rest }: CheckboxProps) {\n const own = useRef<HTMLInputElement | null>(null);\n const setRef = useCallback(\n (node: HTMLInputElement | null) => {\n own.current = node;\n assign(ref, node);\n },\n [ref],\n );\n useLayoutEffect(() => {\n if (own.current !== null) own.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const box = (\n <input\n {...rest}\n ref={setRef}\n type=\"checkbox\"\n className={label === undefined && className !== undefined ? `pb-checkbox ${className}` : \"pb-checkbox\"}\n />\n );\n if (label === undefined) return box;\n return (\n <label\n className={className === undefined ? \"pb-checkbox-row\" : `pb-checkbox-row ${className}`}\n data-disabled={rest.disabled === true || undefined}\n >\n {box}\n <span className=\"pb-checkbox-label\">{label}</span>\n </label>\n );\n}\n","// A square button that shows a glyph and is named by its label: the label is its accessible name and, unless a title\n// is given, its tooltip, and the glyph is hidden from screen readers. Tone, size and busy are Button's.\nimport type { ReactNode } from \"react\";\nimport { Button, type ButtonProps } from \"../button\";\nimport \"./IconButton.css\";\n\nexport type IconButtonProps = Omit<ButtonProps, \"children\" | \"aria-label\"> & {\n /** The button's name for screen readers, and its tooltip unless title says otherwise. */\n label: string;\n /** The glyph: an icon or a character, hidden from screen readers. */\n children: ReactNode;\n};\n\nexport function IconButton({ label, title, className, children, ...rest }: IconButtonProps) {\n return (\n <Button\n {...rest}\n className={className === undefined ? \"pb-icon-button\" : `pb-icon-button ${className}`}\n aria-label={label}\n title={title ?? label}\n >\n <span className=\"pb-icon-button-glyph\" aria-hidden=\"true\">\n {children}\n </span>\n </Button>\n );\n}\n","// The cross on Dialog's and Sheet's close buttons, in the current text colour. Internal: not exported by the layer.\nexport function CloseGlyph() {\n return (\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\">\n <path d=\"M3 3l10 10M13 3L3 13\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\" />\n </svg>\n );\n}\n","// A modal dialog: drawn over the page (in a portal on <body>) above a scrim, with a title, a close button, the app's\n// content and an optional row of actions. While it is open, Tab and Shift+Tab stay inside it and focus that wanders\n// out is brought back; Escape, the close button and a press on the scrim ask the app to close it (onClose), and the\n// app closes it by setting open to false. Opening focuses the content's first control (or one the content focused\n// itself, as with autoFocus), else the dialog; the body is a tab stop of its own, so a long one scrolls from the\n// keyboard; closing gives focus back to what had it before. Only the topmost of\n// several open dialogs keeps the focus.\nimport { type ReactNode, type KeyboardEvent, useEffect, useId, useRef } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { IconButton } from \"../icon-button\";\nimport { CloseGlyph } from \"./CloseGlyph\";\nimport \"./Dialog.css\";\n\nexport type DialogProps = {\n /** Whether the dialog is shown; the app holds it. */\n open: boolean;\n /** Asked for on Escape, the close button and a press on the scrim. */\n onClose: () => void;\n /** The dialog's title, which also names it for screen readers. */\n title: ReactNode;\n children: ReactNode;\n /** A row at the foot of the dialog, for its buttons. */\n actions?: ReactNode;\n /** The close button's name: \"Close\". */\n closeLabel?: string;\n /** A class added to the dialog's box. */\n className?: string;\n};\n\nconst focusable = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled]):not([type='hidden'])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"[tabindex]:not([tabindex='-1'])\",\n \"[contenteditable='true']\",\n].join(\",\");\n\n/** The controls inside `root` that Tab reaches, in order. */\nfunction tabbable(root: HTMLElement): HTMLElement[] {\n return [...root.querySelectorAll<HTMLElement>(focusable)].filter(\n (element) => element.closest(\"[hidden], [inert]\") === null && element.tabIndex >= 0,\n );\n}\n\n/** Whether `box` is the topmost open dialog: each opens in a portal appended to <body>, so the last one is on top. */\nfunction topmost(box: HTMLElement): boolean {\n const open = box.ownerDocument.querySelectorAll(\".pb-dialog\");\n return open[open.length - 1] === box;\n}\n\nfunction OpenDialog({ onClose, title, children, actions, closeLabel = \"Close\", className }: Omit<DialogProps, \"open\">) {\n const boxRef = useRef<HTMLDivElement>(null);\n const bodyRef = useRef<HTMLDivElement>(null);\n const titleId = useId();\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n useEffect(() => {\n const box = boxRef.current;\n if (box === null) return undefined;\n const before = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n if (!box.contains(document.activeElement)) {\n const body = bodyRef.current;\n (body === null ? undefined : tabbable(body)[0])?.focus();\n if (!box.contains(document.activeElement)) box.focus();\n }\n const keepFocus = (event: FocusEvent) => {\n if (!topmost(box)) return;\n if (event.target instanceof Node && box.contains(event.target)) return;\n (tabbable(box)[0] ?? box).focus();\n };\n document.addEventListener(\"focusin\", keepFocus);\n return () => {\n document.removeEventListener(\"focusin\", keepFocus);\n if (before?.isConnected === true) before.focus();\n };\n }, []);\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n onCloseRef.current();\n return;\n }\n if (event.key !== \"Tab\" || boxRef.current === null) return;\n const controls = tabbable(boxRef.current);\n const first = controls[0];\n const last = controls[controls.length - 1];\n if (first === undefined || last === undefined) {\n event.preventDefault();\n return;\n }\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === boxRef.current)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n return (\n <div\n className=\"pb-dialog-scrim\"\n onMouseDown={(event) => {\n // Only a press that starts on the scrim itself: a drag out of a text field does not close.\n if (event.target === event.currentTarget) onCloseRef.current();\n }}\n >\n <div\n ref={boxRef}\n className={className === undefined ? \"pb-dialog\" : `pb-dialog ${className}`}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n tabIndex={-1}\n onKeyDown={onKeyDown}\n >\n <div className=\"pb-dialog-head\">\n <h2 className=\"pb-dialog-title\" id={titleId}>\n {title}\n </h2>\n <IconButton\n className=\"pb-dialog-close\"\n label={closeLabel}\n onClick={() => {\n onCloseRef.current();\n }}\n >\n <CloseGlyph />\n </IconButton>\n </div>\n {/* Focusable, so a body that scrolls can be scrolled from the keyboard. */}\n <div ref={bodyRef} className=\"pb-dialog-body\" tabIndex={0}>\n {children}\n </div>\n {actions === undefined ? null : <div className=\"pb-dialog-actions\">{actions}</div>}\n </div>\n </div>\n );\n}\n\nexport function Dialog({ open, ...rest }: DialogProps) {\n if (!open) return null;\n return createPortal(<OpenDialog {...rest} />, document.body);\n}\n","// A labelled form control: the label, the control (its one child), a hint under it and an error under that. It wires\n// the control to them itself: the control gets an id the label points at (its own id if it has one), aria-describedby\n// naming the hint and the error (after any ids it already has), and aria-invalid while there is an error. The control\n// is any element that passes those props on to its native element, as TextInput, Select and Checkbox do.\nimport {\n cloneElement,\n isValidElement,\n useId,\n type AriaAttributes,\n type ComponentPropsWithRef,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport \"./Field.css\";\n\n/** stacked (the default: the label above the control) or inline (the label in a column to its left); others stack. */\nexport type FieldLayout = \"stacked\" | \"inline\" | (string & {});\n\n/** The props Field sets on its control. */\nexport type FieldControlProps = {\n id?: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: AriaAttributes[\"aria-invalid\"];\n};\n\nexport type FieldProps = Omit<ComponentPropsWithRef<\"div\">, \"children\"> & {\n /** What the control is, as its accessible name. */\n label: ReactNode;\n /** Why the value is refused; while there is one the control is marked invalid. Empty means none. */\n error?: ReactNode;\n /** A line of help under the control. */\n hint?: ReactNode;\n layout?: FieldLayout;\n /** The control: one element that passes id and aria props on to its native element. */\n children: ReactElement<FieldControlProps>;\n};\n\nfunction present(node: ReactNode): boolean {\n return node !== undefined && node !== null && node !== false && node !== \"\";\n}\n\nexport function Field({ label, error, hint, layout = \"stacked\", className, children, ...rest }: FieldProps) {\n const base = useId();\n const control: unknown = children;\n const own = isValidElement<FieldControlProps>(control) ? control.props : undefined;\n const controlId = own?.id ?? `${base}-control`;\n const hintId = present(hint) ? `${base}-hint` : undefined;\n const errorId = present(error) ? `${base}-error` : undefined;\n const describedBy = [own?.[\"aria-describedby\"], hintId, errorId].filter((id) => id !== undefined && id !== \"\");\n const wired =\n own === undefined\n ? children\n : cloneElement(children, {\n id: controlId,\n \"aria-describedby\": describedBy.length > 0 ? describedBy.join(\" \") : undefined,\n \"aria-invalid\": errorId !== undefined ? true : own[\"aria-invalid\"],\n });\n return (\n <div\n {...rest}\n className={className === undefined ? \"pb-field\" : `pb-field ${className}`}\n data-layout={layout}\n data-invalid={errorId !== undefined || undefined}\n >\n <label className=\"pb-field-label\" htmlFor={controlId}>\n {label}\n </label>\n <div className=\"pb-field-control\">\n {wired}\n {hintId !== undefined && (\n <div className=\"pb-field-hint\" id={hintId}>\n {hint}\n </div>\n )}\n {errorId !== undefined && (\n <div className=\"pb-field-error\" id={errorId}>\n {error}\n </div>\n )}\n </div>\n </div>\n );\n}\n","// Facts as a two-column list of keys and values (a status summary, an inspector's details), drawn as a <dl> so each key\n// names its value for screen readers. A row's tone colours its value; a tone it does not know leaves it plain.\nimport type { ReactNode } from \"react\";\nimport \"./KeyValue.css\";\n\n/** The tones a value draws in; any other string leaves it plain. */\nexport type KeyValueTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type KeyValueRow = {\n /** The fact's name. */\n key: string;\n /** Its value. */\n value: ReactNode;\n /** Colours the value: a fact that is wrong or worth a look. */\n tone?: KeyValueTone;\n /** Shown on hover over the key: what the fact means. */\n title?: string;\n};\n\nexport type KeyValueProps = {\n /** The facts, in order. */\n rows: readonly KeyValueRow[];\n /** Names the list for screen readers when no heading does. */\n label?: string;\n /** A class added to the list. */\n className?: string;\n};\n\n/** Draws facts as keys and their values, side by side. */\nexport function KeyValue({ rows, label, className }: KeyValueProps) {\n return (\n <dl className={className === undefined ? \"pb-key-value\" : `pb-key-value ${className}`} aria-label={label}>\n {rows.map((row, index) => (\n // Rows have no identity beyond their place; two may share a key.\n <div key={index} className=\"pb-key-value-row\" data-tone={row.tone}>\n <dt title={row.title}>{row.key}</dt>\n <dd>{row.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n","// Keeps a scrolling box reachable by keyboard: while its content overflows it is a tab stop (so the arrow keys and Page\n// Up and Down scroll it), and while everything fits it is not, so a short panel adds no empty stop to the tab order.\nimport { useEffect, type RefObject } from \"react\";\n\n/** Whether `box`'s content is taller or wider than the box. */\nexport function overflows(box: HTMLElement): boolean {\n return box.scrollHeight > box.clientHeight || box.scrollWidth > box.clientWidth;\n}\n\n/** Makes `ref`'s box focusable exactly while it overflows, watching its size and its content. */\nexport function useScrollFocus(ref: RefObject<HTMLElement | null>): void {\n useEffect(() => {\n const box = ref.current;\n if (box === null) return;\n const settle = () => {\n if (overflows(box)) box.tabIndex = 0;\n else box.removeAttribute(\"tabindex\");\n };\n settle();\n // jsdom has no ResizeObserver; the content watch still runs there.\n const sizes = typeof ResizeObserver === \"function\" ? new ResizeObserver(settle) : null;\n const observeChildren = () => {\n if (sizes === null) return;\n sizes.disconnect();\n sizes.observe(box);\n for (const child of box.children) sizes.observe(child);\n };\n observeChildren();\n const content = new MutationObserver(() => {\n observeChildren();\n settle();\n });\n content.observe(box, { childList: true, subtree: true, characterData: true });\n return () => {\n sizes?.disconnect();\n content.disconnect();\n };\n }, [ref]);\n}\n","// A panel: a region of the page with an optional header (its title, and actions at the far end) over a body that\n// scrolls on its own, as an inspector or a side panel. It draws no outer border: the layout that places it (a docked\n// side, a sheet, a card) draws its edges. Its title names the region for screen readers. While its body overflows, the\n// body is a tab stop, so the keyboard can scroll it.\nimport { useId, useRef, type ComponentPropsWithRef, type ReactNode } from \"react\";\nimport { useScrollFocus } from \"./scroll-focus\";\nimport \"./Panel.css\";\n\nexport type PanelProps = Omit<ComponentPropsWithRef<\"section\">, \"title\"> & {\n /** The panel's heading; it also names the region. Without one, name it with aria-label. */\n title?: ReactNode;\n /** Slot at the header's far end: buttons, a count, a close button. */\n actions?: ReactNode;\n /** The title's heading level, h1 to h6; h2 by default. */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n children?: ReactNode;\n};\n\n/** Draws a titled region with its actions and a body that scrolls. */\nexport function Panel({ title, actions, level = 2, className, children, ...rest }: PanelProps) {\n const titleId = useId();\n const body = useRef<HTMLDivElement>(null);\n useScrollFocus(body);\n const Heading = `h${String(level)}` as \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n const header = title !== undefined || actions !== undefined;\n return (\n <section\n {...rest}\n aria-labelledby={\n rest[\"aria-labelledby\"] ?? (title !== undefined && rest[\"aria-label\"] === undefined ? titleId : undefined)\n }\n className={className === undefined ? \"pb-panel\" : `pb-panel ${className}`}\n >\n {header && (\n <header className=\"pb-panel-header\">\n {title !== undefined && (\n <Heading id={titleId} className=\"pb-panel-title\">\n {title}\n </Heading>\n )}\n {actions !== undefined && <div className=\"pb-panel-actions\">{actions}</div>}\n </header>\n )}\n <div ref={body} className=\"pb-panel-body\">\n {children}\n </div>\n </section>\n );\n}\n","// A state pill: a dot in the state's tone and the word beside it, so the state never rests on colour alone. A tone it\n// does not know is drawn neutrally, by its own word.\nimport type { ReactNode } from \"react\";\nimport \"./Pill.css\";\n\n/** The tones a pill draws; any other string is drawn neutrally. */\nexport type PillTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type PillProps = {\n /** The state's tone: the dot's and the word's colour. */\n tone: PillTone;\n /** The state in words, always shown beside the dot. */\n label: string;\n /** Pulses the dot (never the word) while the state is on its way, such as \"starting\"; stops under reduced motion. */\n pulse?: boolean;\n /** Shown on hover: what the state means or why it is so. */\n title?: string;\n /** After the word, in code type: a failure's code, say. */\n detail?: ReactNode;\n /** A class added to the pill. */\n className?: string;\n};\n\n/** Draws a state as a dot and its word, in the state's tone. */\nexport function Pill({ tone, label, pulse = false, title, detail, className }: PillProps) {\n return (\n <span\n className={className === undefined ? \"pb-pill\" : `pb-pill ${className}`}\n data-tone={tone}\n data-pulse={pulse ? \"\" : undefined}\n title={title}\n >\n <span className=\"pb-pill-dot\" aria-hidden=\"true\" />\n {label}\n {detail !== undefined && <code className=\"pb-pill-detail\">{detail}</code>}\n </span>\n );\n}\n","// A choice of one: native radios under a legend, in one fieldset (role radiogroup), so the browser gives the arrow\n// keys and a single tab stop. Controlled: the app holds the value and every press asks it through onChange. Its hint\n// and error are wired as Field wires a control's: aria-describedby names them, and aria-invalid marks the group while\n// there is an error.\nimport { useId, type ComponentPropsWithRef, type ReactNode } from \"react\";\nimport \"./RadioGroup.css\";\n\n/** stacked (the default: one option a row) or inline (the options side by side, wrapping); others stack. */\nexport type RadioGroupLayout = \"stacked\" | \"inline\" | (string & {});\n\nexport type RadioOption = {\n /** The value onChange gives when this option is picked; unique in the group. */\n value: string;\n /** The option's words, which pick it too. */\n label: ReactNode;\n /** Shown on hover over the option. */\n title?: string;\n /** Not pickable. */\n disabled?: boolean;\n};\n\nexport type RadioGroupProps = Omit<ComponentPropsWithRef<\"fieldset\">, \"children\" | \"onChange\"> & {\n /** What the choice is: the group's legend and accessible name. */\n legend: ReactNode;\n /** Keeps the legend for screen readers only, when the layout around the group already says what it is. */\n legendHidden?: boolean;\n options: readonly RadioOption[];\n /** The picked option's value; one matching no option (or undefined) picks none. */\n value: string | undefined;\n /** Asks the app to pick this value. */\n onChange: (value: string) => void;\n /** The radios' shared name; one of its own by default. */\n name?: string;\n layout?: RadioGroupLayout;\n /** A line of help under the options. */\n hint?: ReactNode;\n /** Why the choice is refused; while there is one the group is marked invalid. Empty means none. */\n error?: ReactNode;\n};\n\nfunction present(node: ReactNode): boolean {\n return node !== undefined && node !== null && node !== false && node !== \"\";\n}\n\nexport function RadioGroup({\n legend,\n legendHidden = false,\n options,\n value,\n onChange,\n name,\n layout = \"stacked\",\n hint,\n error,\n className,\n \"aria-describedby\": describedByOwn,\n \"aria-invalid\": invalidOwn,\n ...rest\n}: RadioGroupProps) {\n const base = useId();\n const groupName = name ?? `${base}-name`;\n const hintId = present(hint) ? `${base}-hint` : undefined;\n const errorId = present(error) ? `${base}-error` : undefined;\n const describedBy = [describedByOwn, hintId, errorId].filter((id) => id !== undefined && id !== \"\");\n return (\n <fieldset\n {...rest}\n role=\"radiogroup\"\n className={className === undefined ? \"pb-radio-group\" : `pb-radio-group ${className}`}\n data-layout={layout}\n aria-describedby={describedBy.length > 0 ? describedBy.join(\" \") : undefined}\n aria-invalid={errorId !== undefined ? true : invalidOwn}\n >\n <legend className=\"pb-radio-group-legend\" data-hidden={legendHidden || undefined}>\n {legend}\n </legend>\n <div className=\"pb-radio-group-options\">\n {options.map((option) => (\n <label\n key={option.value}\n className=\"pb-radio-row\"\n title={option.title}\n data-disabled={option.disabled === true || rest.disabled === true || undefined}\n >\n <input\n className=\"pb-radio\"\n type=\"radio\"\n name={groupName}\n value={option.value}\n checked={option.value === value}\n disabled={option.disabled}\n onChange={() => {\n onChange(option.value);\n }}\n />\n <span className=\"pb-radio-label\">{option.label}</span>\n </label>\n ))}\n </div>\n {hintId !== undefined && (\n <div className=\"pb-radio-group-hint\" id={hintId}>\n {hint}\n </div>\n )}\n {errorId !== undefined && (\n <div className=\"pb-radio-group-error\" id={errorId}>\n {error}\n </div>\n )}\n </fieldset>\n );\n}\n","// A section's title in a panel or inspector, a heading with its actions (buttons, a count) at the far end. The\n// heading's level fits the page it sits in.\nimport type { ReactNode } from \"react\";\nimport \"./SectionTitle.css\";\n\nexport type SectionTitleProps = {\n /** The title. */\n children: ReactNode;\n /** Slot at the title's far end: buttons, a count, a badge. */\n actions?: ReactNode;\n /** The heading's level, h2 to h6. */\n level?: 2 | 3 | 4 | 5 | 6;\n /** A class added to the title's row. */\n className?: string;\n};\n\n/** Draws a section's heading, with its actions at the far end. */\nexport function SectionTitle({ children, actions, level = 3, className }: SectionTitleProps) {\n const Heading = `h${level}` as const;\n return (\n <div className={className === undefined ? \"pb-section-title\" : `pb-section-title ${className}`}>\n <Heading className=\"pb-section-title-text\">{children}</Heading>\n {actions !== undefined && <div className=\"pb-section-title-actions\">{actions}</div>}\n </div>\n );\n}\n","// A drop-down choice in the library's look: a native select (every native prop passes through, ref included; its\n// options are its children), so the platform's own list opens, the keyboard works as the platform's does, and a phone\n// shows its picker. It shows aria-invalid in the error tone, as Field sets it. On a touch screen its text is 16 px, as\n// iOS Safari zooms the page when a smaller field takes the focus.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./Select.css\";\n\n/** ui (the default) or code, the monospace face for values written as code; others draw as ui. */\nexport type SelectFont = \"ui\" | \"code\" | (string & {});\n\nexport type SelectProps = ComponentPropsWithRef<\"select\"> & {\n font?: SelectFont;\n};\n\nexport function Select({ font = \"ui\", className, children, ...rest }: SelectProps) {\n return (\n <select {...rest} className={className === undefined ? \"pb-select\" : `pb-select ${className}`} data-font={font}>\n {children}\n </select>\n );\n}\n","// A sheet: a panel drawn over its container's right edge or rising from its bottom, as an inspector is on a narrow\n// window or a phone. It is not modal: the page around it stays live, and opening it does not take the focus (a\n// selection on the canvas opens it while the person is still working there). Escape inside it and its close button\n// ask the app to close it; if the focus was inside when it closes, it goes back to where it came from. The sheet is\n// placed absolutely, so its container (the app's workspace) is positioned; the app holds open, and chooses the side\n// (the right edge below 760 px, the bottom below 600 px).\nimport {\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n type CSSProperties,\n useEffect,\n useId,\n useRef,\n} from \"react\";\nimport { CloseGlyph } from \"../dialog/CloseGlyph\";\nimport { IconButton } from \"../icon-button\";\nimport \"./Sheet.css\";\n\nexport type SheetSide = \"right\" | \"bottom\";\n\nexport type SheetProps = {\n /** Whether the sheet is shown; the app holds it. */\n open: boolean;\n /** Asked for on Escape inside the sheet and on its close button. */\n onClose: () => void;\n /** The edge it is drawn from: the right edge (the default) or the bottom. */\n side?: SheetSide;\n /** The sheet's title, which also names it for screen readers; without one, name it with `label`. */\n title?: ReactNode;\n /** The sheet's name for screen readers when it has no title. */\n label?: string;\n children: ReactNode;\n /** A right sheet's width in px, held to 280–560 px and to 48 px short of its container. */\n width?: number;\n /** The close button's name: \"Close\". */\n closeLabel?: string;\n /** A class added to the sheet. */\n className?: string;\n};\n\nfunction OpenSheet({\n onClose,\n side = \"right\",\n title,\n label,\n children,\n width,\n closeLabel = \"Close\",\n className,\n}: Omit<SheetProps, \"open\">) {\n const sheetRef = useRef<HTMLElement>(null);\n const titleId = useId();\n /** Where the focus came from when it entered the sheet: it goes back there if the sheet closes holding it. */\n const cameFrom = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n const sheet = sheetRef.current;\n return () => {\n const back = cameFrom.current;\n const active = document.activeElement;\n const held = active === null || active === document.body || (sheet?.contains(active) ?? false);\n if (held && back?.isConnected === true) back.focus();\n };\n }, []);\n\n const onFocus = (event: FocusEvent<HTMLElement>) => {\n const from = event.relatedTarget;\n if (from instanceof HTMLElement && !event.currentTarget.contains(from)) cameFrom.current = from;\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n if (event.defaultPrevented || event.key !== \"Escape\") return;\n event.preventDefault();\n event.stopPropagation();\n onClose();\n };\n\n const style = width === undefined ? undefined : ({ \"--pb-sheet-width\": `${width}px` } as CSSProperties);\n\n return (\n <section\n ref={sheetRef}\n className={className === undefined ? \"pb-sheet\" : `pb-sheet ${className}`}\n data-side={side}\n role=\"dialog\"\n aria-labelledby={title === undefined ? undefined : titleId}\n aria-label={title === undefined ? label : undefined}\n style={style}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n >\n <div className=\"pb-sheet-head\">\n {title === undefined ? (\n <span className=\"pb-sheet-title\" />\n ) : (\n <h2 className=\"pb-sheet-title\" id={titleId}>\n {title}\n </h2>\n )}\n <IconButton className=\"pb-sheet-close\" label={closeLabel} onClick={onClose}>\n <CloseGlyph />\n </IconButton>\n </div>\n {/* Focusable, so a body that scrolls can be scrolled from the keyboard. */}\n <div className=\"pb-sheet-body\" tabIndex={0}>\n {children}\n </div>\n </section>\n );\n}\n\nexport function Sheet({ open, ...rest }: SheetProps) {\n if (!open) return null;\n return <OpenSheet {...rest} />;\n}\n","// A splitter's maths, pure: a size kept within its bounds, a drag, and a key. Splitter.tsx draws and listens; this\n// file decides the size.\n\n/** The smallest and largest size, in px. */\nexport interface Bounds {\n min: number;\n max: number;\n}\n\n/** `value` within `bounds`, in whole px. A max below the min is read as the min. */\nexport function clamp(value: number, bounds: Bounds): number {\n const max = Math.max(bounds.min, bounds.max);\n return Math.round(Math.min(max, Math.max(bounds.min, value)));\n}\n\n/**\n * A drag: the size at the drag's start plus the pointer's travel times `sign`, clamped. The sign is -1 for a splitter on\n * the start edge (left or top) of what it resizes, where moving left or up grows it, and 1 on the end edge.\n */\nexport function dragged(start: number, travel: number, sign: 1 | -1, bounds: Bounds): number {\n return clamp(start + sign * travel, bounds);\n}\n\n/** Which arrow grows what the splitter resizes, from its orientation and the edge it sits on. */\nexport function growKey(orientation: \"vertical\" | \"horizontal\", edge: \"start\" | \"end\"): string {\n if (orientation === \"vertical\") return edge === \"start\" ? \"ArrowLeft\" : \"ArrowRight\";\n return edge === \"start\" ? \"ArrowUp\" : \"ArrowDown\";\n}\n\nconst opposite: Record<string, string> = {\n ArrowLeft: \"ArrowRight\",\n ArrowRight: \"ArrowLeft\",\n ArrowUp: \"ArrowDown\",\n ArrowDown: \"ArrowUp\",\n};\n\n/**\n * A key on a focused splitter: `grow` adds `step` and its opposite arrow takes it away, clamped; Home goes to the min\n * and End to the max; any other key gives undefined (the key is not the splitter's).\n */\nexport function keyed(value: number, key: string, grow: string, step: number, bounds: Bounds): number | undefined {\n if (key === grow) return clamp(value + step, bounds);\n if (key === opposite[grow]) return clamp(value - step, bounds);\n if (key === \"Home\") return clamp(bounds.min, bounds);\n if (key === \"End\") return clamp(bounds.max, bounds);\n return undefined;\n}\n","// A resize handle, as a WAI-ARIA separator: the edge of a pane, dragged with the pointer or moved by the arrow keys,\n// Home and End while focused. It keeps only the drag in progress; the size is the app's (value and onChange). It sits\n// absolutely on one edge of its positioned parent, the pane it resizes. splitter-math.ts holds the maths.\nimport { useRef, type ComponentPropsWithRef, type KeyboardEvent, type PointerEvent } from \"react\";\nimport { dragged, growKey, keyed } from \"./splitter-math\";\nimport \"./Splitter.css\";\n\n/** vertical: a vertical bar that resizes a width; horizontal: a horizontal bar that resizes a height. */\nexport type SplitterOrientation = \"vertical\" | \"horizontal\";\n\n/** The edge of the resized pane the splitter sits on: start is its left or top, end its right or bottom. */\nexport type SplitterEdge = \"start\" | \"end\";\n\nexport type SplitterProps = Omit<\n ComponentPropsWithRef<\"div\">,\n \"onChange\" | \"children\" | \"role\" | \"aria-orientation\" | \"aria-valuenow\" | \"aria-valuemin\" | \"aria-valuemax\"\n> & {\n orientation: SplitterOrientation;\n /** The pane's size in px. */\n value: number;\n /** The smallest size in px. */\n min: number;\n /** The largest size in px. */\n max: number;\n /** A new size, in whole px within min and max. */\n onChange: (px: number) => void;\n /** The separator's accessible name, such as \"Resize the inspector\". */\n label: string;\n /** Which edge of the pane it sits on; start (left or top) by default, where moving left or up grows the pane. */\n edge?: SplitterEdge;\n /** How far one arrow key moves it, in px; 16 by default. */\n step?: number;\n};\n\n/** Draws a pane's resize handle, dragged by pointer or moved by keys. */\nexport function Splitter({\n orientation,\n value,\n min,\n max,\n onChange,\n label,\n edge = \"start\",\n step = 16,\n className,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n onKeyDown,\n ...rest\n}: SplitterProps) {\n const drag = useRef<{ start: number; at: number } | null>(null);\n const bounds = { min, max };\n const along = (event: PointerEvent) => (orientation === \"vertical\" ? event.clientX : event.clientY);\n\n function down(event: PointerEvent<HTMLDivElement>) {\n onPointerDown?.(event);\n if (event.defaultPrevented || event.button !== 0) return;\n event.preventDefault();\n const target = event.currentTarget;\n // Captured, the drag follows the pointer past the bar's few px; jsdom has no capture.\n if (typeof target.setPointerCapture === \"function\") target.setPointerCapture(event.pointerId);\n target.focus();\n target.dataset[\"dragging\"] = \"\";\n drag.current = { start: value, at: along(event) };\n }\n function move(event: PointerEvent<HTMLDivElement>) {\n onPointerMove?.(event);\n const started = drag.current;\n if (started === null) return;\n const next = dragged(started.start, along(event) - started.at, edge === \"start\" ? -1 : 1, bounds);\n if (next !== value) onChange(next);\n }\n function end(event: PointerEvent<HTMLDivElement>) {\n if (event.type === \"pointercancel\") onPointerCancel?.(event);\n else onPointerUp?.(event);\n if (drag.current === null) return;\n drag.current = null;\n const target = event.currentTarget;\n delete target.dataset[\"dragging\"];\n if (typeof target.hasPointerCapture === \"function\" && target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n }\n function key(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return;\n const next = keyed(value, event.key, growKey(orientation, edge), step, bounds);\n if (next === undefined) return;\n event.preventDefault();\n if (next !== value) onChange(next);\n }\n\n return (\n <div\n {...rest}\n role=\"separator\"\n tabIndex={rest.tabIndex ?? 0}\n aria-orientation={orientation}\n aria-label={label}\n aria-valuenow={value}\n aria-valuemin={min}\n aria-valuemax={max}\n className={className === undefined ? \"pb-splitter\" : `pb-splitter ${className}`}\n data-orientation={orientation}\n data-edge={edge}\n onPointerDown={down}\n onPointerMove={move}\n onPointerUp={end}\n onPointerCancel={end}\n onKeyDown={key}\n />\n );\n}\n","// A one-line text field in the library's look: a native input (every native prop passes through, ref included), in\n// the UI face or the code face. It shows aria-invalid in the error tone, as Field sets it. On a touch screen its text is\n// 16 px, as iOS Safari zooms the page when a smaller field takes the focus.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./TextInput.css\";\n\n/** ui (the default) or code, the monospace face for values written as code; others draw as ui. */\nexport type TextInputFont = \"ui\" | \"code\" | (string & {});\n\nexport type TextInputProps = ComponentPropsWithRef<\"input\"> & {\n font?: TextInputFont;\n};\n\nexport function TextInput({ font = \"ui\", type = \"text\", className, ...rest }: TextInputProps) {\n return (\n <input\n {...rest}\n type={type}\n className={className === undefined ? \"pb-text-input\" : `pb-text-input ${className}`}\n data-font={font}\n />\n );\n}\n","// The theme switch: one button that cycles system, light and dark. Its word is shown beside the icon, and its\n// accessible name always says the choice, so it is never just a glyph; the icon is SVG, since a font may lack a ◐\n// character. The choice is the app's (useTheme keeps it); the switch only says it and asks for the next. At phone\n// width the word gives way to the icon alone, and the name still says the choice.\nimport type { ComponentPropsWithRef } from \"react\";\nimport type { ThemeChoice } from \"../../hooks/use-theme/useTheme\";\nimport \"./ThemeSwitch.css\";\n\nexport type { ThemeChoice };\n\n/** The switch's words, each replaceable. */\nexport interface ThemeSwitchLabels {\n /** What the switch is: \"Theme\". */\n theme: string;\n system: string;\n light: string;\n dark: string;\n /** Said of system in the tooltip: \"follows the system's setting\". */\n systemHint: string;\n /** Before the next choice in the tooltip: \"click for\". */\n clickFor: string;\n}\n\nexport const defaultThemeSwitchLabels: ThemeSwitchLabels = {\n theme: \"Theme\",\n system: \"system\",\n light: \"light\",\n dark: \"dark\",\n systemHint: \"follows the system's setting\",\n clickFor: \"click for\",\n};\n\nconst order: readonly ThemeChoice[] = [\"system\", \"light\", \"dark\"];\n\n/** The choice a press moves to: system, light, dark and back. */\nfunction following(choice: ThemeChoice): ThemeChoice {\n return order[(order.indexOf(choice) + 1) % order.length] ?? \"system\";\n}\n\nexport type ThemeSwitchProps = Omit<ComponentPropsWithRef<\"button\">, \"children\" | \"onClick\" | \"type\" | \"title\"> & {\n /** The theme now. */\n choice: ThemeChoice;\n /** Called with the next choice in the cycle when the switch is pressed. */\n onChoose: (next: ThemeChoice) => void;\n /** Words to replace; the rest keep their defaults. */\n labels?: Partial<ThemeSwitchLabels>;\n};\n\n/** The switch's tooltip: what the theme is and what a press does. */\nexport function themeSwitchTitle(choice: ThemeChoice, labels: ThemeSwitchLabels = defaultThemeSwitchLabels): string {\n const hint = choice === \"system\" ? ` (${labels.systemHint})` : \"\";\n return `${labels.theme}: ${labels[choice]}${hint}; ${labels.clickFor} ${labels[following(choice)]}`;\n}\n\nexport function ThemeSwitch({ choice, onChoose, labels, className, ...rest }: ThemeSwitchProps) {\n const words = { ...defaultThemeSwitchLabels, ...labels };\n return (\n <button\n {...rest}\n type=\"button\"\n className={className === undefined ? \"pb-theme-switch\" : `pb-theme-switch ${className}`}\n title={themeSwitchTitle(choice, words)}\n aria-label={`${words.theme}: ${words[choice]}`}\n onClick={() => {\n onChoose(following(choice));\n }}\n >\n <svg className=\"pb-theme-switch-icon\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\">\n <circle cx=\"8\" cy=\"8\" r=\"6.25\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M8 1.75a6.25 6.25 0 0 1 0 12.5z\" fill=\"currentColor\" />\n </svg>\n <span className=\"pb-theme-switch-word\">{words[choice]}</span>\n </button>\n );\n}\n","// Roving focus over a toolbar's items, pure DOM: which elements are items, which one holds the toolbar's one tab stop,\n// and where an arrow key, Home or End moves the focus. Toolbar.tsx wires it to React.\n\n/** What counts as an item: an enabled control, or anything that says it is a button, checkbox or radio. */\nexport const itemSelector = [\n \"button:not(:disabled)\",\n \"a[href]\",\n \"input:not(:disabled)\",\n \"select:not(:disabled)\",\n \"textarea:not(:disabled)\",\n '[role=\"button\"]',\n '[role=\"checkbox\"]',\n '[role=\"radio\"]',\n '[role=\"menuitem\"]',\n '[role=\"switch\"]',\n].join(\", \");\n\n/** The toolbar's items, in document order, leaving out those of a toolbar nested inside it. */\nexport function items(toolbar: HTMLElement): HTMLElement[] {\n return [...toolbar.querySelectorAll<HTMLElement>(itemSelector)].filter(\n (item) => item.closest('[role=\"toolbar\"]') === toolbar,\n );\n}\n\n/** Gives `current` the one tab stop (0) and every other item -1; with no current, the first item takes it. */\nexport function setTabStop(all: readonly HTMLElement[], current: HTMLElement | null): HTMLElement | null {\n const stop = current !== null && all.includes(current) ? current : (all[0] ?? null);\n for (const item of all) item.tabIndex = item === stop ? 0 : -1;\n return stop;\n}\n\n/**\n * The item a key moves the focus to from `index`, or undefined when the key is not the toolbar's. Horizontal toolbars\n * take the left and right arrows (swapped right to left), vertical ones up and down; both take Home and End. The ends\n * wrap around.\n */\nexport function moved(\n index: number,\n count: number,\n key: string,\n orientation: \"horizontal\" | \"vertical\",\n rtl: boolean,\n): number | undefined {\n if (count === 0) return undefined;\n if (key === \"Home\") return 0;\n if (key === \"End\") return count - 1;\n const [back, forth] =\n orientation === \"vertical\"\n ? [\"ArrowUp\", \"ArrowDown\"]\n : rtl\n ? [\"ArrowRight\", \"ArrowLeft\"]\n : [\"ArrowLeft\", \"ArrowRight\"];\n if (key === forth) return (index + 1) % count;\n if (key === back) return (index - 1 + count) % count;\n return undefined;\n}\n\n/** Whether a key pressed in `element` belongs to the text it edits (arrows, Home and End move its caret). */\nexport function editsText(element: Element): boolean {\n if (element instanceof HTMLTextAreaElement) return true;\n if (element instanceof HTMLInputElement) {\n return ![\"button\", \"checkbox\", \"radio\", \"reset\", \"submit\", \"image\", \"color\", \"file\", \"range\"].includes(\n element.type,\n );\n }\n return element instanceof HTMLElement && element.isContentEditable;\n}\n","// A WAI-ARIA toolbar: a row (or column) of controls that is one tab stop, the arrow keys, Home and End moving the focus\n// between its items (roving tabindex). The items are whatever controls its children render; the toolbar sets their\n// tabIndex itself, so an item's own tabIndex is overwritten. The item last focused keeps the tab stop, and a text field\n// inside keeps its own arrow keys. roving.ts holds the rules.\nimport { useEffect, useRef, type ComponentPropsWithRef, type FocusEvent, type KeyboardEvent } from \"react\";\nimport { editsText, items, moved, setTabStop } from \"./roving\";\nimport \"./Toolbar.css\";\n\nexport type ToolbarOrientation = \"horizontal\" | \"vertical\";\n\nexport type ToolbarProps = Omit<ComponentPropsWithRef<\"div\">, \"role\" | \"aria-orientation\"> & {\n /** The toolbar's accessible name, such as \"Canvas\". */\n label: string;\n /** horizontal (the default) moves with the left and right arrows; vertical with up and down. */\n orientation?: ToolbarOrientation;\n};\n\n/** Draws a group of controls as one tab stop, with the arrow keys moving between them. */\nexport function Toolbar({\n label,\n orientation = \"horizontal\",\n className,\n ref,\n onKeyDown,\n onFocus,\n children,\n ...rest\n}: ToolbarProps) {\n const own = useRef<HTMLDivElement | null>(null);\n const current = useRef<HTMLElement | null>(null);\n\n // After every render, and whenever an item comes, goes or is enabled or disabled, one item holds the tab stop.\n useEffect(() => {\n const toolbar = own.current;\n if (toolbar === null) return;\n const settle = () => {\n current.current = setTabStop(items(toolbar), current.current);\n };\n settle();\n const watch = new MutationObserver(settle);\n watch.observe(toolbar, { childList: true, subtree: true, attributes: true, attributeFilter: [\"disabled\", \"href\"] });\n return () => {\n watch.disconnect();\n };\n });\n\n function focus(event: FocusEvent<HTMLDivElement>) {\n onFocus?.(event);\n const toolbar = own.current;\n if (toolbar === null) return;\n const all = items(toolbar);\n if (event.target instanceof HTMLElement && all.includes(event.target)) {\n current.current = setTabStop(all, event.target);\n }\n }\n function key(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n const toolbar = own.current;\n if (event.defaultPrevented || toolbar === null || event.altKey || event.ctrlKey || event.metaKey) return;\n if (editsText(event.target as Element)) return;\n const all = items(toolbar);\n const index = all.indexOf(event.target as HTMLElement);\n if (index === -1) return;\n const rtl = getComputedStyle(toolbar).direction === \"rtl\";\n const next = moved(index, all.length, event.key, orientation, rtl);\n if (next === undefined) return;\n event.preventDefault();\n all[next]?.focus();\n }\n\n return (\n <div\n {...rest}\n ref={(element) => {\n own.current = element;\n if (typeof ref === \"function\") return ref(element);\n if (ref) ref.current = element;\n return undefined;\n }}\n role=\"toolbar\"\n aria-label={label}\n aria-orientation={orientation}\n className={className === undefined ? \"pb-toolbar\" : `pb-toolbar ${className}`}\n onKeyDown={key}\n onFocus={focus}\n >\n {children}\n </div>\n );\n}\n","// A floating group of tools, such as a canvas's zoom, fit and minimap: a Toolbar drawn as one raised, framed group of\n// square buttons. Its tools are IconButtons (or plain <button>s named by aria-label with their\n// glyph hidden); a pressed one (aria-pressed) is drawn in the accent. 28 px buttons, 40 px on touch.\nimport { Toolbar, type ToolbarProps } from \"../toolbar\";\nimport \"./ToolGroup.css\";\n\nexport type ToolGroupProps = ToolbarProps;\n\n/** Draws a framed group of square tool buttons, one tab stop with roving focus. */\nexport function ToolGroup({ className, ...rest }: ToolGroupProps) {\n return <Toolbar {...rest} className={className === undefined ? \"pb-tool-group\" : `pb-tool-group ${className}`} />;\n}\n","// The warning mark: an \"!\" in a circle beside words, for something that rose lately (a badge's or a counter's). The\n// glyph is hidden from screen readers, which read its label instead.\nimport \"./WarnMark.css\";\n\nexport type WarnMarkProps = {\n /** What the mark means, read by screen readers in its place. */\n label: string;\n /** Shown on hover over the mark. */\n title?: string;\n /** A class added to the mark. */\n className?: string;\n};\n\n/** Draws a warning \"!\" for the eye and its words for screen readers. */\nexport function WarnMark({ label, title, className }: WarnMarkProps) {\n return (\n <>\n <span\n className={className === undefined ? \"pb-warn-mark\" : `pb-warn-mark ${className}`}\n aria-hidden=\"true\"\n title={title}\n >\n !\n </span>\n <span className=\"pb-warn-mark-text\">{label}</span>\n </>\n );\n}\n"],"mappings":";;;;AAoBA,SAAgBE,EAAM,EAAE,SAAM,aAAU,UAAO,gBAAyB;CACtE,OACE,kBAAC,QAAD;EAAM,WAAWC,MAAc,KAAA,IAAY,aAAa,YAAYA;EAAa,aAAWC;EAAa;EACtG;CACG,CAAA;AAEV;;ACdA,SAAgBC,EAAQ,EAAE,UAAO,cAAW,GAAGC,KAAsB;CACnE,IAAMC,IAAUJ,MAAc,KAAA,IAAY,eAAe,cAAcA;CAIvE,OAHIK,MAAU,KAAA,KAAaA,MAAU,KAC5B,kBAAC,QAAD;EAAM,GAAIF;EAAM,WAAWC;EAAS,eAAY;CAAQ,CAAA,IAG/D,kBAAC,QAAD;EAAM,GAAID;EAAM,WAAW,GAAGC,EAAQ;EAAuB,MAAK;EAAlE,UAAA,CACE,kBAAC,QAAD;GAAM,WAAU;GAAkB,eAAY;EAAQ,CAAA,GACtD,kBAAC,QAAD;GAAM,WAAU;GAAoB,UAAAC;EAAY,CAAA,CAC5C;;AAEV;;ACFA,SAAgBC,EAAO,EACrB,UAAO,WACP,UAAO,MACP,UAAO,IACP,UAAO,UACP,cACA,aACA,YACA,GAAGH,KACW;CACd,SAASI,EAAM,GAAsC;EACnD,AAAIC,IACFC,EAAM,eAAe,IAGvBC,IAAUD,CAAK;CACjB;CACA,OACE,kBAAC,UAAD;EACE,GAAIN;EAEE;EACN,WAAWH,MAAc,KAAA,IAAY,cAAc,aAAaA;EAChE,aAAWC;EACX,aAAWU;EACX,aAAWH,KAAQ,KAAA;EACnB,iBAAeA,KAAQL,EAAK,oBAAoB,KAAA;E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AM,eAAe,GACrBmJ,EAAItB,EAAK,EAAE,MAAM;CACnB;CAEA,OACE,kBAAC,OAAD;EACE,GAAInI;EACJ,MAAM,MAAY;GAEhB,IADA,EAAI,UAAU0B,GACV,OAAOhB,KAAQ,YAAY,OAAOA,EAAIgB,CAAO;GACjD,AAAIhB,MAAK,EAAI,UAAUgB;EAEzB;EACA,MAAK;EACL,cAAYxB;EACZ,oBAAkBiH;EAClB,WAAWtH,MAAc,KAAA,IAAY,eAAe,cAAcA;EAClE,WAAW0H;EACX,SAAS0C;EAER;CACE,CAAA;AAET;;AChFA,SAAgBC,GAAU,EAAE,cAAW,GAAGlK,KAAwB;CAChE,OAAO,kBAAC+J,GAAD;EAAS,GAAI/J;EAAM,WAAWH,MAAc,KAAA,IAAY,kBAAkB,iBAAiBA;CAAc,CAAA;AAClH;;ACGA,SAAgBsK,GAAS,EAAE,UAAO,UAAO,gBAA4B;CACnE,OACE,kBAAAxK,GAAA,EAAA,UAAA,CACE,kBAAC,QAAD;EACE,WAAWE,MAAc,KAAA,IAAY,iBAAiB,gBAAgBA;EACtE,eAAY;EACL;EACR,UAAA;CAEK,CAAA,GACN,kBAAC,QAAD;EAAM,WAAU;EAAqB,UAAAK;CAAY,CAAA,CACjD,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"primitives.js","names":["_Fragment","present","_Fragment","Badge","className","tone","variant","Spinner","rest","classes","label","Button","click","busy","event","onClick","swaps","busyLabel","named","button","size","Fragment","assign","ref","value","Checkbox","own","useRef","setRef","useCallback","node","indeterminate","box","IconButton","name","title","CloseGlyph","focusable","tabbable","root","element","topmost","open","OpenDialog","boxRef","bodyRef","titleId","useId","onCloseRef","onClose","useEffect","before","body","keepFocus","controls","first","last","active","closeLabel","actions","Dialog","createPortal","present$1","Field","base","control","children","isValidElement","controlId","hintId","hint","errorId","error","describedBy","id","wired","cloneElement","layout","KeyValue","rows","row","index","overflows","useScrollFocus","settle","sizes","observeChildren","child","content","Panel","Heading","level","header","Pill","pulse","detail","present","RadioGroup","describedByOwn","invalidOwn","groupName","legendHidden","legend","options","option","SectionTitle","Select","font","OpenSheet","sheetRef","cameFrom","sheet","back","onFocus","from","onKeyDown","style","width","side","Sheet","clamp","max","bounds","dragged","start","sign","travel","growKey","orientation","edge","opposite","keyed","key","grow","step","Splitter","drag","along","down","onPointerDown","target","\"dragging\"","move","started","next","onChange","end","onPointerCancel","onPointerUp","min","TextInput","defaultThemeSwitchLabels","order","following","choice","themeSwitchTitle","labels","ThemeSwitch","words","itemSelector","items","toolbar","item","setTabStop","stop","current","all","moved","count","forth","rtl","editsText","Toolbar","watch","focus","ToolGroup","WarnMark"],"sources":["../src/primitives/badge/Badge.tsx","../src/primitives/spinner/Spinner.tsx","../src/primitives/button/Button.tsx","../src/primitives/checkbox/Checkbox.tsx","../src/primitives/icon-button/IconButton.tsx","../src/primitives/dialog/CloseGlyph.tsx","../src/primitives/dialog/Dialog.tsx","../src/primitives/field/Field.tsx","../src/primitives/key-value/KeyValue.tsx","../src/primitives/panel/scroll-focus.ts","../src/primitives/panel/Panel.tsx","../src/primitives/pill/Pill.tsx","../src/primitives/radio-group/RadioGroup.tsx","../src/primitives/section-title/SectionTitle.tsx","../src/primitives/select/Select.tsx","../src/primitives/sheet/Sheet.tsx","../src/primitives/splitter/splitter-math.ts","../src/primitives/splitter/Splitter.tsx","../src/primitives/text-input/TextInput.tsx","../src/primitives/theme-switch/ThemeSwitch.tsx","../src/primitives/toolbar/roving.ts","../src/primitives/toolbar/Toolbar.tsx","../src/primitives/tool-group/ToolGroup.tsx","../src/primitives/warn-mark/WarnMark.tsx"],"sourcesContent":["// A badge: a short word or count in a rounded chip, tinted by its tone (a count of retries, a \"not ready\", a change\n// not yet applied), outlined or filled. A tone it does not know is drawn neutrally.\nimport type { ReactNode } from \"react\";\nimport \"./Badge.css\";\n\n/** The tones a badge draws; any other string is drawn neutrally. */\nexport type BadgeTone =\n | \"ok\"\n | \"warn\"\n | \"err\"\n | \"quiet\"\n | \"off\"\n | \"accent\"\n | \"muted\"\n | \"added\"\n | \"removed\"\n | \"renamed\"\n | \"changed\"\n | (string & {});\n\n/** How a badge is drawn: outlined in its tone (the default), or filled with it. */\nexport type BadgeVariant = \"outlined\" | \"filled\";\n\nexport type BadgeProps = {\n /** The badge's tone: its text and border colour (outlined) or its fill (filled). */\n tone: BadgeTone;\n /**\n * Outlined (the default): text and border in the tone. Filled: the tone's fill under on-strong text, for a fact that\n * must stand out.\n */\n variant?: BadgeVariant;\n /** What the badge says: a word, a count, a WarnMark beside them. */\n children: ReactNode;\n /** Shown on hover: what the badge means. */\n title?: string;\n /** A class added to the badge. */\n className?: string;\n};\n\n/** Draws a short word or count in a chip of its tone. */\nexport function Badge({ tone, variant = \"outlined\", children, title, className }: BadgeProps) {\n return (\n <span\n className={className === undefined ? \"pb-badge\" : `pb-badge ${className}`}\n data-tone={tone}\n data-variant={variant === \"filled\" ? \"filled\" : undefined}\n title={title}\n >\n {children}\n </span>\n );\n}\n","// The busy mark: an open ring in the current text colour that turns once per --pb-motion-spin, and under reduced\n// motion stands still (the open ring is still the mark). Without a label it is decoration, hidden from screen\n// readers, as inside a busy Button, whose own words and aria-busy say what is happening. With a label it is a status\n// that screen readers announce.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./Spinner.css\";\n\nexport type SpinnerProps = Omit<ComponentPropsWithRef<\"span\">, \"children\"> & {\n /** What is being waited for, read by screen readers; without it the spinner is hidden from them. */\n label?: string;\n};\n\nexport function Spinner({ label, className, ...rest }: SpinnerProps) {\n const classes = className === undefined ? \"pb-spinner\" : `pb-spinner ${className}`;\n if (label === undefined || label === \"\") {\n return <span {...rest} className={classes} aria-hidden=\"true\" />;\n }\n return (\n <span {...rest} className={`${classes} pb-spinner-labelled`} role=\"status\">\n <span className=\"pb-spinner-ring\" aria-hidden=\"true\" />\n <span className=\"pb-spinner-label\">{label}</span>\n </span>\n );\n}\n","// A push button in the library's look. Its tone (neutral, primary, danger, or any other word, drawn neutral) and size\n// are data attributes its stylesheet keys on. While busy it shows a Spinner over its words, which keep their place so\n// the button keeps its width, says aria-busy, and ignores presses (it stays focusable, unlike a disabled button, so\n// focus is not lost while a request is on its way). With a busyLabel it shows those words beside the spinner instead,\n// both labels stacked in one grid cell so the width is the wider of the two, and says the change in a polite live\n// region beside it; a button named by aria-label (a glyph button) has no words to show, so busyLabel names it instead.\nimport type { ComponentPropsWithRef, MouseEvent } from \"react\";\nimport { Spinner } from \"../spinner\";\nimport \"./Button.css\";\n\n/** What the button does, by colour: neutral (the default), primary (the one main action), danger; others draw neutral. */\nexport type ButtonTone = \"neutral\" | \"primary\" | \"danger\" | (string & {});\n\n/** md (the default) or sm, the compact one for dense rows; others draw as md. On touch both are at least 36 px tall. */\nexport type ButtonSize = \"md\" | \"sm\" | (string & {});\n\nexport type ButtonProps = ComponentPropsWithRef<\"button\"> & {\n tone?: ButtonTone;\n size?: ButtonSize;\n /** A request is on its way: a spinner over the words, aria-busy, and presses ignored. */\n busy?: boolean;\n /** The words shown while busy (\"Saving\"), beside the spinner; the width holds at the wider label, and the change is\n * announced politely. On a button named by aria-label it replaces that name while busy. */\n busyLabel?: string;\n};\n\nexport function Button({\n tone = \"neutral\",\n size = \"md\",\n busy = false,\n busyLabel,\n type = \"button\",\n className,\n children,\n onClick,\n ...rest\n}: ButtonProps) {\n function click(event: MouseEvent<HTMLButtonElement>) {\n if (busy) {\n event.preventDefault();\n return;\n }\n onClick?.(event);\n }\n const swaps = busyLabel !== undefined && busyLabel !== \"\";\n const named = rest[\"aria-label\"] !== undefined;\n const button = (\n <button\n {...rest}\n // A submit or reset button is asked for by name; a bare button inside a form never submits it.\n type={type}\n className={className === undefined ? \"pb-button\" : `pb-button ${className}`}\n data-tone={tone}\n data-size={size}\n aria-busy={busy || undefined}\n aria-disabled={busy || rest[\"aria-disabled\"] || undefined}\n aria-label={busy && swaps && named ? busyLabel : rest[\"aria-label\"]}\n onClick={click}\n >\n {swaps && !named ? (\n // Both labels hold one grid cell, so the button is as wide as the wider; the one not shown is hidden from\n // sight and from the accessible name.\n <span className=\"pb-button-stack\">\n <span className=\"pb-button-content\" aria-hidden={busy || undefined}>\n {children}\n </span>\n <span className=\"pb-button-content pb-button-busy\" aria-hidden={!busy || undefined}>\n <Spinner />\n {busyLabel}\n </span>\n </span>\n ) : (\n <>\n <span className=\"pb-button-content\">{children}</span>\n {busy && <Spinner className=\"pb-button-spinner\" />}\n </>\n )}\n </button>\n );\n if (!swaps) return button;\n // The live region is there from the start, so a change of its words is announced; it says the busy words when the\n // button turns busy and empties when it is done (the focused button's own name says the rest).\n return (\n <>\n {button}\n <span className=\"pb-button-announce\" aria-live=\"polite\">\n {busy ? busyLabel : \"\"}\n </span>\n </>\n );\n}\n","// A tick box: a native checkbox (every native prop passes through, ref included, and id and aria props reach the\n// input, so Field can wire it), ticked in the accent. With a label it is wrapped in its own label, so a press on the\n// words ticks it too, and the row is a target a finger can find. Indeterminate (some of a group ticked) is a prop,\n// since HTML has it only as a DOM property.\nimport { useCallback, useLayoutEffect, useRef, type ComponentPropsWithRef, type ReactNode, type Ref } from \"react\";\nimport \"./Checkbox.css\";\n\nexport type CheckboxProps = Omit<ComponentPropsWithRef<\"input\">, \"type\"> & {\n /** The words beside the box, which tick it too; without them, name the box by a Field or aria-label. */\n label?: ReactNode;\n /** Neither ticked nor not: drawn as a dash and read as \"mixed\". */\n indeterminate?: boolean;\n};\n\nfunction assign<T>(ref: Ref<T> | undefined, value: T | null) {\n if (typeof ref === \"function\") ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n\nexport function Checkbox({ label, indeterminate = false, className, ref, ...rest }: CheckboxProps) {\n const own = useRef<HTMLInputElement | null>(null);\n const setRef = useCallback(\n (node: HTMLInputElement | null) => {\n own.current = node;\n assign(ref, node);\n },\n [ref],\n );\n useLayoutEffect(() => {\n if (own.current !== null) own.current.indeterminate = indeterminate;\n }, [indeterminate]);\n\n const box = (\n <input\n {...rest}\n ref={setRef}\n type=\"checkbox\"\n className={label === undefined && className !== undefined ? `pb-checkbox ${className}` : \"pb-checkbox\"}\n />\n );\n if (label === undefined) return box;\n return (\n <label\n className={className === undefined ? \"pb-checkbox-row\" : `pb-checkbox-row ${className}`}\n data-disabled={rest.disabled === true || undefined}\n >\n {box}\n <span className=\"pb-checkbox-label\">{label}</span>\n </label>\n );\n}\n","// A square button that shows a glyph and is named by its label: the label is its accessible name and, unless a title\n// is given, its tooltip, and the glyph is hidden from screen readers. Tone, size and busy are Button's. A glyph has no\n// words to swap, so a busyLabel replaces the name (and the tooltip, unless a title is given) while busy, and Button\n// announces it.\nimport type { ReactNode } from \"react\";\nimport { Button, type ButtonProps } from \"../button\";\nimport \"./IconButton.css\";\n\nexport type IconButtonProps = Omit<ButtonProps, \"children\" | \"aria-label\"> & {\n /** The button's name for screen readers, and its tooltip unless title says otherwise. */\n label: string;\n /** The glyph: an icon or a character, hidden from screen readers. */\n children: ReactNode;\n};\n\nexport function IconButton({ label, title, className, children, ...rest }: IconButtonProps) {\n const name = rest.busy === true && rest.busyLabel !== undefined && rest.busyLabel !== \"\" ? rest.busyLabel : label;\n return (\n <Button\n {...rest}\n className={className === undefined ? \"pb-icon-button\" : `pb-icon-button ${className}`}\n aria-label={label}\n title={title ?? name}\n >\n <span className=\"pb-icon-button-glyph\" aria-hidden=\"true\">\n {children}\n </span>\n </Button>\n );\n}\n","// The cross on Dialog's and Sheet's close buttons, in the current text colour. Internal: not exported by the layer.\nexport function CloseGlyph() {\n return (\n <svg viewBox=\"0 0 16 16\" width=\"12\" height=\"12\" aria-hidden=\"true\">\n <path d=\"M3 3l10 10M13 3L3 13\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\" />\n </svg>\n );\n}\n","// A modal dialog: drawn over the page (in a portal on <body>) above a scrim, with a title, a close button, the app's\n// content and an optional row of actions. While it is open, Tab and Shift+Tab stay inside it and focus that wanders\n// out is brought back; Escape, the close button and a press on the scrim ask the app to close it (onClose), and the\n// app closes it by setting open to false. Opening focuses the content's first control (or one the content focused\n// itself, as with autoFocus), else the dialog; the body is a tab stop of its own, so a long one scrolls from the\n// keyboard; closing gives focus back to what had it before. Only the topmost of\n// several open dialogs keeps the focus.\nimport { type ReactNode, type KeyboardEvent, useEffect, useId, useRef } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { IconButton } from \"../icon-button\";\nimport { CloseGlyph } from \"./CloseGlyph\";\nimport \"./Dialog.css\";\n\nexport type DialogProps = {\n /** Whether the dialog is shown; the app holds it. */\n open: boolean;\n /** Asked for on Escape, the close button and a press on the scrim. */\n onClose: () => void;\n /** The dialog's title, which also names it for screen readers. */\n title: ReactNode;\n children: ReactNode;\n /** A row at the foot of the dialog, for its buttons. */\n actions?: ReactNode;\n /** The close button's name: \"Close\". */\n closeLabel?: string;\n /** A class added to the dialog's box. */\n className?: string;\n};\n\nconst focusable = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled]):not([type='hidden'])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"[tabindex]:not([tabindex='-1'])\",\n \"[contenteditable='true']\",\n].join(\",\");\n\n/** The controls inside `root` that Tab reaches, in order. */\nfunction tabbable(root: HTMLElement): HTMLElement[] {\n return [...root.querySelectorAll<HTMLElement>(focusable)].filter(\n (element) => element.closest(\"[hidden], [inert]\") === null && element.tabIndex >= 0,\n );\n}\n\n/** Whether `box` is the topmost open dialog: each opens in a portal appended to <body>, so the last one is on top. */\nfunction topmost(box: HTMLElement): boolean {\n const open = box.ownerDocument.querySelectorAll(\".pb-dialog\");\n return open[open.length - 1] === box;\n}\n\nfunction OpenDialog({ onClose, title, children, actions, closeLabel = \"Close\", className }: Omit<DialogProps, \"open\">) {\n const boxRef = useRef<HTMLDivElement>(null);\n const bodyRef = useRef<HTMLDivElement>(null);\n const titleId = useId();\n const onCloseRef = useRef(onClose);\n useEffect(() => {\n onCloseRef.current = onClose;\n }, [onClose]);\n\n useEffect(() => {\n const box = boxRef.current;\n if (box === null) return undefined;\n const before = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n if (!box.contains(document.activeElement)) {\n const body = bodyRef.current;\n (body === null ? undefined : tabbable(body)[0])?.focus();\n if (!box.contains(document.activeElement)) box.focus();\n }\n const keepFocus = (event: FocusEvent) => {\n if (!topmost(box)) return;\n if (event.target instanceof Node && box.contains(event.target)) return;\n (tabbable(box)[0] ?? box).focus();\n };\n document.addEventListener(\"focusin\", keepFocus);\n return () => {\n document.removeEventListener(\"focusin\", keepFocus);\n if (before?.isConnected === true) before.focus();\n };\n }, []);\n\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n onCloseRef.current();\n return;\n }\n if (event.key !== \"Tab\" || boxRef.current === null) return;\n const controls = tabbable(boxRef.current);\n const first = controls[0];\n const last = controls[controls.length - 1];\n if (first === undefined || last === undefined) {\n event.preventDefault();\n return;\n }\n const active = document.activeElement;\n if (event.shiftKey && (active === first || active === boxRef.current)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && active === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n return (\n <div\n className=\"pb-dialog-scrim\"\n onMouseDown={(event) => {\n // Only a press that starts on the scrim itself: a drag out of a text field does not close.\n if (event.target === event.currentTarget) onCloseRef.current();\n }}\n >\n <div\n ref={boxRef}\n className={className === undefined ? \"pb-dialog\" : `pb-dialog ${className}`}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby={titleId}\n tabIndex={-1}\n onKeyDown={onKeyDown}\n >\n <div className=\"pb-dialog-head\">\n <h2 className=\"pb-dialog-title\" id={titleId}>\n {title}\n </h2>\n <IconButton\n className=\"pb-dialog-close\"\n label={closeLabel}\n onClick={() => {\n onCloseRef.current();\n }}\n >\n <CloseGlyph />\n </IconButton>\n </div>\n {/* Focusable, so a body that scrolls can be scrolled from the keyboard. */}\n <div ref={bodyRef} className=\"pb-dialog-body\" tabIndex={0}>\n {children}\n </div>\n {actions === undefined ? null : <div className=\"pb-dialog-actions\">{actions}</div>}\n </div>\n </div>\n );\n}\n\nexport function Dialog({ open, ...rest }: DialogProps) {\n if (!open) return null;\n return createPortal(<OpenDialog {...rest} />, document.body);\n}\n","// A labelled form control: the label, the control (its one child), a hint under it and an error under that. It wires\n// the control to them itself: the control gets an id the label points at (its own id if it has one), aria-describedby\n// naming the hint and the error (after any ids it already has), and aria-invalid while there is an error. The control\n// is any element that passes those props on to its native element, as TextInput, Select and Checkbox do.\nimport {\n cloneElement,\n isValidElement,\n useId,\n type AriaAttributes,\n type ComponentPropsWithRef,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport \"./Field.css\";\n\n/** stacked (the default: the label above the control) or inline (the label in a column to its left); others stack. */\nexport type FieldLayout = \"stacked\" | \"inline\" | (string & {});\n\n/** The props Field sets on its control. */\nexport type FieldControlProps = {\n id?: string;\n \"aria-describedby\"?: string;\n \"aria-invalid\"?: AriaAttributes[\"aria-invalid\"];\n};\n\nexport type FieldProps = Omit<ComponentPropsWithRef<\"div\">, \"children\"> & {\n /** What the control is, as its accessible name. */\n label: ReactNode;\n /** Why the value is refused; while there is one the control is marked invalid. Empty means none. */\n error?: ReactNode;\n /** A line of help under the control. */\n hint?: ReactNode;\n layout?: FieldLayout;\n /** The control: one element that passes id and aria props on to its native element. */\n children: ReactElement<FieldControlProps>;\n};\n\nfunction present(node: ReactNode): boolean {\n return node !== undefined && node !== null && node !== false && node !== \"\";\n}\n\nexport function Field({ label, error, hint, layout = \"stacked\", className, children, ...rest }: FieldProps) {\n const base = useId();\n const control: unknown = children;\n const own = isValidElement<FieldControlProps>(control) ? control.props : undefined;\n const controlId = own?.id ?? `${base}-control`;\n const hintId = present(hint) ? `${base}-hint` : undefined;\n const errorId = present(error) ? `${base}-error` : undefined;\n const describedBy = [own?.[\"aria-describedby\"], hintId, errorId].filter((id) => id !== undefined && id !== \"\");\n const wired =\n own === undefined\n ? children\n : cloneElement(children, {\n id: controlId,\n \"aria-describedby\": describedBy.length > 0 ? describedBy.join(\" \") : undefined,\n \"aria-invalid\": errorId !== undefined ? true : own[\"aria-invalid\"],\n });\n return (\n <div\n {...rest}\n className={className === undefined ? \"pb-field\" : `pb-field ${className}`}\n data-layout={layout}\n data-invalid={errorId !== undefined || undefined}\n >\n <label className=\"pb-field-label\" htmlFor={controlId}>\n {label}\n </label>\n <div className=\"pb-field-control\">\n {wired}\n {hintId !== undefined && (\n <div className=\"pb-field-hint\" id={hintId}>\n {hint}\n </div>\n )}\n {errorId !== undefined && (\n <div className=\"pb-field-error\" id={errorId}>\n {error}\n </div>\n )}\n </div>\n </div>\n );\n}\n","// Facts as a two-column list of keys and values (a status summary, an inspector's details), drawn as a <dl> so each key\n// names its value for screen readers. A row's tone colours its value; a tone it does not know leaves it plain.\nimport type { ReactNode } from \"react\";\nimport \"./KeyValue.css\";\n\n/** The tones a value draws in; any other string leaves it plain. */\nexport type KeyValueTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | (string & {});\n\nexport type KeyValueRow = {\n /** The fact's name. */\n key: string;\n /** Its value. */\n value: ReactNode;\n /** Colours the value: a fact that is wrong or worth a look. */\n tone?: KeyValueTone;\n /** Shown on hover over the key: what the fact means. */\n title?: string;\n};\n\nexport type KeyValueProps = {\n /** The facts, in order. */\n rows: readonly KeyValueRow[];\n /** Names the list for screen readers when no heading does. */\n label?: string;\n /** A class added to the list. */\n className?: string;\n};\n\n/** Draws facts as keys and their values, side by side. */\nexport function KeyValue({ rows, label, className }: KeyValueProps) {\n return (\n <dl className={className === undefined ? \"pb-key-value\" : `pb-key-value ${className}`} aria-label={label}>\n {rows.map((row, index) => (\n // Rows have no identity beyond their place; two may share a key.\n <div key={index} className=\"pb-key-value-row\" data-tone={row.tone}>\n <dt title={row.title}>{row.key}</dt>\n <dd>{row.value}</dd>\n </div>\n ))}\n </dl>\n );\n}\n","// Keeps a scrolling box reachable by keyboard: while its content overflows it is a tab stop (so the arrow keys and Page\n// Up and Down scroll it), and while everything fits it is not, so a short panel adds no empty stop to the tab order.\nimport { useEffect, type RefObject } from \"react\";\n\n/** Whether `box`'s content is taller or wider than the box. */\nexport function overflows(box: HTMLElement): boolean {\n return box.scrollHeight > box.clientHeight || box.scrollWidth > box.clientWidth;\n}\n\n/** Makes `ref`'s box focusable exactly while it overflows, watching its size and its content. */\nexport function useScrollFocus(ref: RefObject<HTMLElement | null>): void {\n useEffect(() => {\n const box = ref.current;\n if (box === null) return;\n const settle = () => {\n if (overflows(box)) box.tabIndex = 0;\n else box.removeAttribute(\"tabindex\");\n };\n settle();\n // jsdom has no ResizeObserver; the content watch still runs there.\n const sizes = typeof ResizeObserver === \"function\" ? new ResizeObserver(settle) : null;\n const observeChildren = () => {\n if (sizes === null) return;\n sizes.disconnect();\n sizes.observe(box);\n for (const child of box.children) sizes.observe(child);\n };\n observeChildren();\n const content = new MutationObserver(() => {\n observeChildren();\n settle();\n });\n content.observe(box, { childList: true, subtree: true, characterData: true });\n return () => {\n sizes?.disconnect();\n content.disconnect();\n };\n }, [ref]);\n}\n","// A panel: a region of the page with an optional header (its title, and actions at the far end) over a body that\n// scrolls on its own, as an inspector or a side panel. It draws no outer border: the layout that places it (a docked\n// side, a sheet, a card) draws its edges. Its title names the region for screen readers. While its body overflows, the\n// body is a tab stop, so the keyboard can scroll it.\nimport { useId, useRef, type ComponentPropsWithRef, type ReactNode } from \"react\";\nimport { useScrollFocus } from \"./scroll-focus\";\nimport \"./Panel.css\";\n\nexport type PanelProps = Omit<ComponentPropsWithRef<\"section\">, \"title\"> & {\n /** The panel's heading; it also names the region. Without one, name it with aria-label. */\n title?: ReactNode;\n /** Slot at the header's far end: buttons, a count, a close button. */\n actions?: ReactNode;\n /** The title's heading level, h1 to h6; h2 by default. */\n level?: 1 | 2 | 3 | 4 | 5 | 6;\n children?: ReactNode;\n};\n\n/** Draws a titled region with its actions and a body that scrolls. */\nexport function Panel({ title, actions, level = 2, className, children, ...rest }: PanelProps) {\n const titleId = useId();\n const body = useRef<HTMLDivElement>(null);\n useScrollFocus(body);\n const Heading = `h${String(level)}` as \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n const header = title !== undefined || actions !== undefined;\n return (\n <section\n {...rest}\n aria-labelledby={\n rest[\"aria-labelledby\"] ?? (title !== undefined && rest[\"aria-label\"] === undefined ? titleId : undefined)\n }\n className={className === undefined ? \"pb-panel\" : `pb-panel ${className}`}\n >\n {header && (\n <header className=\"pb-panel-header\">\n {title !== undefined && (\n <Heading id={titleId} className=\"pb-panel-title\">\n {title}\n </Heading>\n )}\n {actions !== undefined && <div className=\"pb-panel-actions\">{actions}</div>}\n </header>\n )}\n <div ref={body} className=\"pb-panel-body\">\n {children}\n </div>\n </section>\n );\n}\n","// A state pill: a dot in the state's tone and the word beside it, so the state never rests on colour alone. A tone it\n// does not know is drawn neutrally, by its own word.\nimport type { ReactNode } from \"react\";\nimport \"./Pill.css\";\n\n/** The tones a pill draws; any other string is drawn neutrally. */\nexport type PillTone = \"ok\" | \"warn\" | \"err\" | \"quiet\" | \"off\" | \"accent\" | \"muted\" | (string & {});\n\nexport type PillProps = {\n /** The state's tone: the dot's and the word's colour. */\n tone: PillTone;\n /** The state in words, always shown beside the dot. */\n label: string;\n /** Pulses the dot (never the word) while the state is on its way, such as \"starting\"; stops under reduced motion. */\n pulse?: boolean;\n /** Shown on hover: what the state means or why it is so. */\n title?: string;\n /** After the word, in code type: a failure's code, say. */\n detail?: ReactNode;\n /** A class added to the pill. */\n className?: string;\n};\n\n/** Draws a state as a dot and its word, in the state's tone. */\nexport function Pill({ tone, label, pulse = false, title, detail, className }: PillProps) {\n return (\n <span\n className={className === undefined ? \"pb-pill\" : `pb-pill ${className}`}\n data-tone={tone}\n data-pulse={pulse ? \"\" : undefined}\n title={title}\n >\n <span className=\"pb-pill-dot\" aria-hidden=\"true\" />\n {label}\n {detail !== undefined && <code className=\"pb-pill-detail\">{detail}</code>}\n </span>\n );\n}\n","// A choice of one: native radios under a legend, in one fieldset (role radiogroup), so the browser gives the arrow\n// keys and a single tab stop. Controlled: the app holds the value and every press asks it through onChange. Its hint\n// and error are wired as Field wires a control's: aria-describedby names them, and aria-invalid marks the group while\n// there is an error.\nimport { useId, type ComponentPropsWithRef, type ReactNode } from \"react\";\nimport \"./RadioGroup.css\";\n\n/** stacked (the default: one option a row) or inline (the options side by side, wrapping); others stack. */\nexport type RadioGroupLayout = \"stacked\" | \"inline\" | (string & {});\n\nexport type RadioOption = {\n /** The value onChange gives when this option is picked; unique in the group. */\n value: string;\n /** The option's words, which pick it too. */\n label: ReactNode;\n /** Shown on hover over the option. */\n title?: string;\n /** Not pickable. */\n disabled?: boolean;\n};\n\nexport type RadioGroupProps = Omit<ComponentPropsWithRef<\"fieldset\">, \"children\" | \"onChange\"> & {\n /** What the choice is: the group's legend and accessible name. */\n legend: ReactNode;\n /** Keeps the legend for screen readers only, when the layout around the group already says what it is. */\n legendHidden?: boolean;\n options: readonly RadioOption[];\n /** The picked option's value; one matching no option (or undefined) picks none. */\n value: string | undefined;\n /** Asks the app to pick this value. */\n onChange: (value: string) => void;\n /** The radios' shared name; one of its own by default. */\n name?: string;\n layout?: RadioGroupLayout;\n /** A line of help under the options. */\n hint?: ReactNode;\n /** Why the choice is refused; while there is one the group is marked invalid. Empty means none. */\n error?: ReactNode;\n};\n\nfunction present(node: ReactNode): boolean {\n return node !== undefined && node !== null && node !== false && node !== \"\";\n}\n\nexport function RadioGroup({\n legend,\n legendHidden = false,\n options,\n value,\n onChange,\n name,\n layout = \"stacked\",\n hint,\n error,\n className,\n \"aria-describedby\": describedByOwn,\n \"aria-invalid\": invalidOwn,\n ...rest\n}: RadioGroupProps) {\n const base = useId();\n const groupName = name ?? `${base}-name`;\n const hintId = present(hint) ? `${base}-hint` : undefined;\n const errorId = present(error) ? `${base}-error` : undefined;\n const describedBy = [describedByOwn, hintId, errorId].filter((id) => id !== undefined && id !== \"\");\n return (\n <fieldset\n {...rest}\n role=\"radiogroup\"\n className={className === undefined ? \"pb-radio-group\" : `pb-radio-group ${className}`}\n data-layout={layout}\n aria-describedby={describedBy.length > 0 ? describedBy.join(\" \") : undefined}\n aria-invalid={errorId !== undefined ? true : invalidOwn}\n >\n <legend className=\"pb-radio-group-legend\" data-hidden={legendHidden || undefined}>\n {legend}\n </legend>\n <div className=\"pb-radio-group-options\">\n {options.map((option) => (\n <label\n key={option.value}\n className=\"pb-radio-row\"\n title={option.title}\n data-disabled={option.disabled === true || rest.disabled === true || undefined}\n >\n <input\n className=\"pb-radio\"\n type=\"radio\"\n name={groupName}\n value={option.value}\n checked={option.value === value}\n disabled={option.disabled}\n onChange={() => {\n onChange(option.value);\n }}\n />\n <span className=\"pb-radio-label\">{option.label}</span>\n </label>\n ))}\n </div>\n {hintId !== undefined && (\n <div className=\"pb-radio-group-hint\" id={hintId}>\n {hint}\n </div>\n )}\n {errorId !== undefined && (\n <div className=\"pb-radio-group-error\" id={errorId}>\n {error}\n </div>\n )}\n </fieldset>\n );\n}\n","// A section's title in a panel or inspector, a heading with its actions (buttons, a count) at the far end. The\n// heading's level fits the page it sits in.\nimport type { ReactNode } from \"react\";\nimport \"./SectionTitle.css\";\n\nexport type SectionTitleProps = {\n /** The title. */\n children: ReactNode;\n /** Slot at the title's far end: buttons, a count, a badge. */\n actions?: ReactNode;\n /** The heading's level, h2 to h6. */\n level?: 2 | 3 | 4 | 5 | 6;\n /** A class added to the title's row. */\n className?: string;\n};\n\n/** Draws a section's heading, with its actions at the far end. */\nexport function SectionTitle({ children, actions, level = 3, className }: SectionTitleProps) {\n const Heading = `h${level}` as const;\n return (\n <div className={className === undefined ? \"pb-section-title\" : `pb-section-title ${className}`}>\n <Heading className=\"pb-section-title-text\">{children}</Heading>\n {actions !== undefined && <div className=\"pb-section-title-actions\">{actions}</div>}\n </div>\n );\n}\n","// A drop-down choice in the library's look: a native select (every native prop passes through, ref included; its\n// options are its children), so the platform's own list opens, the keyboard works as the platform's does, and a phone\n// shows its picker. It shows aria-invalid in the error tone, as Field sets it. On a touch screen its text is 16 px, as\n// iOS Safari zooms the page when a smaller field takes the focus.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./Select.css\";\n\n/** ui (the default) or code, the monospace face for values written as code; others draw as ui. */\nexport type SelectFont = \"ui\" | \"code\" | (string & {});\n\nexport type SelectProps = ComponentPropsWithRef<\"select\"> & {\n font?: SelectFont;\n};\n\nexport function Select({ font = \"ui\", className, children, ...rest }: SelectProps) {\n return (\n <select {...rest} className={className === undefined ? \"pb-select\" : `pb-select ${className}`} data-font={font}>\n {children}\n </select>\n );\n}\n","// A sheet: a panel drawn over its container's right edge or rising from its bottom, as an inspector is on a narrow\n// window or a phone. It is not modal: the page around it stays live, and opening it does not take the focus (a\n// selection on the canvas opens it while the person is still working there). Escape inside it and its close button\n// ask the app to close it; if the focus was inside when it closes, it goes back to where it came from. The sheet is\n// placed absolutely, so its container (the app's workspace) is positioned; the app holds open, and chooses the side\n// (the right edge below 760 px, the bottom below 600 px).\nimport {\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n type CSSProperties,\n useEffect,\n useId,\n useRef,\n} from \"react\";\nimport { CloseGlyph } from \"../dialog/CloseGlyph\";\nimport { IconButton } from \"../icon-button\";\nimport \"./Sheet.css\";\n\nexport type SheetSide = \"right\" | \"bottom\";\n\nexport type SheetProps = {\n /** Whether the sheet is shown; the app holds it. */\n open: boolean;\n /** Asked for on Escape inside the sheet and on its close button. */\n onClose: () => void;\n /** The edge it is drawn from: the right edge (the default) or the bottom. */\n side?: SheetSide;\n /** The sheet's title, which also names it for screen readers; without one, name it with `label`. */\n title?: ReactNode;\n /** The sheet's name for screen readers when it has no title. */\n label?: string;\n children: ReactNode;\n /** A right sheet's width in px, held to 280–560 px and to 48 px short of its container. */\n width?: number;\n /** The close button's name: \"Close\". */\n closeLabel?: string;\n /** A class added to the sheet. */\n className?: string;\n};\n\nfunction OpenSheet({\n onClose,\n side = \"right\",\n title,\n label,\n children,\n width,\n closeLabel = \"Close\",\n className,\n}: Omit<SheetProps, \"open\">) {\n const sheetRef = useRef<HTMLElement>(null);\n const titleId = useId();\n /** Where the focus came from when it entered the sheet: it goes back there if the sheet closes holding it. */\n const cameFrom = useRef<HTMLElement | null>(null);\n\n useEffect(() => {\n const sheet = sheetRef.current;\n return () => {\n const back = cameFrom.current;\n const active = document.activeElement;\n const held = active === null || active === document.body || (sheet?.contains(active) ?? false);\n if (held && back?.isConnected === true) back.focus();\n };\n }, []);\n\n const onFocus = (event: FocusEvent<HTMLElement>) => {\n const from = event.relatedTarget;\n if (from instanceof HTMLElement && !event.currentTarget.contains(from)) cameFrom.current = from;\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => {\n if (event.defaultPrevented || event.key !== \"Escape\") return;\n event.preventDefault();\n event.stopPropagation();\n onClose();\n };\n\n const style = width === undefined ? undefined : ({ \"--pb-sheet-width\": `${width}px` } as CSSProperties);\n\n return (\n <section\n ref={sheetRef}\n className={className === undefined ? \"pb-sheet\" : `pb-sheet ${className}`}\n data-side={side}\n role=\"dialog\"\n aria-labelledby={title === undefined ? undefined : titleId}\n aria-label={title === undefined ? label : undefined}\n style={style}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n >\n <div className=\"pb-sheet-head\">\n {title === undefined ? (\n <span className=\"pb-sheet-title\" />\n ) : (\n <h2 className=\"pb-sheet-title\" id={titleId}>\n {title}\n </h2>\n )}\n <IconButton className=\"pb-sheet-close\" label={closeLabel} onClick={onClose}>\n <CloseGlyph />\n </IconButton>\n </div>\n {/* Focusable, so a body that scrolls can be scrolled from the keyboard. */}\n <div className=\"pb-sheet-body\" tabIndex={0}>\n {children}\n </div>\n </section>\n );\n}\n\nexport function Sheet({ open, ...rest }: SheetProps) {\n if (!open) return null;\n return <OpenSheet {...rest} />;\n}\n","// A splitter's maths, pure: a size kept within its bounds, a drag, and a key. Splitter.tsx draws and listens; this\n// file decides the size.\n\n/** The smallest and largest size, in px. */\nexport interface Bounds {\n min: number;\n max: number;\n}\n\n/** `value` within `bounds`, in whole px. A max below the min is read as the min. */\nexport function clamp(value: number, bounds: Bounds): number {\n const max = Math.max(bounds.min, bounds.max);\n return Math.round(Math.min(max, Math.max(bounds.min, value)));\n}\n\n/**\n * A drag: the size at the drag's start plus the pointer's travel times `sign`, clamped. The sign is -1 for a splitter on\n * the start edge (left or top) of what it resizes, where moving left or up grows it, and 1 on the end edge.\n */\nexport function dragged(start: number, travel: number, sign: 1 | -1, bounds: Bounds): number {\n return clamp(start + sign * travel, bounds);\n}\n\n/** Which arrow grows what the splitter resizes, from its orientation and the edge it sits on. */\nexport function growKey(orientation: \"vertical\" | \"horizontal\", edge: \"start\" | \"end\"): string {\n if (orientation === \"vertical\") return edge === \"start\" ? \"ArrowLeft\" : \"ArrowRight\";\n return edge === \"start\" ? \"ArrowUp\" : \"ArrowDown\";\n}\n\nconst opposite: Record<string, string> = {\n ArrowLeft: \"ArrowRight\",\n ArrowRight: \"ArrowLeft\",\n ArrowUp: \"ArrowDown\",\n ArrowDown: \"ArrowUp\",\n};\n\n/**\n * A key on a focused splitter: `grow` adds `step` and its opposite arrow takes it away, clamped; Home goes to the min\n * and End to the max; any other key gives undefined (the key is not the splitter's).\n */\nexport function keyed(value: number, key: string, grow: string, step: number, bounds: Bounds): number | undefined {\n if (key === grow) return clamp(value + step, bounds);\n if (key === opposite[grow]) return clamp(value - step, bounds);\n if (key === \"Home\") return clamp(bounds.min, bounds);\n if (key === \"End\") return clamp(bounds.max, bounds);\n return undefined;\n}\n","// A resize handle, as a WAI-ARIA separator: the edge of a pane, dragged with the pointer or moved by the arrow keys,\n// Home and End while focused. It keeps only the drag in progress; the size is the app's (value and onChange). It sits\n// absolutely on one edge of its positioned parent, the pane it resizes. splitter-math.ts holds the maths.\nimport { useRef, type ComponentPropsWithRef, type KeyboardEvent, type PointerEvent } from \"react\";\nimport { dragged, growKey, keyed } from \"./splitter-math\";\nimport \"./Splitter.css\";\n\n/** vertical: a vertical bar that resizes a width; horizontal: a horizontal bar that resizes a height. */\nexport type SplitterOrientation = \"vertical\" | \"horizontal\";\n\n/** The edge of the resized pane the splitter sits on: start is its left or top, end its right or bottom. */\nexport type SplitterEdge = \"start\" | \"end\";\n\nexport type SplitterProps = Omit<\n ComponentPropsWithRef<\"div\">,\n \"onChange\" | \"children\" | \"role\" | \"aria-orientation\" | \"aria-valuenow\" | \"aria-valuemin\" | \"aria-valuemax\"\n> & {\n orientation: SplitterOrientation;\n /** The pane's size in px. */\n value: number;\n /** The smallest size in px. */\n min: number;\n /** The largest size in px. */\n max: number;\n /** A new size, in whole px within min and max. */\n onChange: (px: number) => void;\n /** The separator's accessible name, such as \"Resize the inspector\". */\n label: string;\n /** Which edge of the pane it sits on; start (left or top) by default, where moving left or up grows the pane. */\n edge?: SplitterEdge;\n /** How far one arrow key moves it, in px; 16 by default. */\n step?: number;\n};\n\n/** Draws a pane's resize handle, dragged by pointer or moved by keys. */\nexport function Splitter({\n orientation,\n value,\n min,\n max,\n onChange,\n label,\n edge = \"start\",\n step = 16,\n className,\n onPointerDown,\n onPointerMove,\n onPointerUp,\n onPointerCancel,\n onKeyDown,\n ...rest\n}: SplitterProps) {\n const drag = useRef<{ start: number; at: number } | null>(null);\n const bounds = { min, max };\n const along = (event: PointerEvent) => (orientation === \"vertical\" ? event.clientX : event.clientY);\n\n function down(event: PointerEvent<HTMLDivElement>) {\n onPointerDown?.(event);\n if (event.defaultPrevented || event.button !== 0) return;\n event.preventDefault();\n const target = event.currentTarget;\n // Captured, the drag follows the pointer past the bar's few px; jsdom has no capture.\n if (typeof target.setPointerCapture === \"function\") target.setPointerCapture(event.pointerId);\n target.focus();\n target.dataset[\"dragging\"] = \"\";\n drag.current = { start: value, at: along(event) };\n }\n function move(event: PointerEvent<HTMLDivElement>) {\n onPointerMove?.(event);\n const started = drag.current;\n if (started === null) return;\n const next = dragged(started.start, along(event) - started.at, edge === \"start\" ? -1 : 1, bounds);\n if (next !== value) onChange(next);\n }\n function end(event: PointerEvent<HTMLDivElement>) {\n if (event.type === \"pointercancel\") onPointerCancel?.(event);\n else onPointerUp?.(event);\n if (drag.current === null) return;\n drag.current = null;\n const target = event.currentTarget;\n delete target.dataset[\"dragging\"];\n if (typeof target.hasPointerCapture === \"function\" && target.hasPointerCapture(event.pointerId)) {\n target.releasePointerCapture(event.pointerId);\n }\n }\n function key(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n if (event.defaultPrevented || event.altKey || event.ctrlKey || event.metaKey) return;\n const next = keyed(value, event.key, growKey(orientation, edge), step, bounds);\n if (next === undefined) return;\n event.preventDefault();\n if (next !== value) onChange(next);\n }\n\n return (\n <div\n {...rest}\n role=\"separator\"\n tabIndex={rest.tabIndex ?? 0}\n aria-orientation={orientation}\n aria-label={label}\n aria-valuenow={value}\n aria-valuemin={min}\n aria-valuemax={max}\n className={className === undefined ? \"pb-splitter\" : `pb-splitter ${className}`}\n data-orientation={orientation}\n data-edge={edge}\n onPointerDown={down}\n onPointerMove={move}\n onPointerUp={end}\n onPointerCancel={end}\n onKeyDown={key}\n />\n );\n}\n","// A one-line text field in the library's look: a native input (every native prop passes through, ref included), in\n// the UI face or the code face. It shows aria-invalid in the error tone, as Field sets it. On a touch screen its text is\n// 16 px, as iOS Safari zooms the page when a smaller field takes the focus.\nimport type { ComponentPropsWithRef } from \"react\";\nimport \"./TextInput.css\";\n\n/** ui (the default) or code, the monospace face for values written as code; others draw as ui. */\nexport type TextInputFont = \"ui\" | \"code\" | (string & {});\n\nexport type TextInputProps = ComponentPropsWithRef<\"input\"> & {\n font?: TextInputFont;\n};\n\nexport function TextInput({ font = \"ui\", type = \"text\", className, ...rest }: TextInputProps) {\n return (\n <input\n {...rest}\n type={type}\n className={className === undefined ? \"pb-text-input\" : `pb-text-input ${className}`}\n data-font={font}\n />\n );\n}\n","// The theme switch: one button that cycles system, light and dark. Its word is shown beside the icon, and its\n// accessible name always says the choice, so it is never just a glyph; the icon is SVG, since a font may lack a ◐\n// character. The choice is the app's (useTheme keeps it); the switch only says it and asks for the next. At phone\n// width the word gives way to the icon alone, and the name still says the choice.\nimport type { ComponentPropsWithRef } from \"react\";\nimport type { ThemeChoice } from \"../../hooks/use-theme/useTheme\";\nimport \"./ThemeSwitch.css\";\n\nexport type { ThemeChoice };\n\n/** The switch's words, each replaceable. */\nexport interface ThemeSwitchLabels {\n /** What the switch is: \"Theme\". */\n theme: string;\n system: string;\n light: string;\n dark: string;\n /** Said of system in the tooltip: \"follows the system's setting\". */\n systemHint: string;\n /** Before the next choice in the tooltip: \"click for\". */\n clickFor: string;\n}\n\nexport const defaultThemeSwitchLabels: ThemeSwitchLabels = {\n theme: \"Theme\",\n system: \"system\",\n light: \"light\",\n dark: \"dark\",\n systemHint: \"follows the system's setting\",\n clickFor: \"click for\",\n};\n\nconst order: readonly ThemeChoice[] = [\"system\", \"light\", \"dark\"];\n\n/** The choice a press moves to: system, light, dark and back. */\nfunction following(choice: ThemeChoice): ThemeChoice {\n return order[(order.indexOf(choice) + 1) % order.length] ?? \"system\";\n}\n\nexport type ThemeSwitchProps = Omit<ComponentPropsWithRef<\"button\">, \"children\" | \"onClick\" | \"type\" | \"title\"> & {\n /** The theme now. */\n choice: ThemeChoice;\n /** Called with the next choice in the cycle when the switch is pressed. */\n onChoose: (next: ThemeChoice) => void;\n /** Words to replace; the rest keep their defaults. */\n labels?: Partial<ThemeSwitchLabels>;\n};\n\n/** The switch's tooltip: what the theme is and what a press does. */\nexport function themeSwitchTitle(choice: ThemeChoice, labels: ThemeSwitchLabels = defaultThemeSwitchLabels): string {\n const hint = choice === \"system\" ? ` (${labels.systemHint})` : \"\";\n return `${labels.theme}: ${labels[choice]}${hint}; ${labels.clickFor} ${labels[following(choice)]}`;\n}\n\nexport function ThemeSwitch({ choice, onChoose, labels, className, ...rest }: ThemeSwitchProps) {\n const words = { ...defaultThemeSwitchLabels, ...labels };\n return (\n <button\n {...rest}\n type=\"button\"\n className={className === undefined ? \"pb-theme-switch\" : `pb-theme-switch ${className}`}\n title={themeSwitchTitle(choice, words)}\n aria-label={`${words.theme}: ${words[choice]}`}\n onClick={() => {\n onChoose(following(choice));\n }}\n >\n <svg className=\"pb-theme-switch-icon\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\">\n <circle cx=\"8\" cy=\"8\" r=\"6.25\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M8 1.75a6.25 6.25 0 0 1 0 12.5z\" fill=\"currentColor\" />\n </svg>\n <span className=\"pb-theme-switch-word\">{words[choice]}</span>\n </button>\n );\n}\n","// Roving focus over a toolbar's items, pure DOM: which elements are items, which one holds the toolbar's one tab stop,\n// and where an arrow key, Home or End moves the focus. Toolbar.tsx wires it to React.\n\n/** What counts as an item: an enabled control, or anything that says it is a button, checkbox or radio. */\nexport const itemSelector = [\n \"button:not(:disabled)\",\n \"a[href]\",\n \"input:not(:disabled)\",\n \"select:not(:disabled)\",\n \"textarea:not(:disabled)\",\n '[role=\"button\"]',\n '[role=\"checkbox\"]',\n '[role=\"radio\"]',\n '[role=\"menuitem\"]',\n '[role=\"switch\"]',\n].join(\", \");\n\n/** The toolbar's items, in document order, leaving out those of a toolbar nested inside it. */\nexport function items(toolbar: HTMLElement): HTMLElement[] {\n return [...toolbar.querySelectorAll<HTMLElement>(itemSelector)].filter(\n (item) => item.closest('[role=\"toolbar\"]') === toolbar,\n );\n}\n\n/** Gives `current` the one tab stop (0) and every other item -1; with no current, the first item takes it. */\nexport function setTabStop(all: readonly HTMLElement[], current: HTMLElement | null): HTMLElement | null {\n const stop = current !== null && all.includes(current) ? current : (all[0] ?? null);\n for (const item of all) item.tabIndex = item === stop ? 0 : -1;\n return stop;\n}\n\n/**\n * The item a key moves the focus to from `index`, or undefined when the key is not the toolbar's. Horizontal toolbars\n * take the left and right arrows (swapped right to left), vertical ones up and down; both take Home and End. The ends\n * wrap around.\n */\nexport function moved(\n index: number,\n count: number,\n key: string,\n orientation: \"horizontal\" | \"vertical\",\n rtl: boolean,\n): number | undefined {\n if (count === 0) return undefined;\n if (key === \"Home\") return 0;\n if (key === \"End\") return count - 1;\n const [back, forth] =\n orientation === \"vertical\"\n ? [\"ArrowUp\", \"ArrowDown\"]\n : rtl\n ? [\"ArrowRight\", \"ArrowLeft\"]\n : [\"ArrowLeft\", \"ArrowRight\"];\n if (key === forth) return (index + 1) % count;\n if (key === back) return (index - 1 + count) % count;\n return undefined;\n}\n\n/** Whether a key pressed in `element` belongs to the text it edits (arrows, Home and End move its caret). */\nexport function editsText(element: Element): boolean {\n if (element instanceof HTMLTextAreaElement) return true;\n if (element instanceof HTMLInputElement) {\n return ![\"button\", \"checkbox\", \"radio\", \"reset\", \"submit\", \"image\", \"color\", \"file\", \"range\"].includes(\n element.type,\n );\n }\n return element instanceof HTMLElement && element.isContentEditable;\n}\n","// A WAI-ARIA toolbar: a row (or column) of controls that is one tab stop, the arrow keys, Home and End moving the focus\n// between its items (roving tabindex). The items are whatever controls its children render; the toolbar sets their\n// tabIndex itself, so an item's own tabIndex is overwritten. The item last focused keeps the tab stop, and a text field\n// inside keeps its own arrow keys. roving.ts holds the rules.\nimport { useEffect, useRef, type ComponentPropsWithRef, type FocusEvent, type KeyboardEvent } from \"react\";\nimport { editsText, items, moved, setTabStop } from \"./roving\";\nimport \"./Toolbar.css\";\n\nexport type ToolbarOrientation = \"horizontal\" | \"vertical\";\n\nexport type ToolbarProps = Omit<ComponentPropsWithRef<\"div\">, \"role\" | \"aria-orientation\"> & {\n /** The toolbar's accessible name, such as \"Canvas\". */\n label: string;\n /** horizontal (the default) moves with the left and right arrows; vertical with up and down. */\n orientation?: ToolbarOrientation;\n};\n\n/** Draws a group of controls as one tab stop, with the arrow keys moving between them. */\nexport function Toolbar({\n label,\n orientation = \"horizontal\",\n className,\n ref,\n onKeyDown,\n onFocus,\n children,\n ...rest\n}: ToolbarProps) {\n const own = useRef<HTMLDivElement | null>(null);\n const current = useRef<HTMLElement | null>(null);\n\n // After every render, and whenever an item comes, goes or is enabled or disabled, one item holds the tab stop.\n useEffect(() => {\n const toolbar = own.current;\n if (toolbar === null) return;\n const settle = () => {\n current.current = setTabStop(items(toolbar), current.current);\n };\n settle();\n const watch = new MutationObserver(settle);\n watch.observe(toolbar, { childList: true, subtree: true, attributes: true, attributeFilter: [\"disabled\", \"href\"] });\n return () => {\n watch.disconnect();\n };\n });\n\n function focus(event: FocusEvent<HTMLDivElement>) {\n onFocus?.(event);\n const toolbar = own.current;\n if (toolbar === null) return;\n const all = items(toolbar);\n if (event.target instanceof HTMLElement && all.includes(event.target)) {\n current.current = setTabStop(all, event.target);\n }\n }\n function key(event: KeyboardEvent<HTMLDivElement>) {\n onKeyDown?.(event);\n const toolbar = own.current;\n if (event.defaultPrevented || toolbar === null || event.altKey || event.ctrlKey || event.metaKey) return;\n if (editsText(event.target as Element)) return;\n const all = items(toolbar);\n const index = all.indexOf(event.target as HTMLElement);\n if (index === -1) return;\n const rtl = getComputedStyle(toolbar).direction === \"rtl\";\n const next = moved(index, all.length, event.key, orientation, rtl);\n if (next === undefined) return;\n event.preventDefault();\n all[next]?.focus();\n }\n\n return (\n <div\n {...rest}\n ref={(element) => {\n own.current = element;\n if (typeof ref === \"function\") return ref(element);\n if (ref) ref.current = element;\n return undefined;\n }}\n role=\"toolbar\"\n aria-label={label}\n aria-orientation={orientation}\n className={className === undefined ? \"pb-toolbar\" : `pb-toolbar ${className}`}\n onKeyDown={key}\n onFocus={focus}\n >\n {children}\n </div>\n );\n}\n","// A floating group of tools, such as a canvas's zoom, fit and minimap: a Toolbar drawn as one raised, framed group of\n// square buttons. Its tools are IconButtons (or plain <button>s named by aria-label with their\n// glyph hidden); a pressed one (aria-pressed) is drawn in the accent. 28 px buttons, 40 px on touch.\nimport { Toolbar, type ToolbarProps } from \"../toolbar\";\nimport \"./ToolGroup.css\";\n\nexport type ToolGroupProps = ToolbarProps;\n\n/** Draws a framed group of square tool buttons, one tab stop with roving focus. */\nexport function ToolGroup({ className, ...rest }: ToolGroupProps) {\n return <Toolbar {...rest} className={className === undefined ? \"pb-tool-group\" : `pb-tool-group ${className}`} />;\n}\n","// The warning mark: an \"!\" in a circle beside words, for something that rose lately (a badge's or a counter's). The\n// glyph is hidden from screen readers, which read its label instead.\nimport \"./WarnMark.css\";\n\nexport type WarnMarkProps = {\n /** What the mark means, read by screen readers in its place. */\n label: string;\n /** Shown on hover over the mark. */\n title?: string;\n /** A class added to the mark. */\n className?: string;\n};\n\n/** Draws a warning \"!\" for the eye and its words for screen readers. */\nexport function WarnMark({ label, title, className }: WarnMarkProps) {\n return (\n <>\n <span\n className={className === undefined ? \"pb-warn-mark\" : `pb-warn-mark ${className}`}\n aria-hidden=\"true\"\n title={title}\n >\n !\n </span>\n <span className=\"pb-warn-mark-text\">{label}</span>\n </>\n );\n}\n"],"mappings":";;;;AAwCA,SAAgBG,EAAM,EAAE,SAAM,aAAU,YAAY,aAAU,UAAO,gBAAyB;CAC5F,OACE,kBAAC,QAAD;EACE,WAAWC,MAAc,KAAA,IAAY,aAAa,YAAYA;EAC9D,aAAWC;EACX,gBAAcC,MAAY,WAAW,WAAW,KAAA;EACzC;EAEN;CACG,CAAA;AAEV;;ACvCA,SAAgBC,EAAQ,EAAE,UAAO,cAAW,GAAGC,KAAsB;CACnE,IAAMC,IAAUL,MAAc,KAAA,IAAY,eAAe,cAAcA;CAIvE,OAHIM,MAAU,KAAA,KAAaA,MAAU,KAC5B,kBAAC,QAAD;EAAM,GAAIF;EAAM,WAAWC;EAAS,eAAY;CAAQ,CAAA,IAG/D,kBAAC,QAAD;EAAM,GAAID;EAAM,WAAW,GAAGC,EAAQ;EAAuB,MAAK;EAAlE,UAAA,CACE,kBAAC,QAAD;GAAM,WAAU;GAAkB,eAAY;EAAQ,CAAA,GACtD,kBAAC,QAAD;GAAM,WAAU;GAAoB,UAAAC;EAAY,CAAA,CAC5C;;AAEV;;ACGA,SAAgBC,EAAO,EACrB,UAAO,WACP,UAAO,MACP,UAAO,IACP,cACA,UAAO,UACP,cACA,a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