@k2b/ui 0.63.0 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base.css +6 -3
- package/dist/browser/actions/ContextMenu.js +3 -1
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/DragAndDrop.js +26 -5
- package/dist/browser/actions/DragAndDrop.js.map +1 -1
- package/dist/browser/actions/DropOverlay.js +76 -0
- package/dist/browser/actions/DropOverlay.js.map +1 -0
- package/dist/browser/actions/Dropdown.js +69 -15
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/SortableList.js +338 -85
- package/dist/browser/actions/SortableList.js.map +1 -1
- package/dist/browser/actions/ViewTabs.js +9 -5
- package/dist/browser/actions/ViewTabs.js.map +1 -1
- package/dist/browser/actions/drag-and-drop-keyboard.js +211 -0
- package/dist/browser/actions/drag-and-drop-keyboard.js.map +1 -0
- package/dist/browser/actions/drag-and-drop-messages.js +21 -25
- package/dist/browser/actions/drag-and-drop-messages.js.map +1 -1
- package/dist/browser/actions/drag-and-drop.js +206 -184
- package/dist/browser/actions/drag-and-drop.js.map +1 -1
- package/dist/browser/actions/drop-overlay-pages.js +54 -0
- package/dist/browser/actions/drop-overlay-pages.js.map +1 -0
- package/dist/browser/actions/drop-overlay-view.js +318 -0
- package/dist/browser/actions/drop-overlay-view.js.map +1 -0
- package/dist/browser/actions/index.js +4 -2
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/menu-sheet-messages.js +26 -0
- package/dist/browser/actions/menu-sheet-messages.js.map +1 -0
- package/dist/browser/actions/menu-sheet.js +80 -18
- package/dist/browser/actions/menu-sheet.js.map +1 -1
- package/dist/browser/actions/menu-submenu-panel.js +392 -0
- package/dist/browser/actions/menu-submenu-panel.js.map +1 -0
- package/dist/browser/actions/preload-when-idle.js +15 -0
- package/dist/browser/actions/preload-when-idle.js.map +1 -0
- package/dist/browser/actions/sortable-board.js +107 -0
- package/dist/browser/actions/sortable-board.js.map +1 -0
- package/dist/browser/actions/sortable-keyboard.js +202 -0
- package/dist/browser/actions/sortable-keyboard.js.map +1 -0
- package/dist/browser/actions/sortable-list-messages.js +23 -11
- package/dist/browser/actions/sortable-list-messages.js.map +1 -1
- package/dist/browser/actions/sortable-place.js +26 -0
- package/dist/browser/actions/sortable-place.js.map +1 -0
- package/dist/browser/chat/ChatDecision.js +499 -463
- package/dist/browser/chat/ChatDecision.js.map +1 -1
- package/dist/browser/chat/ChatDecisionField.js +311 -0
- package/dist/browser/chat/ChatDecisionField.js.map +1 -0
- package/dist/browser/chat/index.js +2 -0
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/chat/types.js.map +1 -1
- package/dist/browser/chat-decision-field.js +6 -0
- package/dist/browser/chat-decision-field.js.map +1 -0
- package/dist/browser/content/DataTable.js +326 -205
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/FileName.js +68 -0
- package/dist/browser/content/FileName.js.map +1 -0
- package/dist/browser/content/ProgressPath.js +30 -25
- package/dist/browser/content/ProgressPath.js.map +1 -1
- package/dist/browser/content/TaskRow.js +129 -0
- package/dist/browser/content/TaskRow.js.map +1 -0
- package/dist/browser/content/index.js +2 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/progress-path-messages.js +22 -0
- package/dist/browser/content/progress-path-messages.js.map +1 -0
- package/dist/browser/feedback/dialog-core.js +68 -11
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/feedback/dialog-foot.js +45 -0
- package/dist/browser/feedback/dialog-foot.js.map +1 -0
- package/dist/browser/inputs/DatePicker.js +369 -716
- package/dist/browser/inputs/DatePicker.js.map +1 -1
- package/dist/browser/inputs/FileInputs.js +1 -1
- package/dist/browser/inputs/FileInputs.js.map +1 -1
- package/dist/browser/inputs/NumberInput.js +125 -46
- package/dist/browser/inputs/NumberInput.js.map +1 -1
- package/dist/browser/inputs/PeriodPicker.js +9 -4
- package/dist/browser/inputs/PeriodPicker.js.map +1 -1
- package/dist/browser/inputs/TextInput.js +3 -3
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/inputs/date-picker-panel.js +420 -0
- package/dist/browser/inputs/date-picker-panel.js.map +1 -0
- package/dist/browser/inputs/image-crop.js +1 -1
- package/dist/browser/inputs/image-crop.js.map +1 -1
- package/dist/browser/inputs/image-tools.js +4 -0
- package/dist/browser/inputs/image-tools.js.map +1 -0
- package/dist/browser/inputs/input-messages.js +8 -2
- package/dist/browser/inputs/input-messages.js.map +1 -1
- package/dist/browser/internal/field.js +2 -2
- package/dist/browser/internal/field.js.map +1 -1
- package/dist/browser/internal/renders-something.js +3 -0
- package/dist/browser/internal/renders-something.js.map +1 -0
- package/dist/browser/intl/messages.js +1 -1
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +16 -8
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/Breadcrumbs.js +188 -42
- package/dist/browser/layout/Breadcrumbs.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +209 -205
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/FloatingPill.js +33 -0
- package/dist/browser/layout/FloatingPill.js.map +1 -0
- package/dist/browser/layout/PanelDialog.js +176 -88
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/StatusRow.js +174 -0
- package/dist/browser/layout/StatusRow.js.map +1 -0
- package/dist/browser/layout/app-workspace-controller.js +12 -5
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/app-workspace-state.js +2 -2
- package/dist/browser/layout/app-workspace-state.js.map +1 -1
- package/dist/browser/layout/index.js +2 -0
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/panel-dialog-error.js +44 -0
- package/dist/browser/layout/panel-dialog-error.js.map +1 -0
- package/dist/browser/layout/panel-sheet-handle.js +86 -0
- package/dist/browser/layout/panel-sheet-handle.js.map +1 -0
- package/dist/browser/layout/workspace-messages.js +12 -2
- package/dist/browser/layout/workspace-messages.js.map +1 -1
- package/dist/browser/layout-check.js +232 -0
- package/dist/browser/layout-check.js.map +1 -0
- package/dist/browser/surfaces/Area.js +205 -0
- package/dist/browser/surfaces/Area.js.map +1 -0
- package/dist/browser/surfaces/FactGroup.js +148 -0
- package/dist/browser/surfaces/FactGroup.js.map +1 -0
- package/dist/browser/surfaces/FieldGrid.js +34 -0
- package/dist/browser/surfaces/FieldGrid.js.map +1 -0
- package/dist/browser/surfaces/NoticeCard.js +69 -57
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/browser/surfaces/Placeholder.js +17 -5
- package/dist/browser/surfaces/Placeholder.js.map +1 -1
- package/dist/browser/surfaces/RowGroup.js +82 -0
- package/dist/browser/surfaces/RowGroup.js.map +1 -0
- package/dist/browser/surfaces/Section.js +22 -7
- package/dist/browser/surfaces/Section.js.map +1 -1
- package/dist/browser/surfaces/StatusBadge.js +5 -1
- package/dist/browser/surfaces/StatusBadge.js.map +1 -1
- package/dist/browser/surfaces/flat-block-messages.js +37 -0
- package/dist/browser/surfaces/flat-block-messages.js.map +1 -0
- package/dist/browser/surfaces/index.js +4 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +3 -1
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/DragAndDrop.js +26 -5
- package/dist/ssr/actions/DragAndDrop.js.map +1 -1
- package/dist/ssr/actions/DropOverlay.js +69 -0
- package/dist/ssr/actions/DropOverlay.js.map +1 -0
- package/dist/ssr/actions/Dropdown.js +69 -15
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/SortableList.js +293 -71
- package/dist/ssr/actions/SortableList.js.map +1 -1
- package/dist/ssr/actions/ViewTabs.js +9 -5
- package/dist/ssr/actions/ViewTabs.js.map +1 -1
- package/dist/ssr/actions/drag-and-drop-keyboard.js +211 -0
- package/dist/ssr/actions/drag-and-drop-keyboard.js.map +1 -0
- package/dist/ssr/actions/drag-and-drop-messages.js +21 -25
- package/dist/ssr/actions/drag-and-drop-messages.js.map +1 -1
- package/dist/ssr/actions/drag-and-drop.js +206 -184
- package/dist/ssr/actions/drag-and-drop.js.map +1 -1
- package/dist/ssr/actions/drop-overlay-pages.js +54 -0
- package/dist/ssr/actions/drop-overlay-pages.js.map +1 -0
- package/dist/ssr/actions/drop-overlay-view.js +225 -0
- package/dist/ssr/actions/drop-overlay-view.js.map +1 -0
- package/dist/ssr/actions/index.js +4 -2
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/menu-sheet-messages.js +26 -0
- package/dist/ssr/actions/menu-sheet-messages.js.map +1 -0
- package/dist/ssr/actions/menu-sheet.js +62 -10
- package/dist/ssr/actions/menu-sheet.js.map +1 -1
- package/dist/ssr/actions/menu-submenu-panel.js +295 -0
- package/dist/ssr/actions/menu-submenu-panel.js.map +1 -0
- package/dist/ssr/actions/preload-when-idle.js +15 -0
- package/dist/ssr/actions/preload-when-idle.js.map +1 -0
- package/dist/ssr/actions/sortable-board.js +107 -0
- package/dist/ssr/actions/sortable-board.js.map +1 -0
- package/dist/ssr/actions/sortable-keyboard.js +202 -0
- package/dist/ssr/actions/sortable-keyboard.js.map +1 -0
- package/dist/ssr/actions/sortable-list-messages.js +23 -11
- package/dist/ssr/actions/sortable-list-messages.js.map +1 -1
- package/dist/ssr/actions/sortable-place.js +26 -0
- package/dist/ssr/actions/sortable-place.js.map +1 -0
- package/dist/ssr/chat/ChatDecision.js +256 -228
- package/dist/ssr/chat/ChatDecision.js.map +1 -1
- package/dist/ssr/chat/ChatDecisionField.js +206 -0
- package/dist/ssr/chat/ChatDecisionField.js.map +1 -0
- package/dist/ssr/chat/index.js +2 -0
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/chat/types.js.map +1 -1
- package/dist/ssr/chat-decision-field.js +6 -0
- package/dist/ssr/chat-decision-field.js.map +1 -0
- package/dist/ssr/content/DataTable.js +93 -50
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/FileName.js +46 -0
- package/dist/ssr/content/FileName.js.map +1 -0
- package/dist/ssr/content/ProgressPath.js +14 -8
- package/dist/ssr/content/ProgressPath.js.map +1 -1
- package/dist/ssr/content/TaskRow.js +95 -0
- package/dist/ssr/content/TaskRow.js.map +1 -0
- package/dist/ssr/content/index.js +2 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/progress-path-messages.js +22 -0
- package/dist/ssr/content/progress-path-messages.js.map +1 -0
- package/dist/ssr/feedback/dialog-core.js +68 -11
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/feedback/dialog-foot.js +45 -0
- package/dist/ssr/feedback/dialog-foot.js.map +1 -0
- package/dist/ssr/inputs/DatePicker.js +94 -263
- package/dist/ssr/inputs/DatePicker.js.map +1 -1
- package/dist/ssr/inputs/FileInputs.js +1 -1
- package/dist/ssr/inputs/FileInputs.js.map +1 -1
- package/dist/ssr/inputs/NumberInput.js +114 -44
- package/dist/ssr/inputs/NumberInput.js.map +1 -1
- package/dist/ssr/inputs/PeriodPicker.js +9 -4
- package/dist/ssr/inputs/PeriodPicker.js.map +1 -1
- package/dist/ssr/inputs/TextInput.js +3 -3
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/inputs/date-picker-panel.js +233 -0
- package/dist/ssr/inputs/date-picker-panel.js.map +1 -0
- package/dist/ssr/inputs/image-crop.js +1 -1
- package/dist/ssr/inputs/image-crop.js.map +1 -1
- package/dist/ssr/inputs/image-tools.js +4 -0
- package/dist/ssr/inputs/image-tools.js.map +1 -0
- package/dist/ssr/inputs/input-messages.js +8 -2
- package/dist/ssr/inputs/input-messages.js.map +1 -1
- package/dist/ssr/internal/field.js +2 -2
- package/dist/ssr/internal/field.js.map +1 -1
- package/dist/ssr/internal/renders-something.js +3 -0
- package/dist/ssr/internal/renders-something.js.map +1 -0
- package/dist/ssr/intl/messages.js +1 -1
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +16 -8
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/Breadcrumbs.js +140 -26
- package/dist/ssr/layout/Breadcrumbs.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +70 -68
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/FloatingPill.js +16 -0
- package/dist/ssr/layout/FloatingPill.js.map +1 -0
- package/dist/ssr/layout/PanelDialog.js +82 -8
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/StatusRow.js +93 -0
- package/dist/ssr/layout/StatusRow.js.map +1 -0
- package/dist/ssr/layout/app-workspace-controller.js +12 -5
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/app-workspace-state.js +2 -2
- package/dist/ssr/layout/app-workspace-state.js.map +1 -1
- package/dist/ssr/layout/index.js +2 -0
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/panel-dialog-error.js +28 -0
- package/dist/ssr/layout/panel-dialog-error.js.map +1 -0
- package/dist/ssr/layout/panel-sheet-handle.js +66 -0
- package/dist/ssr/layout/panel-sheet-handle.js.map +1 -0
- package/dist/ssr/layout/workspace-messages.js +12 -2
- package/dist/ssr/layout/workspace-messages.js.map +1 -1
- package/dist/ssr/layout-check.js +232 -0
- package/dist/ssr/layout-check.js.map +1 -0
- package/dist/ssr/surfaces/Area.js +147 -0
- package/dist/ssr/surfaces/Area.js.map +1 -0
- package/dist/ssr/surfaces/FactGroup.js +106 -0
- package/dist/ssr/surfaces/FactGroup.js.map +1 -0
- package/dist/ssr/surfaces/FieldGrid.js +22 -0
- package/dist/ssr/surfaces/FieldGrid.js.map +1 -0
- package/dist/ssr/surfaces/NoticeCard.js +7 -5
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/surfaces/Placeholder.js +15 -4
- package/dist/ssr/surfaces/Placeholder.js.map +1 -1
- package/dist/ssr/surfaces/RowGroup.js +60 -0
- package/dist/ssr/surfaces/RowGroup.js.map +1 -0
- package/dist/ssr/surfaces/Section.js +7 -4
- package/dist/ssr/surfaces/Section.js.map +1 -1
- package/dist/ssr/surfaces/StatusBadge.js +5 -1
- package/dist/ssr/surfaces/StatusBadge.js.map +1 -1
- package/dist/ssr/surfaces/flat-block-messages.js +37 -0
- package/dist/ssr/surfaces/flat-block-messages.js.map +1 -0
- package/dist/ssr/surfaces/index.js +4 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/DragAndDrop.d.ts +17 -2
- package/dist/types/actions/DropOverlay.d.ts +46 -0
- package/dist/types/actions/Dropdown.d.ts +35 -1
- package/dist/types/actions/SortableList.d.ts +36 -6
- package/dist/types/actions/ViewTabs.d.ts +3 -2
- package/dist/types/actions/drag-and-drop-keyboard.d.ts +4 -0
- package/dist/types/actions/drag-and-drop-messages.d.ts +8 -10
- package/dist/types/actions/drag-and-drop.d.ts +62 -4
- package/dist/types/actions/drop-overlay-pages.d.ts +22 -0
- package/dist/types/actions/drop-overlay-view.d.ts +12 -0
- package/dist/types/actions/index.d.ts +9 -5
- package/dist/types/actions/menu-sheet-messages.d.ts +11 -0
- package/dist/types/actions/menu-sheet.d.ts +3 -1
- package/dist/types/actions/menu-submenu-panel.d.ts +27 -0
- package/dist/types/actions/preload-when-idle.d.ts +5 -0
- package/dist/types/actions/sortable-board.d.ts +69 -0
- package/dist/types/actions/sortable-keyboard.d.ts +7 -0
- package/dist/types/actions/sortable-list-messages.d.ts +10 -3
- package/dist/types/actions/sortable-place.d.ts +16 -0
- package/dist/types/chat/ChatDecision.d.ts +28 -4
- package/dist/types/chat/ChatDecisionField.d.ts +45 -0
- package/dist/types/chat/index.d.ts +1 -0
- package/dist/types/chat/types.d.ts +9 -0
- package/dist/types/chat-decision-field.d.ts +5 -0
- package/dist/types/content/DataTable.d.ts +19 -0
- package/dist/types/content/FileName.d.ts +23 -0
- package/dist/types/content/ProgressPath.d.ts +12 -6
- package/dist/types/content/TaskRow.d.ts +33 -0
- package/dist/types/content/index.d.ts +2 -0
- package/dist/types/content/progress-path-messages.d.ts +8 -0
- package/dist/types/feedback/dialog-core.d.ts +5 -0
- package/dist/types/feedback/dialog-foot.d.ts +9 -0
- package/dist/types/inputs/DatePicker.d.ts +3 -21
- package/dist/types/inputs/TextInput.d.ts +2 -0
- package/dist/types/inputs/date-picker-panel.d.ts +29 -0
- package/dist/types/inputs/image-tools.d.ts +1 -0
- package/dist/types/inputs/input-messages.d.ts +4 -1
- package/dist/types/internal/renders-something.d.ts +2 -0
- package/dist/types/layout/AppWorkspace.d.ts +10 -2
- package/dist/types/layout/Breadcrumbs.d.ts +10 -5
- package/dist/types/layout/FloatingPill.d.ts +20 -0
- package/dist/types/layout/PanelDialog.d.ts +19 -0
- package/dist/types/layout/StatusRow.d.ts +54 -0
- package/dist/types/layout/app-workspace-state.d.ts +2 -2
- package/dist/types/layout/index.d.ts +5 -1
- package/dist/types/layout/panel-dialog-error.d.ts +9 -0
- package/dist/types/layout/panel-sheet-handle.d.ts +8 -0
- package/dist/types/layout/workspace-messages.d.ts +5 -0
- package/dist/types/layout-check.d.ts +52 -0
- package/dist/types/surfaces/Area.d.ts +38 -0
- package/dist/types/surfaces/FactGroup.d.ts +33 -0
- package/dist/types/surfaces/FieldGrid.d.ts +14 -0
- package/dist/types/surfaces/NoticeCard.d.ts +6 -4
- package/dist/types/surfaces/Placeholder.d.ts +7 -0
- package/dist/types/surfaces/RowGroup.d.ts +20 -0
- package/dist/types/surfaces/Section.d.ts +8 -2
- package/dist/types/surfaces/StatusBadge.d.ts +2 -1
- package/dist/types/surfaces/flat-block-messages.d.ts +16 -0
- package/dist/types/surfaces/index.d.ts +9 -1
- package/package.json +13 -2
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ssrElement as _$ssrElement } from "solid-js/web";
|
|
2
|
+
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
3
|
+
import { ssr as _$ssr } from "solid-js/web";
|
|
4
|
+
import { escape as _$escape } from "solid-js/web";
|
|
5
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
6
|
+
var _tmpl$ = ["<span class=\"k2b-row-group__count\">", "</span>"],
|
|
7
|
+
_tmpl$2 = ["<span class=\"k2b-row-group__action\">", "</span>"],
|
|
8
|
+
_tmpl$3 = ["<div class=\"k2b-row-group__head\">", "", "", "</div>"],
|
|
9
|
+
_tmpl$4 = ["<div class=\"k2b-row-group__rows k2b-divided\">", "</div>"];
|
|
10
|
+
import { children, createUniqueId, Show, splitProps } from "solid-js";
|
|
11
|
+
import { Dynamic } from "solid-js/web";
|
|
12
|
+
import { rendersSomething } from "../internal/renders-something";
|
|
13
|
+
/**
|
|
14
|
+
* A group (K17 "Gruppe"): a sort word for the rows of one list, such as tasks by status. A 36 px head on the page's
|
|
15
|
+
* quiet ground with the name in 13 px bold, its count, and at most one action; the rows follow as they are. It
|
|
16
|
+
* disappears when it is empty. A group never stands inside an `Area`.
|
|
17
|
+
*/
|
|
18
|
+
export function RowGroup(props) {
|
|
19
|
+
const [local, rest] = splitProps(props, ["title", "count", "action", "children", "level", "class"]);
|
|
20
|
+
const rows = children(() => local.children);
|
|
21
|
+
const titleId = `k2b-row-group-${createUniqueId()}`;
|
|
22
|
+
return _$createComponent(Show, {
|
|
23
|
+
get when() {
|
|
24
|
+
return rendersSomething(rows.toArray());
|
|
25
|
+
},
|
|
26
|
+
get children() {
|
|
27
|
+
return _$ssrElement("section", _$mergeProps(rest, {
|
|
28
|
+
get ["class"]() {
|
|
29
|
+
return local.class ? `k2b-row-group ${local.class}` : "k2b-row-group";
|
|
30
|
+
},
|
|
31
|
+
"aria-labelledby": titleId
|
|
32
|
+
}), [_$ssr(_tmpl$3, _$escape(_$createComponent(Dynamic, {
|
|
33
|
+
get component() {
|
|
34
|
+
return `h${local.level ?? 4}`;
|
|
35
|
+
},
|
|
36
|
+
id: titleId,
|
|
37
|
+
"class": "k2b-row-group__title",
|
|
38
|
+
get children() {
|
|
39
|
+
return local.title;
|
|
40
|
+
}
|
|
41
|
+
})), _$escape(_$createComponent(Show, {
|
|
42
|
+
get when() {
|
|
43
|
+
return local.count !== undefined;
|
|
44
|
+
},
|
|
45
|
+
get children() {
|
|
46
|
+
return _$ssr(_tmpl$, _$escape(local.count));
|
|
47
|
+
}
|
|
48
|
+
})), _$escape(_$createComponent(Show, {
|
|
49
|
+
get when() {
|
|
50
|
+
return local.action;
|
|
51
|
+
},
|
|
52
|
+
get children() {
|
|
53
|
+
return _$ssr(_tmpl$2, _$escape(local.action));
|
|
54
|
+
}
|
|
55
|
+
}))), _$ssr(_tmpl$4, _$escape(rows()))], false);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
export default RowGroup;
|
|
60
|
+
//# sourceMappingURL=RowGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/RowGroup.tsx"],"sourcesContent":["import { children, createUniqueId, type JSX, Show, splitProps } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { rendersSomething } from \"../internal/renders-something\";\n\nexport type RowGroupProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"children\" | \"title\"> & {\n /** The value the rows share, such as a status, a tag, or a person. */\n title: JSX.Element;\n /** How many rows the group holds, after the title. */\n count?: number;\n /** At most one quiet control at the end of the head, such as \"+\". */\n action?: JSX.Element;\n /** The group's rows. A group without rows renders nothing. */\n children?: JSX.Element;\n /** Heading level of the title; defaults to 4. */\n level?: 3 | 4 | 5;\n};\n\n/**\n * A group (K17 \"Gruppe\"): a sort word for the rows of one list, such as tasks by status. A 36 px head on the page's\n * quiet ground with the name in 13 px bold, its count, and at most one action; the rows follow as they are. It\n * disappears when it is empty. A group never stands inside an `Area`.\n */\nexport function RowGroup(props: RowGroupProps): JSX.Element {\n const [local, rest] = splitProps(props, [\"title\", \"count\", \"action\", \"children\", \"level\", \"class\"]);\n const rows = children(() => local.children);\n const titleId = `k2b-row-group-${createUniqueId()}`;\n return (\n <Show when={rendersSomething(rows.toArray())}>\n <section {...rest} class={local.class ? `k2b-row-group ${local.class}` : \"k2b-row-group\"} aria-labelledby={titleId}>\n <div class=\"k2b-row-group__head\">\n <Dynamic component={`h${local.level ?? 4}`} id={titleId} class=\"k2b-row-group__title\">\n {local.title}\n </Dynamic>\n <Show when={local.count !== undefined}>\n <span class=\"k2b-row-group__count\">{local.count}</span>\n </Show>\n <Show when={local.action}>\n <span class=\"k2b-row-group__action\">{local.action}</span>\n </Show>\n </div>\n <div class=\"k2b-row-group__rows k2b-divided\">{rows()}</div>\n </section>\n </Show>\n );\n}\n\nexport default RowGroup;\n"],"mappings":";;;;;;;;;AAAA,SAAS,QAAQ,EAAE,cAAc,EAAY,IAAI,EAAE,UAAU,QAAQ,UAAU;AAC/E,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,gBAAgB,QAAQ,+BAA+B;AAehE;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,QAAQ,CAAC,KAAoB,EAAe;EAC1D,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;EACnG,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,QAAQ,CAAC;EAC3C,MAAM,OAAO,GAAG,iBAAiB,cAAc,CAAC,CAAC,EAAE;EACnD,yBACG,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAAA;IAAA;MAAA,4CAC7B,IAAI;QAAA;UAAA,OAAS,KAAK,CAAC,KAAK,GAAG,iBAAiB,KAAK,CAAC,KAAK,EAAE,GAAG,eAAe;QAAA;QAAA,mBAAmB;MAAO,+CAE7G,OAAO;QAAA,IAAC,SAAS;UAAA,OAAE,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,EAAE;QAAA;QAAE,EAAE,EAAE,OAAO;QAAA;QAAA;UAAA,OACpD,KAAK,CAAC,KAAK;QAAA;MAAA,gCAEb,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,KAAK,KAAK,SAAS;QAAA;QAAA;UAAA,8BACC,KAAK,CAAC,KAAK;QAAA;MAAA,gCAEhD,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,MAAM;QAAA;QAAA;UAAA,+BACe,KAAK,CAAC,MAAM;QAAA;MAAA,8BAGP,IAAI,CAAC,CAAC;IAAA;EAAA;AAI5D;AAEA,eAAe,QAAQ","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ssrElement as _$ssrElement } from "solid-js/web";
|
|
2
2
|
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
3
3
|
import { memo as _$memo } from "solid-js/web";
|
|
4
|
+
import { ssrStyle as _$ssrStyle } from "solid-js/web";
|
|
4
5
|
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
5
6
|
import { ssr as _$ssr } from "solid-js/web";
|
|
6
7
|
import { escape as _$escape } from "solid-js/web";
|
|
@@ -10,7 +11,7 @@ var _tmpl$ = ["<span class=\"k2b-count-chip\">", "</span>"],
|
|
|
10
11
|
_tmpl$3 = ["<span class=\"k2b-section__restricted\"", "><i class=\"ti ti-lock\" aria-hidden=\"true\"></i>", "</span>"],
|
|
11
12
|
_tmpl$4 = ["<span class=\"k2b-section__description\">", "</span>"],
|
|
12
13
|
_tmpl$5 = ["<span class=\"k2b-section__copy\"><span class=\"k2b-section__heading\">", "", "", "", "", "</span>", "</span>"],
|
|
13
|
-
_tmpl$6 = ["<span class=\"k2b-section__icon\" aria-hidden=\"true\"><i", "></i></span>"],
|
|
14
|
+
_tmpl$6 = ["<span class=\"k2b-section__icon\" aria-hidden=\"true\"", " style=\"", "\"><i", "></i></span>"],
|
|
14
15
|
_tmpl$7 = ["<span class=\"k2b-section__none\">", "</span>"],
|
|
15
16
|
_tmpl$8 = ["<button type=\"button\" class=\"k2b-section__toggle\"", "", ">", "<span class=\"k2b-section__chevron\" aria-hidden=\"true\"><i class=\"ti ti-chevron-down\"></i></span></button>"],
|
|
16
17
|
_tmpl$9 = ["<div role=\"status\"><span class=\"k2b-sr-only\">", "</span>", "</div>"],
|
|
@@ -30,7 +31,7 @@ import { Button } from "../actions/Button";
|
|
|
30
31
|
import { useUiMessages } from "../intl/messages";
|
|
31
32
|
import { useDetailPanelMessages } from "../layout/detail-panel-messages";
|
|
32
33
|
|
|
33
|
-
/** Named after the status tokens; a tone colours the
|
|
34
|
+
/** Named after the status tokens; a tone colours the symbol tile only, never the fill or the title (K8, K17). */
|
|
34
35
|
|
|
35
36
|
/** `sm` for detail panels and other narrow columns, `md` for topics on a full page. */
|
|
36
37
|
|
|
@@ -58,7 +59,7 @@ const Heading = props => _$createComponent(Dynamic, {
|
|
|
58
59
|
}
|
|
59
60
|
});
|
|
60
61
|
const SectionRoot = props => {
|
|
61
|
-
const [local, rest] = splitProps(props, ["title", "icon", "size", "frame", "tone", "restricted", "description", "count", "meta", "footer", "state", "errorMessage", "onRetry", "loadingRows", "level", "class", "children", "actions", "collapsible", "summary", "defaultOpen", "open", "onOpenChange", "disabled"]);
|
|
62
|
+
const [local, rest] = splitProps(props, ["title", "icon", "iconColor", "size", "frame", "tone", "restricted", "description", "count", "meta", "footer", "state", "errorMessage", "onRetry", "loadingRows", "level", "class", "children", "actions", "collapsible", "summary", "defaultOpen", "open", "onOpenChange", "disabled"]);
|
|
62
63
|
const ui = useUiMessages();
|
|
63
64
|
const counts = useDetailPanelMessages();
|
|
64
65
|
const frameDefault = useContext(SectionFrameDefault);
|
|
@@ -98,7 +99,9 @@ const SectionRoot = props => {
|
|
|
98
99
|
get when() {
|
|
99
100
|
return local.icon;
|
|
100
101
|
},
|
|
101
|
-
children: name => _$ssr(_tmpl$6, _$ssrAttribute("
|
|
102
|
+
children: name => _$ssr(_tmpl$6, _$ssrAttribute("data-color", local.iconColor ? "" : _$escape(undefined, true), false), _$ssrStyle(local.iconColor ? {
|
|
103
|
+
"--k2b-section-icon-color": local.iconColor
|
|
104
|
+
} : undefined), _$ssrAttribute("class", _$escape(name(), true), false))
|
|
102
105
|
}), _$ssr(_tmpl$5, _$escape(title), _$escape(_$createComponent(Show, {
|
|
103
106
|
get when() {
|
|
104
107
|
return local.count !== undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["surfaces/Section.tsx"],"sourcesContent":["import { children, createContext, createEffect, createSignal, createUniqueId, For, type JSX, Show, splitProps, useContext } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Button } from \"../actions/Button\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { useDetailPanelMessages } from \"../layout/detail-panel-messages\";\n\n/** Named after the status tokens; a tone colours the frame, the title, and the icon, never the fill. */\nexport type SectionTone = \"neutral\" | \"success\" | \"warning\" | \"danger\" | \"info\" | \"ai\";\n/** `sm` for detail panels and other narrow columns, `md` for topics on a full page. */\nexport type SectionSize = \"sm\" | \"md\";\n/** `line` draws the light 1 px frame; inside another frame a section always stands flat. */\nexport type SectionFrame = \"line\" | \"none\";\nexport type SectionState = \"ready\" | \"loading\" | \"error\";\n\ntype SectionBaseProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"title\" | \"children\" | \"class\"> & {\n title: JSX.Element;\n icon?: string;\n size?: SectionSize;\n frame?: SectionFrame;\n tone?: SectionTone;\n /**\n * Marks a section that only some people see, such as \"Only with permission\": a lock and these words after the\n * title. It is part of the section's accessible name and combines with any tone.\n */\n restricted?: string;\n description?: JSX.Element;\n /** How many things the section lists, as a chip after the title; `0` reads \"None yet\". */\n count?: number;\n /** Short state after the title, such as \"2 of 4 done\". */\n meta?: JSX.Element;\n /** Commands for the whole topic, as a row of buttons at the end of the body. */\n footer?: JSX.Element;\n /** `loading` and `error` take the body's place; the heading stays where it is. */\n state?: SectionState;\n /** Says what did not load; defaults to a generic sentence. */\n errorMessage?: JSX.Element;\n /** Shows \"Try again\" in the error state. */\n onRetry?: () => void;\n /** Placeholder rows while loading, the number the loaded body usually shows. Defaults to 3. */\n loadingRows?: number;\n /** Heading level; defaults to 3, or 2 for `size=\"md\"`. */\n level?: 2 | 3;\n class?: string;\n};\n\nexport type SectionProps = SectionBaseProps &\n (\n | {\n children?: JSX.Element;\n /** Exactly one control at the end of the heading, such as \"+\" or one text button. */\n actions?: JSX.Element;\n collapsible?: false;\n summary?: never;\n defaultOpen?: never;\n open?: never;\n onOpenChange?: never;\n disabled?: never;\n }\n | {\n children: JSX.Element;\n actions?: never;\n collapsible: true;\n /** One line that says what the closed section holds, such as its newest entry; hidden while open. */\n summary?: JSX.Element;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n }\n );\n\nexport type SectionPartProps = {\n title: JSX.Element;\n children: JSX.Element;\n class?: string;\n};\n\ntype SectionComponent = ((props: SectionProps) => JSX.Element) & {\n Part: (props: SectionPartProps) => JSX.Element;\n};\n\nconst SectionLevel = createContext<number>(2);\n\n/**\n * The frame a section draws when it passes none. A host that frames its topics itself, such as a detail panel, sets\n * `none`; everywhere else a section is a card.\n */\nexport const SectionFrameDefault = createContext<SectionFrame>(\"line\");\n\nconst Heading = (props: { level: number; id?: string; class: string; children: JSX.Element }): JSX.Element => (\n <Dynamic component={`h${props.level}`} id={props.id} class={props.class}>\n {props.children}\n </Dynamic>\n);\n\nconst SectionRoot = (props: SectionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"title\",\n \"icon\",\n \"size\",\n \"frame\",\n \"tone\",\n \"restricted\",\n \"description\",\n \"count\",\n \"meta\",\n \"footer\",\n \"state\",\n \"errorMessage\",\n \"onRetry\",\n \"loadingRows\",\n \"level\",\n \"class\",\n \"children\",\n \"actions\",\n \"collapsible\",\n \"summary\",\n \"defaultOpen\",\n \"open\",\n \"onOpenChange\",\n \"disabled\",\n ]);\n const ui = useUiMessages();\n const counts = useDetailPanelMessages();\n const frameDefault = useContext(SectionFrameDefault);\n const id = `k2b-section-${createUniqueId()}`;\n const titleId = `${id}-title`;\n const restrictedId = `${id}-restricted`;\n const bodyId = `${id}-body`;\n const level = () => local.level ?? (local.size === \"md\" ? 2 : 3);\n const state = () => local.state ?? \"ready\";\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n const open = () => !local.collapsible || (local.open ?? internalOpen());\n let toggleButton: HTMLButtonElement | undefined;\n let body: HTMLDivElement | undefined;\n\n const toggle = () => {\n if (local.disabled) return;\n const next = !open();\n if (local.open === undefined) setInternalOpen(next);\n local.onOpenChange?.(next);\n };\n // A parent may close the section while focus is inside it; focus then returns to the toggle instead of the page.\n createEffect(() => {\n if (open()) return;\n queueMicrotask(() => {\n const active = body?.ownerDocument.activeElement;\n if (!open() && active && body?.contains(active)) toggleButton?.focus();\n });\n });\n\n // Resolve once and only while ready: reading `children` twice would build the body twice.\n const resolved = children(() => (state() === \"ready\" ? local.children : undefined));\n // A JSX action must also be built once: checking the slot and then reading it again creates different hydration keys.\n const resolvedActions = children(() => local.actions);\n const hasBody = () => local.collapsible || state() !== \"ready\" || Boolean(resolved.toArray().length) || Boolean(local.footer);\n\n /** Icon, then the title with its count, state, and restricted marker in one row, then the description. */\n const headingRow = (title: JSX.Element, summary?: JSX.Element) => (\n <>\n <Show when={local.icon}>\n {(name) => (\n <span class=\"k2b-section__icon\" aria-hidden=\"true\">\n <i class={name()} />\n </span>\n )}\n </Show>\n <span class=\"k2b-section__copy\">\n <span class=\"k2b-section__heading\">\n {title}\n <Show when={local.count !== undefined}>\n <Show when={local.count! > 0} fallback={<span class=\"k2b-section__none\">{counts().noneYet}</span>}>\n <span class=\"k2b-count-chip\">{local.count}</span>\n </Show>\n </Show>\n <Show when={local.meta}>\n <span class=\"k2b-section__meta\">{local.meta}</span>\n </Show>\n <Show when={local.restricted}>\n <span class=\"k2b-section__restricted\" id={restrictedId}>\n <i class=\"ti ti-lock\" aria-hidden=\"true\" />\n {local.restricted}\n </span>\n </Show>\n {summary}\n </span>\n <Show when={local.description}>\n <span class=\"k2b-section__description\">{local.description}</span>\n </Show>\n </span>\n </>\n );\n\n return (\n <section\n {...rest}\n class={local.class ? `k2b-section ${local.class}` : \"k2b-section\"}\n data-size={local.size ?? \"sm\"}\n data-frame={local.frame ?? frameDefault}\n data-tone={local.tone && local.tone !== \"neutral\" ? local.tone : undefined}\n data-icon={local.icon ? \"true\" : undefined}\n data-collapsible={local.collapsible ? \"true\" : undefined}\n data-open={local.collapsible ? String(open()) : undefined}\n data-summary={local.collapsible && local.summary ? \"true\" : undefined}\n aria-labelledby={local.restricted ? `${titleId} ${restrictedId}` : titleId}\n aria-busy={state() === \"loading\" ? \"true\" : undefined}\n >\n <Show\n when={local.collapsible}\n fallback={\n <header class=\"k2b-section__header\">\n {headingRow(\n <Heading level={level()} id={titleId} class=\"k2b-section__title\">\n {local.title}\n </Heading>,\n )}\n <Show when={resolvedActions()}>\n <div class=\"k2b-section__actions\">{resolvedActions()}</div>\n </Show>\n </header>\n }\n >\n {/* The whole heading row is one disclosure button inside the heading, so the region keeps its name. */}\n <Heading level={level()} class=\"k2b-section__header\">\n <button\n ref={toggleButton}\n type=\"button\"\n class=\"k2b-section__toggle\"\n aria-expanded={open()}\n aria-controls={bodyId}\n disabled={local.disabled}\n // A native listener, not Solid's delegated `onClick`: delegation is registered once per document when\n // this module loads, so a section rendered into a later document (a test harness, an iframe) would\n // never toggle. The shared Button registers its delegation at render time and has no such gap.\n on:click={toggle}\n >\n {headingRow(\n <span id={titleId} class=\"k2b-section__title\">\n {local.title}\n </span>,\n <Show when={local.summary}>\n <span class=\"k2b-section__summary k2b-truncate-fade\">{local.summary}</span>\n </Show>,\n )}\n <span class=\"k2b-section__chevron\" aria-hidden=\"true\">\n <i class=\"ti ti-chevron-down\" />\n </span>\n </button>\n </Heading>\n </Show>\n <Show when={hasBody()}>\n <div ref={body} id={bodyId} class=\"k2b-section__body\" hidden={!open()}>\n <Show when={state() === \"loading\"}>\n {/* Placeholder rows at the height of loaded rows; their widths vary in CSS. */}\n <div role=\"status\">\n <span class=\"k2b-sr-only\">{ui().loading}</span>\n <For each={Array.from({ length: Math.max(1, local.loadingRows ?? 3) })}>\n {() => (\n <div class=\"k2b-section__skeleton-row\" aria-hidden=\"true\">\n <span />\n <span />\n </div>\n )}\n </For>\n </div>\n </Show>\n <Show when={state() === \"error\"}>\n <div class=\"k2b-section__error\" role=\"alert\">\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{local.errorMessage ?? ui().couldNotLoadData}</span>\n </div>\n <Show when={local.onRetry}>\n {(retry) => (\n <div class=\"k2b-section__footer\">\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" onClick={() => retry()()}>\n <i class=\"ti ti-refresh\" aria-hidden=\"true\" />\n {ui().retry}\n </Button>\n </div>\n )}\n </Show>\n </Show>\n {resolved()}\n <Show when={state() === \"ready\" && local.footer}>\n <div class=\"k2b-section__footer\">{local.footer}</div>\n </Show>\n </div>\n </Show>\n </section>\n );\n};\n\n/** A sub-topic inside a section, such as \"Contact\" or \"Address\": a small heading, no frame of its own. */\nconst SectionPart = (props: SectionPartProps): JSX.Element => {\n const level = useContext(SectionLevel);\n const id = `k2b-section-part-${createUniqueId()}`;\n return (\n <div class={props.class ? `k2b-section__part ${props.class}` : \"k2b-section__part\"} role=\"group\" aria-labelledby={id}>\n <Heading level={Math.min(level + 1, 6)} id={id} class=\"k2b-section__part-title\">\n {props.title}\n </Heading>\n {props.children}\n </div>\n );\n};\n\n/**\n * One topic, in a detail panel or on a page: an icon, a title with its count, at most one control, and its\n * content. On a page a section is a card with the light 1 px frame; inside another frame, and in a detail panel, it\n * stands flat, so cards never nest.\n */\nconst SectionWithLevel = (props: SectionProps): JSX.Element => (\n // The level is provided before the body is built, so a part's heading sits one level below this section's.\n <SectionLevel.Provider value={props.level ?? (props.size === \"md\" ? 2 : 3)}>\n <SectionRoot {...props} />\n </SectionLevel.Provider>\n);\n\nexport const Section = SectionWithLevel as SectionComponent;\nSection.Part = SectionPart;\n\nexport default Section;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,EAAE,UAAU,QAAQ,UAAU;AAC3I,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,sBAAsB,QAAQ,iCAAiC;;AAExE;;AAEA;;AAEA;;AAuEA,MAAM,YAAY,GAAG,aAAa,CAAS,CAAC,CAAC;;AAE7C;AACA;AACA;AACA;AACA,OAAO,MAAM,mBAAmB,GAAG,aAAa,CAAe,MAAM,CAAC;AAEtE,MAAM,OAAO,GAAI,KAA2E,sBACzF,OAAO;EAAA,IAAC,SAAS;IAAA,OAAE,IAAI,KAAK,CAAC,KAAK,EAAE;EAAA;EAAA,IAAE,EAAE;IAAA,OAAE,KAAK,CAAC,EAAE;EAAA;EAAA;IAAA,OAAS,KAAK,CAAC,KAAK;EAAA;EAAA;IAAA,OACpE,KAAK,CAAC,QAAQ;EAAA;AAAA,EAElB;AAED,MAAM,WAAW,GAAI,KAAmB,IAAkB;EACxD,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CACtC,OAAO,EACP,MAAM,EACN,MAAM,EACN,OAAO,EACP,MAAM,EACN,YAAY,EACZ,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,cAAc,EACd,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS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
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/Section.tsx"],"sourcesContent":["import { children, createContext, createEffect, createSignal, createUniqueId, For, type JSX, Show, splitProps, useContext } from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { Button } from \"../actions/Button\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { useDetailPanelMessages } from \"../layout/detail-panel-messages\";\n\n/** Named after the status tokens; a tone colours the symbol tile only, never the fill or the title (K8, K17). */\nexport type SectionTone = \"neutral\" | \"success\" | \"warning\" | \"danger\" | \"info\" | \"ai\";\n/** `sm` for detail panels and other narrow columns, `md` for topics on a full page. */\nexport type SectionSize = \"sm\" | \"md\";\n/** `line` draws the light 1 px frame; inside another frame a section always stands flat. */\nexport type SectionFrame = \"line\" | \"none\";\nexport type SectionState = \"ready\" | \"loading\" | \"error\";\n\ntype SectionBaseProps = Omit<JSX.HTMLAttributes<HTMLElement>, \"title\" | \"children\" | \"class\"> & {\n title: JSX.Element;\n icon?: string;\n /**\n * The colour of the section's area as a CSS colour, such as money or goods on a dense record page (K17). It sets the\n * icon in a 20 px tile of that colour, the one place the area colour shows. Never a status hue, never near the AI\n * plum; a `tone` wins.\n */\n iconColor?: string;\n size?: SectionSize;\n frame?: SectionFrame;\n tone?: SectionTone;\n /**\n * Marks a section that only some people see, such as \"Only with permission\": a lock and these words after the\n * title. It is part of the section's accessible name and combines with any tone.\n */\n restricted?: string;\n description?: JSX.Element;\n /** How many things the section lists, as a chip after the title; `0` reads \"None yet\". */\n count?: number;\n /** Short state after the title, such as \"2 of 4 done\". */\n meta?: JSX.Element;\n /** Commands for the whole topic, as a row of buttons at the end of the body. */\n footer?: JSX.Element;\n /** `loading` and `error` take the body's place; the heading stays where it is. */\n state?: SectionState;\n /** Says what did not load; defaults to a generic sentence. */\n errorMessage?: JSX.Element;\n /** Shows \"Try again\" in the error state. */\n onRetry?: () => void;\n /** Placeholder rows while loading, the number the loaded body usually shows. Defaults to 3. */\n loadingRows?: number;\n /** Heading level; defaults to 3, or 2 for `size=\"md\"`. */\n level?: 2 | 3;\n class?: string;\n};\n\nexport type SectionProps = SectionBaseProps &\n (\n | {\n children?: JSX.Element;\n /** At most two quiet controls at the end of the heading, such as \"+\" or text buttons; they read grey. */\n actions?: JSX.Element;\n collapsible?: false;\n summary?: never;\n defaultOpen?: never;\n open?: never;\n onOpenChange?: never;\n disabled?: never;\n }\n | {\n children: JSX.Element;\n actions?: never;\n collapsible: true;\n /** One line that says what the closed section holds, such as its newest entry; hidden while open. */\n summary?: JSX.Element;\n defaultOpen?: boolean;\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n disabled?: boolean;\n }\n );\n\nexport type SectionPartProps = {\n title: JSX.Element;\n children: JSX.Element;\n class?: string;\n};\n\ntype SectionComponent = ((props: SectionProps) => JSX.Element) & {\n Part: (props: SectionPartProps) => JSX.Element;\n};\n\nconst SectionLevel = createContext<number>(2);\n\n/**\n * The frame a section draws when it passes none. A host that frames its topics itself, such as a detail panel, sets\n * `none`; everywhere else a section is a card.\n */\nexport const SectionFrameDefault = createContext<SectionFrame>(\"line\");\n\nconst Heading = (props: { level: number; id?: string; class: string; children: JSX.Element }): JSX.Element => (\n <Dynamic component={`h${props.level}`} id={props.id} class={props.class}>\n {props.children}\n </Dynamic>\n);\n\nconst SectionRoot = (props: SectionProps): JSX.Element => {\n const [local, rest] = splitProps(props, [\n \"title\",\n \"icon\",\n \"iconColor\",\n \"size\",\n \"frame\",\n \"tone\",\n \"restricted\",\n \"description\",\n \"count\",\n \"meta\",\n \"footer\",\n \"state\",\n \"errorMessage\",\n \"onRetry\",\n \"loadingRows\",\n \"level\",\n \"class\",\n \"children\",\n \"actions\",\n \"collapsible\",\n \"summary\",\n \"defaultOpen\",\n \"open\",\n \"onOpenChange\",\n \"disabled\",\n ]);\n const ui = useUiMessages();\n const counts = useDetailPanelMessages();\n const frameDefault = useContext(SectionFrameDefault);\n const id = `k2b-section-${createUniqueId()}`;\n const titleId = `${id}-title`;\n const restrictedId = `${id}-restricted`;\n const bodyId = `${id}-body`;\n const level = () => local.level ?? (local.size === \"md\" ? 2 : 3);\n const state = () => local.state ?? \"ready\";\n const [internalOpen, setInternalOpen] = createSignal(local.defaultOpen ?? false);\n const open = () => !local.collapsible || (local.open ?? internalOpen());\n let toggleButton: HTMLButtonElement | undefined;\n let body: HTMLDivElement | undefined;\n\n const toggle = () => {\n if (local.disabled) return;\n const next = !open();\n if (local.open === undefined) setInternalOpen(next);\n local.onOpenChange?.(next);\n };\n // A parent may close the section while focus is inside it; focus then returns to the toggle instead of the page.\n createEffect(() => {\n if (open()) return;\n queueMicrotask(() => {\n const active = body?.ownerDocument.activeElement;\n if (!open() && active && body?.contains(active)) toggleButton?.focus();\n });\n });\n\n // Resolve once and only while ready: reading `children` twice would build the body twice.\n const resolved = children(() => (state() === \"ready\" ? local.children : undefined));\n // A JSX action must also be built once: checking the slot and then reading it again creates different hydration keys.\n const resolvedActions = children(() => local.actions);\n const hasBody = () => local.collapsible || state() !== \"ready\" || Boolean(resolved.toArray().length) || Boolean(local.footer);\n\n /** Icon, then the title with its count, state, and restricted marker in one row, then the description. */\n const headingRow = (title: JSX.Element, summary?: JSX.Element) => (\n <>\n <Show when={local.icon}>\n {(name) => (\n <span\n class=\"k2b-section__icon\"\n aria-hidden=\"true\"\n data-color={local.iconColor ? \"\" : undefined}\n style={local.iconColor ? { \"--k2b-section-icon-color\": local.iconColor } : undefined}\n >\n <i class={name()} />\n </span>\n )}\n </Show>\n <span class=\"k2b-section__copy\">\n <span class=\"k2b-section__heading\">\n {title}\n <Show when={local.count !== undefined}>\n <Show when={local.count! > 0} fallback={<span class=\"k2b-section__none\">{counts().noneYet}</span>}>\n <span class=\"k2b-count-chip\">{local.count}</span>\n </Show>\n </Show>\n <Show when={local.meta}>\n <span class=\"k2b-section__meta\">{local.meta}</span>\n </Show>\n <Show when={local.restricted}>\n <span class=\"k2b-section__restricted\" id={restrictedId}>\n <i class=\"ti ti-lock\" aria-hidden=\"true\" />\n {local.restricted}\n </span>\n </Show>\n {summary}\n </span>\n <Show when={local.description}>\n <span class=\"k2b-section__description\">{local.description}</span>\n </Show>\n </span>\n </>\n );\n\n return (\n <section\n {...rest}\n class={local.class ? `k2b-section ${local.class}` : \"k2b-section\"}\n data-size={local.size ?? \"sm\"}\n data-frame={local.frame ?? frameDefault}\n data-tone={local.tone && local.tone !== \"neutral\" ? local.tone : undefined}\n data-icon={local.icon ? \"true\" : undefined}\n data-collapsible={local.collapsible ? \"true\" : undefined}\n data-open={local.collapsible ? String(open()) : undefined}\n data-summary={local.collapsible && local.summary ? \"true\" : undefined}\n aria-labelledby={local.restricted ? `${titleId} ${restrictedId}` : titleId}\n aria-busy={state() === \"loading\" ? \"true\" : undefined}\n >\n <Show\n when={local.collapsible}\n fallback={\n <header class=\"k2b-section__header\">\n {headingRow(\n <Heading level={level()} id={titleId} class=\"k2b-section__title\">\n {local.title}\n </Heading>,\n )}\n <Show when={resolvedActions()}>\n <div class=\"k2b-section__actions\">{resolvedActions()}</div>\n </Show>\n </header>\n }\n >\n {/* The whole heading row is one disclosure button inside the heading, so the region keeps its name. */}\n <Heading level={level()} class=\"k2b-section__header\">\n <button\n ref={toggleButton}\n type=\"button\"\n class=\"k2b-section__toggle\"\n aria-expanded={open()}\n aria-controls={bodyId}\n disabled={local.disabled}\n // A native listener, not Solid's delegated `onClick`: delegation is registered once per document when\n // this module loads, so a section rendered into a later document (a test harness, an iframe) would\n // never toggle. The shared Button registers its delegation at render time and has no such gap.\n on:click={toggle}\n >\n {headingRow(\n <span id={titleId} class=\"k2b-section__title\">\n {local.title}\n </span>,\n <Show when={local.summary}>\n <span class=\"k2b-section__summary k2b-truncate-fade\">{local.summary}</span>\n </Show>,\n )}\n <span class=\"k2b-section__chevron\" aria-hidden=\"true\">\n <i class=\"ti ti-chevron-down\" />\n </span>\n </button>\n </Heading>\n </Show>\n <Show when={hasBody()}>\n <div ref={body} id={bodyId} class=\"k2b-section__body\" hidden={!open()}>\n <Show when={state() === \"loading\"}>\n {/* Placeholder rows at the height of loaded rows; their widths vary in CSS. */}\n <div role=\"status\">\n <span class=\"k2b-sr-only\">{ui().loading}</span>\n <For each={Array.from({ length: Math.max(1, local.loadingRows ?? 3) })}>\n {() => (\n <div class=\"k2b-section__skeleton-row\" aria-hidden=\"true\">\n <span />\n <span />\n </div>\n )}\n </For>\n </div>\n </Show>\n <Show when={state() === \"error\"}>\n <div class=\"k2b-section__error\" role=\"alert\">\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{local.errorMessage ?? ui().couldNotLoadData}</span>\n </div>\n <Show when={local.onRetry}>\n {(retry) => (\n <div class=\"k2b-section__footer\">\n <Button type=\"button\" size=\"sm\" variant=\"secondary\" onClick={() => retry()()}>\n <i class=\"ti ti-refresh\" aria-hidden=\"true\" />\n {ui().retry}\n </Button>\n </div>\n )}\n </Show>\n </Show>\n {resolved()}\n <Show when={state() === \"ready\" && local.footer}>\n <div class=\"k2b-section__footer\">{local.footer}</div>\n </Show>\n </div>\n </Show>\n </section>\n );\n};\n\n/** A sub-topic inside a section, such as \"Contact\" or \"Address\": a small heading, no frame of its own. */\nconst SectionPart = (props: SectionPartProps): JSX.Element => {\n const level = useContext(SectionLevel);\n const id = `k2b-section-part-${createUniqueId()}`;\n return (\n <div class={props.class ? `k2b-section__part ${props.class}` : \"k2b-section__part\"} role=\"group\" aria-labelledby={id}>\n <Heading level={Math.min(level + 1, 6)} id={id} class=\"k2b-section__part-title\">\n {props.title}\n </Heading>\n {props.children}\n </div>\n );\n};\n\n/**\n * One topic, in a detail panel or on a page: an icon, a title with its count, at most one control, and its\n * content. On a page a section is a card with the light 1 px frame; inside another frame, and in a detail panel, it\n * stands flat, so cards never nest.\n */\nconst SectionWithLevel = (props: SectionProps): JSX.Element => (\n // The level is provided before the body is built, so a part's heading sits one level below this section's.\n <SectionLevel.Provider value={props.level ?? (props.size === \"md\" ? 2 : 3)}>\n <SectionRoot {...props} />\n </SectionLevel.Provider>\n);\n\nexport const Section = SectionWithLevel as SectionComponent;\nSection.Part = SectionPart;\n\nexport default Section;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,IAAI,EAAE,UAAU,EAAE,UAAU,QAAQ,UAAU;AAC3I,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,MAAM,QAAQ,mBAAmB;AAC1C,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,sBAAsB,QAAQ,iCAAiC;;AAExE;;AAEA;;AAEA;;AA6EA,MAAM,YAAY,GAAG,aAAa,CAAS,CAAC,CAAC;;AAE7C;AACA;AACA;AACA;AACA,OAAO,MAAM,mBAAmB,GAAG,aAAa,CAAe,MAAM,CAAC;AAEtE,MAAM,OAAO,GAAI,KAA2E,sBACzF,OAAO;EAAA,IAAC,SAAS;IAAA,OAAE,IAAI,KAAK,CAAC,KAAK,EAAE;EAAA;EAAA,IAAE,EAAE;IAAA,OAAE,KAAK,CAAC,EAAE;EAAA;EAAA;IAAA,OAAS,KAAK,CAAC,KAAK;EAAA;EAAA;IAAA,OACpE,KAAK,CAAC,QAAQ;EAAA;AAAA,EAElB;AAED,MAAM,WAAW,GAAI,KAAmB,IAAkB;EACxD,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE,CACtC,OAAO,EACP,MAAM,EACN,WAAW,EACX,MAAM,EACN,OAAO,EACP,MAAM,EACN,YAAY,EACZ,aAAa,EACb,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,cAAc,EACd,SAAS,EACT,aAAa,EACb,OAAO,EACP,OAAO,EACP,UAAU,EACV,SAAS,EACT,aAAa,EACb,SAAS,EACT,aAAa,EACb,MAAM,EACN,cAAc,EACd,UAAU,CACX,CAAC;EACF,MAAM,EAAE,GAAG,aAAa,CAAC,CAAC;EAC1B,MAAM,MA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[]}
|
|
@@ -9,6 +9,9 @@ var _tmpl$ = ["<span class=\"k2b-status-badge__label\" data-reserve><span>", "</
|
|
|
9
9
|
_tmpl$5 = ["<span class=\"k2b-status-badge__label\">", "</span>"],
|
|
10
10
|
_tmpl$6 = ["<span aria-hidden=\"true\">", "</span>"];
|
|
11
11
|
import { For, Show } from "solid-js";
|
|
12
|
+
|
|
13
|
+
/** `yours` is "your turn": the blue tint of an action that waits for the reader; amber `warning` is "to clarify". */
|
|
14
|
+
|
|
12
15
|
const DEFAULT_ICONS = {
|
|
13
16
|
info: "ti ti-info-circle",
|
|
14
17
|
ok: "ti ti-check",
|
|
@@ -16,7 +19,8 @@ const DEFAULT_ICONS = {
|
|
|
16
19
|
error: "ti ti-alert-circle",
|
|
17
20
|
degraded: "ti ti-plug-connected-x",
|
|
18
21
|
running: "ti ti-loader-2",
|
|
19
|
-
neutral: "ti ti-alert-square-rounded"
|
|
22
|
+
neutral: "ti ti-alert-square-rounded",
|
|
23
|
+
yours: "ti ti-arrow-right"
|
|
20
24
|
};
|
|
21
25
|
export function StatusBadge(props) {
|
|
22
26
|
const variant = () => props.variant ?? "chip";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["surfaces/StatusBadge.tsx"],"sourcesContent":["import { For, type JSX, Show } from \"solid-js\";\n\nexport type StatusTone = \"info\" | \"ok\" | \"warning\" | \"error\" | \"degraded\" | \"running\" | \"neutral\";\n\nexport type StatusBadgeProps = {\n tone: StatusTone;\n label: JSX.Element;\n icon?: string | null;\n variant?: \"chip\" | \"dot\" | \"text\";\n /**\n * Every label this place can show, such as all states of a list's status. The badge keeps the width of the longest,\n * so in a right-aligned slot its dot starts at one x in every row and stays put when the state changes.\n */\n labels?: readonly string[];\n title?: string;\n class?: string;\n};\n\nconst DEFAULT_ICONS: Record<StatusTone, string> = {\n info: \"ti ti-info-circle\",\n ok: \"ti ti-check\",\n warning: \"ti ti-alert-triangle\",\n error: \"ti ti-alert-circle\",\n degraded: \"ti ti-plug-connected-x\",\n running: \"ti ti-loader-2\",\n neutral: \"ti ti-alert-square-rounded\",\n};\n\nexport function StatusBadge(props: StatusBadgeProps): JSX.Element {\n const variant = () => props.variant ?? \"chip\";\n const icon = () => (props.icon === null ? undefined : (props.icon ?? DEFAULT_ICONS[props.tone]));\n return (\n <span class={`k2b-status-badge ${props.class ?? \"\"}`} data-tone={props.tone} data-variant={variant()} title={props.title}>\n <Show when={variant() !== \"dot\"} fallback={<span class=\"k2b-status-badge__dot\" aria-hidden=\"true\" />}>\n <Show when={icon()}>{(glyph) => <i class={glyph()} aria-hidden=\"true\" />}</Show>\n </Show>\n <Show when={props.labels?.length} fallback={<span class=\"k2b-status-badge__label\">{props.label}</span>}>\n <span class=\"k2b-status-badge__label\" data-reserve=\"\">\n <span>{props.label}</span>\n <For each={props.labels}>{(label) => <span aria-hidden=\"true\">{label}</span>}</For>\n </span>\n </Show>\n </span>\n );\n}\n\nexport default StatusBadge;\n"],"mappings":";;;;;;;;;;AAAA,SAAS,GAAG,EAAY,IAAI,QAAQ,UAAU
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/StatusBadge.tsx"],"sourcesContent":["import { For, type JSX, Show } from \"solid-js\";\n\n/** `yours` is \"your turn\": the blue tint of an action that waits for the reader; amber `warning` is \"to clarify\". */\nexport type StatusTone = \"info\" | \"ok\" | \"warning\" | \"error\" | \"degraded\" | \"running\" | \"neutral\" | \"yours\";\n\nexport type StatusBadgeProps = {\n tone: StatusTone;\n label: JSX.Element;\n icon?: string | null;\n variant?: \"chip\" | \"dot\" | \"text\";\n /**\n * Every label this place can show, such as all states of a list's status. The badge keeps the width of the longest,\n * so in a right-aligned slot its dot starts at one x in every row and stays put when the state changes.\n */\n labels?: readonly string[];\n title?: string;\n class?: string;\n};\n\nconst DEFAULT_ICONS: Record<StatusTone, string> = {\n info: \"ti ti-info-circle\",\n ok: \"ti ti-check\",\n warning: \"ti ti-alert-triangle\",\n error: \"ti ti-alert-circle\",\n degraded: \"ti ti-plug-connected-x\",\n running: \"ti ti-loader-2\",\n neutral: \"ti ti-alert-square-rounded\",\n yours: \"ti ti-arrow-right\",\n};\n\nexport function StatusBadge(props: StatusBadgeProps): JSX.Element {\n const variant = () => props.variant ?? \"chip\";\n const icon = () => (props.icon === null ? undefined : (props.icon ?? DEFAULT_ICONS[props.tone]));\n return (\n <span class={`k2b-status-badge ${props.class ?? \"\"}`} data-tone={props.tone} data-variant={variant()} title={props.title}>\n <Show when={variant() !== \"dot\"} fallback={<span class=\"k2b-status-badge__dot\" aria-hidden=\"true\" />}>\n <Show when={icon()}>{(glyph) => <i class={glyph()} aria-hidden=\"true\" />}</Show>\n </Show>\n <Show when={props.labels?.length} fallback={<span class=\"k2b-status-badge__label\">{props.label}</span>}>\n <span class=\"k2b-status-badge__label\" data-reserve=\"\">\n <span>{props.label}</span>\n <For each={props.labels}>{(label) => <span aria-hidden=\"true\">{label}</span>}</For>\n </span>\n </Show>\n </span>\n );\n}\n\nexport default StatusBadge;\n"],"mappings":";;;;;;;;;;AAAA,SAAS,GAAG,EAAY,IAAI,QAAQ,UAAU;;AAE9C;;AAiBA,MAAM,aAAyC,GAAG;EAChD,IAAI,EAAE,mBAAmB;EACzB,EAAE,EAAE,aAAa;EACjB,OAAO,EAAE,sBAAsB;EAC/B,KAAK,EAAE,oBAAoB;EAC3B,QAAQ,EAAE,wBAAwB;EAClC,OAAO,EAAE,gBAAgB;EACzB,OAAO,EAAE,4BAA4B;EACrC,KAAK,EAAE;AACT,CAAC;AAED,OAAO,SAAS,WAAW,CAAC,KAAuB,EAAe;EAChE,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,IAAI,MAAM;EAC7C,MAAM,IAAI,GAAG,MAAO,KAAK,CAAC,IAAI,KAAK,IAAI,GAAG,SAAS,GAAI,KAAK,CAAC,IAAI,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,CAAG;EAChG,sBACe,6BAAoB,KAAK,CAAC,KAAK,IAAI,EAAE,SAAE,uCAAa,KAAK,CAAC,IAAI,0DAAgB,OAAO,CAAC,CAAC,mDAAS,KAAK,CAAC,KAAK,4CACrH,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,OAAO,CAAC,CAAC,KAAK,KAAK;IAAA;IAAA,IAAE,QAAQ;MAAA;IAAA;IAAA;MAAA,yBACtC,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,IAAI,CAAC,CAAC;QAAA;QAAA,UAAI,KAAK,oDAAe,KAAK,CAAC,CAAC;MAAuB;IAAA;EAAA,gCAEzE,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,MAAM,EAAE,MAAM;IAAA;IAAA,IAAE,QAAQ;MAAA,+BAAyC,KAAK,CAAC,KAAK;IAAA;IAAA;MAAA,8BAEnF,KAAK,CAAC,KAAK,8BACjB,GAAG;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,MAAM;QAAA;QAAA,UAAI,KAAK,4BAA+B,KAAK;MAAQ;IAAA;EAAA;AAKtF;AAEA,eAAe,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { i18n } from "@k2b/stdlib";
|
|
2
|
+
import { useLocale } from "../intl/locale";
|
|
3
|
+
|
|
4
|
+
/** Words of the flat building blocks: an area's disclosure and a fact group's pencil. */
|
|
5
|
+
const flatBlockMessages = i18n.define({
|
|
6
|
+
baseLocale: "en",
|
|
7
|
+
messages: {
|
|
8
|
+
en: {
|
|
9
|
+
showArea: ({
|
|
10
|
+
name
|
|
11
|
+
}) => `Show ${name}`,
|
|
12
|
+
hideArea: ({
|
|
13
|
+
name
|
|
14
|
+
}) => `Hide ${name}`,
|
|
15
|
+
editFacts: ({
|
|
16
|
+
title
|
|
17
|
+
}) => `Edit ${title}`
|
|
18
|
+
},
|
|
19
|
+
de: {
|
|
20
|
+
showArea: ({
|
|
21
|
+
name
|
|
22
|
+
}) => `${name} aufklappen`,
|
|
23
|
+
hideArea: ({
|
|
24
|
+
name
|
|
25
|
+
}) => `${name} zuklappen`,
|
|
26
|
+
editFacts: ({
|
|
27
|
+
title
|
|
28
|
+
}) => `${title} bearbeiten`
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export const useFlatBlockMessages = () => {
|
|
33
|
+
const locale = useLocale();
|
|
34
|
+
return () => flatBlockMessages.resolve([locale()]).t;
|
|
35
|
+
};
|
|
36
|
+
export const checkFlatBlockMessages = () => flatBlockMessages.check();
|
|
37
|
+
//# sourceMappingURL=flat-block-messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/flat-block-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/** Words of the flat building blocks: an area's disclosure and a fact group's pencil. */\nconst flatBlockMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n showArea: ({ name }: { name: string }) => `Show ${name}`,\n hideArea: ({ name }: { name: string }) => `Hide ${name}`,\n editFacts: ({ title }: { title: string }) => `Edit ${title}`,\n },\n de: {\n showArea: ({ name }) => `${name} aufklappen`,\n hideArea: ({ name }) => `${name} zuklappen`,\n editFacts: ({ title }) => `${title} bearbeiten`,\n },\n },\n});\n\nexport type FlatBlockMessages = ReturnType<(typeof flatBlockMessages)[\"resolve\"]>[\"t\"];\n\nexport const useFlatBlockMessages = (): (() => FlatBlockMessages) => {\n const locale = useLocale();\n return () => flatBlockMessages.resolve([locale()]).t;\n};\n\nexport const checkFlatBlockMessages = () => flatBlockMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC;EACpC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,QAAQ,EAAE,CAAC;QAAE;MAAuB,CAAC,KAAK,QAAQ,IAAI,EAAE;MACxD,QAAQ,EAAE,CAAC;QAAE;MAAuB,CAAC,KAAK,QAAQ,IAAI,EAAE;MACxD,SAAS,EAAE,CAAC;QAAE;MAAyB,CAAC,KAAK,QAAQ,KAAK;IAC5D,CAAC;IACD,EAAE,EAAE;MACF,QAAQ,EAAE,CAAC;QAAE;MAAK,CAAC,KAAK,GAAG,IAAI,aAAa;MAC5C,QAAQ,EAAE,CAAC;QAAE;MAAK,CAAC,KAAK,GAAG,IAAI,YAAY;MAC3C,SAAS,EAAE,CAAC;QAAE;MAAM,CAAC,KAAK,GAAG,KAAK;IACpC;EACF;AACF,CAAC,CAAC;AAIF,OAAO,MAAM,oBAAoB,GAAG,MAAiC;EACnE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,OAAO,MAAM,sBAAsB,GAAG,MAAM,iBAAiB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
export { Area } from "./Area";
|
|
1
2
|
export { Avatar } from "./Avatar";
|
|
2
3
|
export { AvatarFaces, AvatarStack } from "./AvatarStack";
|
|
3
4
|
export { BudgetList, budgetState } from "./BudgetList";
|
|
4
5
|
export { ChangeList } from "./ChangeList";
|
|
5
6
|
export { DescriptionList } from "./DescriptionList";
|
|
6
7
|
export { DotStrip } from "./DotStrip";
|
|
8
|
+
export { FactGroup } from "./FactGroup";
|
|
7
9
|
export { Field } from "./Field";
|
|
10
|
+
export { FieldGrid } from "./FieldGrid";
|
|
8
11
|
export { LinkCard } from "./LinkCard";
|
|
9
12
|
export { NotFoundState } from "./NotFoundState";
|
|
10
13
|
export { NOTICE_CARD_CLASSES, NoticeCard } from "./NoticeCard";
|
|
@@ -15,6 +18,7 @@ export { ProgressBar, progressBarParts } from "./ProgressBar";
|
|
|
15
18
|
export { ProgressRing } from "./ProgressRing";
|
|
16
19
|
export { PERSON_COLORS, personColor } from "./person-color";
|
|
17
20
|
export { ResourceCard } from "./ResourceCard";
|
|
21
|
+
export { RowGroup } from "./RowGroup";
|
|
18
22
|
export { Section } from "./Section";
|
|
19
23
|
export { createDelayedLoading, Skeleton } from "./Skeleton";
|
|
20
24
|
export { StatCell } from "./StatCell";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["surfaces/index.ts"],"sourcesContent":["export type { AvatarProps, AvatarRing, AvatarShape, AvatarSize, AvatarTone } from \"./Avatar\";\nexport { Avatar } from \"./Avatar\";\nexport type { AvatarFacesPerson, AvatarFacesProps, AvatarStackPerson, AvatarStackProps } from \"./AvatarStack\";\nexport { AvatarFaces, AvatarStack } from \"./AvatarStack\";\nexport { type BudgetItem, type BudgetLevel, BudgetList, type BudgetListProps, budgetState } from \"./BudgetList\";\nexport type { ChangeListItem, ChangeListProps, ChangeTone } from \"./ChangeList\";\nexport { ChangeList } from \"./ChangeList\";\nexport type { DescriptionListItem, DescriptionListProps } from \"./DescriptionList\";\nexport { DescriptionList } from \"./DescriptionList\";\nexport type { DotStripProps, DotStripTone } from \"./DotStrip\";\nexport { DotStrip } from \"./DotStrip\";\nexport type { FieldRowProps } from \"./Field\";\nexport { Field } from \"./Field\";\nexport type { LinkCardColor, LinkCardProps } from \"./LinkCard\";\nexport { LinkCard } from \"./LinkCard\";\nexport type { NotFoundStateAction, NotFoundStateProps } from \"./NotFoundState\";\nexport { NotFoundState } from \"./NotFoundState\";\nexport type { NoticeCardProps, NoticeGridProps, NoticeTone } from \"./NoticeCard\";\nexport { NOTICE_CARD_CLASSES, NoticeCard } from \"./NoticeCard\";\nexport type { NoticeRowProps } from \"./NoticeRow\";\nexport { NoticeRow } from \"./NoticeRow\";\nexport type { PaperProps, PaperTag } from \"./Paper\";\nexport { Paper } from \"./Paper\";\nexport type {\n PlaceholderAlign,\n PlaceholderProps,\n PlaceholderState,\n PlaceholderSurface,\n PlaceholderVariant,\n} from \"./Placeholder\";\nexport { default as Placeholder } from \"./Placeholder\";\nexport type { ProgressBarPart, ProgressBarProps, ProgressBarSegment, ProgressBarTone } from \"./ProgressBar\";\nexport { ProgressBar, progressBarParts } from \"./ProgressBar\";\nexport type { ProgressRingProps, ProgressRingTone } from \"./ProgressRing\";\nexport { ProgressRing } from \"./ProgressRing\";\nexport { PERSON_COLORS, personColor } from \"./person-color\";\nexport type { ResourceCardColor, ResourceCardProps, ResourceCardState } from \"./ResourceCard\";\nexport { ResourceCard } from \"./ResourceCard\";\nexport type { SectionFrame, SectionPartProps, SectionProps, SectionSize, SectionState, SectionTone } from \"./Section\";\nexport { Section } from \"./Section\";\nexport { createDelayedLoading, type DelayedLoadingOptions, Skeleton, type SkeletonProps } from \"./Skeleton\";\nexport type { StatCellAccent, StatCellCompare, StatCellDelta, StatCellProps, StatCellSize, StatCellTone } from \"./StatCell\";\nexport { StatCell } from \"./StatCell\";\nexport type {\n StatGridAction,\n StatGridColumns,\n StatGridProps,\n StatGridSize,\n StatGridSurface,\n StatGridVariant,\n} from \"./StatGrid\";\nexport { StatGrid } from \"./StatGrid\";\nexport type { StatusBadgeProps, StatusTone } from \"./StatusBadge\";\nexport { StatusBadge } from \"./StatusBadge\";\nexport type { TagProps, TagSize } from \"./Tag\";\nexport { Tag } from \"./Tag\";\n"],"mappings":"AACA,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,WAAW,EAAE,WAAW,QAAQ,eAAe;AACxD,SAA4C,UAAU,EAAwB,WAAW,QAAQ,cAAc;AAE/G,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,eAAe,QAAQ,mBAAmB;AAEnD,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,KAAK,QAAQ,SAAS;AAE/B,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,aAAa,QAAQ,iBAAiB;AAE/C,SAAS,mBAAmB,EAAE,UAAU,QAAQ,cAAc;AAE9D,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,KAAK,QAAQ,SAAS;
|
|
1
|
+
{"version":3,"names":[],"sources":["surfaces/index.ts"],"sourcesContent":["export type { AreaProps } from \"./Area\";\nexport { Area } from \"./Area\";\nexport type { AvatarProps, AvatarRing, AvatarShape, AvatarSize, AvatarTone } from \"./Avatar\";\nexport { Avatar } from \"./Avatar\";\nexport type { AvatarFacesPerson, AvatarFacesProps, AvatarStackPerson, AvatarStackProps } from \"./AvatarStack\";\nexport { AvatarFaces, AvatarStack } from \"./AvatarStack\";\nexport { type BudgetItem, type BudgetLevel, BudgetList, type BudgetListProps, budgetState } from \"./BudgetList\";\nexport type { ChangeListItem, ChangeListProps, ChangeTone } from \"./ChangeList\";\nexport { ChangeList } from \"./ChangeList\";\nexport type { DescriptionListItem, DescriptionListProps } from \"./DescriptionList\";\nexport { DescriptionList } from \"./DescriptionList\";\nexport type { DotStripProps, DotStripTone } from \"./DotStrip\";\nexport { DotStrip } from \"./DotStrip\";\nexport type { FactGroupItem, FactGroupProps } from \"./FactGroup\";\nexport { FactGroup } from \"./FactGroup\";\nexport type { FieldRowProps } from \"./Field\";\nexport { Field } from \"./Field\";\nexport type { FieldGridProps } from \"./FieldGrid\";\nexport { FieldGrid } from \"./FieldGrid\";\nexport type { LinkCardColor, LinkCardProps } from \"./LinkCard\";\nexport { LinkCard } from \"./LinkCard\";\nexport type { NotFoundStateAction, NotFoundStateProps } from \"./NotFoundState\";\nexport { NotFoundState } from \"./NotFoundState\";\nexport type { NoticeCardProps, NoticeGridProps, NoticeTone } from \"./NoticeCard\";\nexport { NOTICE_CARD_CLASSES, NoticeCard } from \"./NoticeCard\";\nexport type { NoticeRowProps } from \"./NoticeRow\";\nexport { NoticeRow } from \"./NoticeRow\";\nexport type { PaperProps, PaperTag } from \"./Paper\";\nexport { Paper } from \"./Paper\";\nexport type {\n PlaceholderAlign,\n PlaceholderProps,\n PlaceholderState,\n PlaceholderSurface,\n PlaceholderTone,\n PlaceholderVariant,\n} from \"./Placeholder\";\nexport { default as Placeholder } from \"./Placeholder\";\nexport type { ProgressBarPart, ProgressBarProps, ProgressBarSegment, ProgressBarTone } from \"./ProgressBar\";\nexport { ProgressBar, progressBarParts } from \"./ProgressBar\";\nexport type { ProgressRingProps, ProgressRingTone } from \"./ProgressRing\";\nexport { ProgressRing } from \"./ProgressRing\";\nexport { PERSON_COLORS, personColor } from \"./person-color\";\nexport type { ResourceCardColor, ResourceCardProps, ResourceCardState } from \"./ResourceCard\";\nexport { ResourceCard } from \"./ResourceCard\";\nexport type { RowGroupProps } from \"./RowGroup\";\nexport { RowGroup } from \"./RowGroup\";\nexport type { SectionFrame, SectionPartProps, SectionProps, SectionSize, SectionState, SectionTone } from \"./Section\";\nexport { Section } from \"./Section\";\nexport { createDelayedLoading, type DelayedLoadingOptions, Skeleton, type SkeletonProps } from \"./Skeleton\";\nexport type { StatCellAccent, StatCellCompare, StatCellDelta, StatCellProps, StatCellSize, StatCellTone } from \"./StatCell\";\nexport { StatCell } from \"./StatCell\";\nexport type {\n StatGridAction,\n StatGridColumns,\n StatGridProps,\n StatGridSize,\n StatGridSurface,\n StatGridVariant,\n} from \"./StatGrid\";\nexport { StatGrid } from \"./StatGrid\";\nexport type { StatusBadgeProps, StatusTone } from \"./StatusBadge\";\nexport { StatusBadge } from \"./StatusBadge\";\nexport type { TagProps, TagSize } from \"./Tag\";\nexport { Tag } from \"./Tag\";\n"],"mappings":"AACA,SAAS,IAAI,QAAQ,QAAQ;AAE7B,SAAS,MAAM,QAAQ,UAAU;AAEjC,SAAS,WAAW,EAAE,WAAW,QAAQ,eAAe;AACxD,SAA4C,UAAU,EAAwB,WAAW,QAAQ,cAAc;AAE/G,SAAS,UAAU,QAAQ,cAAc;AAEzC,SAAS,eAAe,QAAQ,mBAAmB;AAEnD,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,KAAK,QAAQ,SAAS;AAE/B,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,aAAa,QAAQ,iBAAiB;AAE/C,SAAS,mBAAmB,EAAE,UAAU,QAAQ,cAAc;AAE9D,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,KAAK,QAAQ,SAAS;AAS/B,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AAEtD,SAAS,WAAW,EAAE,gBAAgB,QAAQ,eAAe;AAE7D,SAAS,YAAY,QAAQ,gBAAgB;AAC7C,SAAS,aAAa,EAAE,WAAW,QAAQ,gBAAgB;AAE3D,SAAS,YAAY,QAAQ,gBAAgB;AAE7C,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,OAAO,QAAQ,WAAW;AACnC,SAAS,oBAAoB,EAA8B,QAAQ,QAA4B,YAAY;AAE3G,SAAS,QAAQ,QAAQ,YAAY;AASrC,SAAS,QAAQ,QAAQ,YAAY;AAErC,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,GAAG,QAAQ,OAAO","ignoreList":[]}
|