@k2b/ui 0.64.0 → 0.66.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 +47 -0
- package/dist/base.css +3 -6
- package/dist/browser/actions/ContextMenu.js +1 -3
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +15 -69
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/SortableList.js +1 -1
- package/dist/browser/actions/SortableList.js.map +1 -1
- package/dist/browser/actions/ViewTabs.js +5 -9
- package/dist/browser/actions/ViewTabs.js.map +1 -1
- package/dist/browser/actions/drag-and-drop.js +1 -1
- package/dist/browser/actions/drag-and-drop.js.map +1 -1
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/menu-sheet.js +18 -80
- package/dist/browser/actions/menu-sheet.js.map +1 -1
- package/dist/browser/content/DataTable.js +197 -285
- package/dist/browser/content/DataTable.js.map +1 -1
- package/dist/browser/content/MessageRow.js +139 -115
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/ProgressPath.js +25 -30
- package/dist/browser/content/ProgressPath.js.map +1 -1
- package/dist/browser/content/index.js +0 -2
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +0 -11
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/internal/field.js +2 -2
- package/dist/browser/internal/field.js.map +1 -1
- package/dist/browser/intl/messages.js +1 -1
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +8 -16
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/Breadcrumbs.js +42 -188
- package/dist/browser/layout/Breadcrumbs.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +205 -209
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/PanelDialog.js +88 -176
- package/dist/browser/layout/PanelDialog.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +5 -12
- 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 +0 -2
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/layout/workspace-messages.js +2 -12
- package/dist/browser/layout/workspace-messages.js.map +1 -1
- package/dist/browser/surfaces/NoticeCard.js +57 -69
- package/dist/browser/surfaces/NoticeCard.js.map +1 -1
- package/dist/browser/surfaces/Placeholder.js +5 -17
- package/dist/browser/surfaces/Placeholder.js.map +1 -1
- package/dist/browser/surfaces/Section.js +7 -22
- package/dist/browser/surfaces/Section.js.map +1 -1
- package/dist/browser/surfaces/StatusBadge.js +1 -5
- package/dist/browser/surfaces/StatusBadge.js.map +1 -1
- package/dist/browser/surfaces/index.js +0 -4
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/browser/v2/button.js +180 -0
- package/dist/browser/v2/button.js.map +1 -0
- package/dist/browser/v2/components.js +763 -0
- package/dist/browser/v2/components.js.map +1 -0
- package/dist/browser/v2/content.js +1107 -0
- package/dist/browser/v2/content.js.map +1 -0
- package/dist/browser/v2/controls.js +568 -0
- package/dist/browser/v2/controls.js.map +1 -0
- package/dist/browser/v2/describe.js +397 -0
- package/dist/browser/v2/describe.js.map +1 -0
- package/dist/browser/v2/index.js +25 -0
- package/dist/browser/v2/index.js.map +1 -0
- package/dist/browser/v2/layout.js +578 -0
- package/dist/browser/v2/layout.js.map +1 -0
- package/dist/browser/v2/link.js +9 -0
- package/dist/browser/v2/link.js.map +1 -0
- package/dist/browser/v2/marks.js +211 -0
- package/dist/browser/v2/marks.js.map +1 -0
- package/dist/browser/v2/states.js +180 -0
- package/dist/browser/v2/states.js.map +1 -0
- package/dist/browser/v2/structure.js +328 -0
- package/dist/browser/v2/structure.js.map +1 -0
- package/dist/browser/v2/testing/index.js +23 -0
- package/dist/browser/v2/testing/index.js.map +1 -0
- package/dist/browser/v2/testing/measure-v2-layout.js +762 -0
- package/dist/browser/v2/testing/measure-v2-layout.js.map +1 -0
- package/dist/browser/v2/testing/settled.js +52 -0
- package/dist/browser/v2/testing/settled.js.map +1 -0
- package/dist/browser/v2/tokens.js +83 -0
- package/dist/browser/v2/tokens.js.map +1 -0
- package/dist/browser/v2/types.js +24 -0
- package/dist/browser/v2/types.js.map +1 -0
- package/dist/ssr/actions/ContextMenu.js +1 -3
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +15 -69
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/SortableList.js +1 -1
- package/dist/ssr/actions/SortableList.js.map +1 -1
- package/dist/ssr/actions/ViewTabs.js +5 -9
- package/dist/ssr/actions/ViewTabs.js.map +1 -1
- package/dist/ssr/actions/drag-and-drop.js +1 -1
- package/dist/ssr/actions/drag-and-drop.js.map +1 -1
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/menu-sheet.js +10 -62
- package/dist/ssr/actions/menu-sheet.js.map +1 -1
- package/dist/ssr/content/DataTable.js +54 -64
- package/dist/ssr/content/DataTable.js.map +1 -1
- package/dist/ssr/content/MessageRow.js +30 -10
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/ProgressPath.js +8 -14
- package/dist/ssr/content/ProgressPath.js.map +1 -1
- package/dist/ssr/content/index.js +0 -2
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +0 -11
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/internal/field.js +2 -2
- package/dist/ssr/internal/field.js.map +1 -1
- package/dist/ssr/intl/messages.js +1 -1
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +8 -16
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/Breadcrumbs.js +26 -140
- package/dist/ssr/layout/Breadcrumbs.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +68 -70
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/PanelDialog.js +8 -82
- package/dist/ssr/layout/PanelDialog.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +5 -12
- 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 +0 -2
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/layout/workspace-messages.js +2 -12
- package/dist/ssr/layout/workspace-messages.js.map +1 -1
- package/dist/ssr/surfaces/NoticeCard.js +5 -7
- package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
- package/dist/ssr/surfaces/Placeholder.js +4 -15
- package/dist/ssr/surfaces/Placeholder.js.map +1 -1
- package/dist/ssr/surfaces/Section.js +4 -7
- package/dist/ssr/surfaces/Section.js.map +1 -1
- package/dist/ssr/surfaces/StatusBadge.js +1 -5
- package/dist/ssr/surfaces/StatusBadge.js.map +1 -1
- package/dist/ssr/surfaces/index.js +0 -4
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/ssr/v2/button.js +177 -0
- package/dist/ssr/v2/button.js.map +1 -0
- package/dist/ssr/v2/components.js +518 -0
- package/dist/ssr/v2/components.js.map +1 -0
- package/dist/ssr/v2/content.js +727 -0
- package/dist/ssr/v2/content.js.map +1 -0
- package/dist/ssr/v2/controls.js +268 -0
- package/dist/ssr/v2/controls.js.map +1 -0
- package/dist/ssr/v2/describe.js +397 -0
- package/dist/ssr/v2/describe.js.map +1 -0
- package/dist/ssr/v2/index.js +25 -0
- package/dist/ssr/v2/index.js.map +1 -0
- package/dist/ssr/v2/layout.js +377 -0
- package/dist/ssr/v2/layout.js.map +1 -0
- package/dist/ssr/v2/link.js +9 -0
- package/dist/ssr/v2/link.js.map +1 -0
- package/dist/ssr/v2/marks.js +126 -0
- package/dist/ssr/v2/marks.js.map +1 -0
- package/dist/ssr/v2/states.js +128 -0
- package/dist/ssr/v2/states.js.map +1 -0
- package/dist/ssr/v2/structure.js +229 -0
- package/dist/ssr/v2/structure.js.map +1 -0
- package/dist/ssr/v2/testing/index.js +23 -0
- package/dist/ssr/v2/testing/index.js.map +1 -0
- package/dist/ssr/v2/testing/measure-v2-layout.js +762 -0
- package/dist/ssr/v2/testing/measure-v2-layout.js.map +1 -0
- package/dist/ssr/v2/testing/settled.js +52 -0
- package/dist/ssr/v2/testing/settled.js.map +1 -0
- package/dist/ssr/v2/tokens.js +83 -0
- package/dist/ssr/v2/tokens.js.map +1 -0
- package/dist/ssr/v2/types.js +24 -0
- package/dist/ssr/v2/types.js.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/types/actions/Dropdown.d.ts +1 -35
- package/dist/types/actions/ViewTabs.d.ts +2 -3
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/actions/menu-sheet.d.ts +1 -3
- package/dist/types/content/DataTable.d.ts +0 -19
- package/dist/types/content/MessageRow.d.ts +11 -0
- package/dist/types/content/ProgressPath.d.ts +6 -12
- package/dist/types/content/index.d.ts +0 -2
- package/dist/types/feedback/dialog-core.d.ts +0 -5
- package/dist/types/layout/AppWorkspace.d.ts +2 -10
- package/dist/types/layout/Breadcrumbs.d.ts +5 -10
- package/dist/types/layout/PanelDialog.d.ts +0 -19
- package/dist/types/layout/app-workspace-state.d.ts +2 -2
- package/dist/types/layout/index.d.ts +1 -5
- package/dist/types/layout/workspace-messages.d.ts +0 -5
- package/dist/types/surfaces/NoticeCard.d.ts +4 -6
- package/dist/types/surfaces/Placeholder.d.ts +0 -7
- package/dist/types/surfaces/Section.d.ts +2 -8
- package/dist/types/surfaces/StatusBadge.d.ts +1 -2
- package/dist/types/surfaces/index.d.ts +1 -9
- package/dist/types/v2/button.d.ts +54 -0
- package/dist/types/v2/components.d.ts +173 -0
- package/dist/types/v2/content.d.ts +233 -0
- package/dist/types/v2/controls.d.ts +118 -0
- package/dist/types/v2/describe.d.ts +18 -0
- package/dist/types/v2/index.d.ts +22 -0
- package/dist/types/v2/layout.d.ts +124 -0
- package/dist/types/v2/link.d.ts +7 -0
- package/dist/types/v2/marks.d.ts +90 -0
- package/dist/types/v2/states.d.ts +45 -0
- package/dist/types/v2/structure.d.ts +47 -0
- package/dist/types/v2/testing/index.d.ts +16 -0
- package/dist/types/v2/testing/measure-v2-layout.d.ts +99 -0
- package/dist/types/v2/testing/settled.d.ts +13 -0
- package/dist/types/v2/tokens.d.ts +77 -0
- package/dist/types/v2/types.d.ts +44 -0
- package/dist/v2.css +3072 -0
- package/package.json +24 -10
- package/skills/k2b-ui/SKILL.md +201 -0
- package/skills/k2b-ui/images/form-1440.png +0 -0
- package/skills/k2b-ui/images/form-390.png +0 -0
- package/skills/k2b-ui/images/list-detail-1440.png +0 -0
- package/skills/k2b-ui/images/list-detail-390.png +0 -0
- package/skills/k2b-ui/images/mail-1440.png +0 -0
- package/skills/k2b-ui/images/mail-390.png +0 -0
- package/skills/k2b-ui/images/record-1440.png +0 -0
- package/skills/k2b-ui/images/record-390.png +0 -0
- package/skills/k2b-ui/images/record-groups-1440.png +0 -0
- package/skills/k2b-ui/images/record-groups-390.png +0 -0
- package/skills/k2b-ui/images/table-1440.png +0 -0
- package/skills/k2b-ui/images/table-390.png +0 -0
- package/skills/k2b-ui/recipes/form.tsx +54 -0
- package/skills/k2b-ui/recipes/list-detail.tsx +105 -0
- package/skills/k2b-ui/recipes/mail.tsx +193 -0
- package/skills/k2b-ui/recipes/record-groups.tsx +115 -0
- package/skills/k2b-ui/recipes/record.tsx +163 -0
- package/skills/k2b-ui/recipes/table.tsx +68 -0
- package/skills/k2b-ui/references/mistakes.md +162 -0
- package/skills/k2b-ui/references/primitives.md +310 -0
- package/skills/k2b-ui/references/recipes.md +101 -0
- package/skills/k2b-ui/references/seeing.md +94 -0
- package/dist/browser/actions/menu-sheet-messages.js +0 -26
- package/dist/browser/actions/menu-sheet-messages.js.map +0 -1
- package/dist/browser/actions/menu-submenu-panel.js +0 -392
- package/dist/browser/actions/menu-submenu-panel.js.map +0 -1
- package/dist/browser/content/FileName.js +0 -68
- package/dist/browser/content/FileName.js.map +0 -1
- package/dist/browser/content/TaskRow.js +0 -129
- package/dist/browser/content/TaskRow.js.map +0 -1
- package/dist/browser/content/progress-path-messages.js +0 -22
- package/dist/browser/content/progress-path-messages.js.map +0 -1
- package/dist/browser/feedback/dialog-foot.js +0 -45
- package/dist/browser/feedback/dialog-foot.js.map +0 -1
- package/dist/browser/internal/renders-something.js +0 -3
- package/dist/browser/internal/renders-something.js.map +0 -1
- package/dist/browser/layout/FloatingPill.js +0 -33
- package/dist/browser/layout/FloatingPill.js.map +0 -1
- package/dist/browser/layout/StatusRow.js +0 -174
- package/dist/browser/layout/StatusRow.js.map +0 -1
- package/dist/browser/layout/panel-dialog-error.js +0 -44
- package/dist/browser/layout/panel-dialog-error.js.map +0 -1
- package/dist/browser/layout/panel-sheet-handle.js +0 -86
- package/dist/browser/layout/panel-sheet-handle.js.map +0 -1
- package/dist/browser/layout-check.js +0 -232
- package/dist/browser/layout-check.js.map +0 -1
- package/dist/browser/surfaces/Area.js +0 -205
- package/dist/browser/surfaces/Area.js.map +0 -1
- package/dist/browser/surfaces/FactGroup.js +0 -148
- package/dist/browser/surfaces/FactGroup.js.map +0 -1
- package/dist/browser/surfaces/FieldGrid.js +0 -34
- package/dist/browser/surfaces/FieldGrid.js.map +0 -1
- package/dist/browser/surfaces/RowGroup.js +0 -82
- package/dist/browser/surfaces/RowGroup.js.map +0 -1
- package/dist/browser/surfaces/flat-block-messages.js +0 -37
- package/dist/browser/surfaces/flat-block-messages.js.map +0 -1
- package/dist/ssr/actions/menu-sheet-messages.js +0 -26
- package/dist/ssr/actions/menu-sheet-messages.js.map +0 -1
- package/dist/ssr/actions/menu-submenu-panel.js +0 -295
- package/dist/ssr/actions/menu-submenu-panel.js.map +0 -1
- package/dist/ssr/content/FileName.js +0 -46
- package/dist/ssr/content/FileName.js.map +0 -1
- package/dist/ssr/content/TaskRow.js +0 -95
- package/dist/ssr/content/TaskRow.js.map +0 -1
- package/dist/ssr/content/progress-path-messages.js +0 -22
- package/dist/ssr/content/progress-path-messages.js.map +0 -1
- package/dist/ssr/feedback/dialog-foot.js +0 -45
- package/dist/ssr/feedback/dialog-foot.js.map +0 -1
- package/dist/ssr/internal/renders-something.js +0 -3
- package/dist/ssr/internal/renders-something.js.map +0 -1
- package/dist/ssr/layout/FloatingPill.js +0 -16
- package/dist/ssr/layout/FloatingPill.js.map +0 -1
- package/dist/ssr/layout/StatusRow.js +0 -93
- package/dist/ssr/layout/StatusRow.js.map +0 -1
- package/dist/ssr/layout/panel-dialog-error.js +0 -28
- package/dist/ssr/layout/panel-dialog-error.js.map +0 -1
- package/dist/ssr/layout/panel-sheet-handle.js +0 -66
- package/dist/ssr/layout/panel-sheet-handle.js.map +0 -1
- package/dist/ssr/layout-check.js +0 -232
- package/dist/ssr/layout-check.js.map +0 -1
- package/dist/ssr/surfaces/Area.js +0 -147
- package/dist/ssr/surfaces/Area.js.map +0 -1
- package/dist/ssr/surfaces/FactGroup.js +0 -106
- package/dist/ssr/surfaces/FactGroup.js.map +0 -1
- package/dist/ssr/surfaces/FieldGrid.js +0 -22
- package/dist/ssr/surfaces/FieldGrid.js.map +0 -1
- package/dist/ssr/surfaces/RowGroup.js +0 -60
- package/dist/ssr/surfaces/RowGroup.js.map +0 -1
- package/dist/ssr/surfaces/flat-block-messages.js +0 -37
- package/dist/ssr/surfaces/flat-block-messages.js.map +0 -1
- package/dist/types/actions/menu-sheet-messages.d.ts +0 -11
- package/dist/types/actions/menu-submenu-panel.d.ts +0 -27
- package/dist/types/content/FileName.d.ts +0 -23
- package/dist/types/content/TaskRow.d.ts +0 -33
- package/dist/types/content/progress-path-messages.d.ts +0 -8
- package/dist/types/feedback/dialog-foot.d.ts +0 -9
- package/dist/types/internal/renders-something.d.ts +0 -2
- package/dist/types/layout/FloatingPill.d.ts +0 -20
- package/dist/types/layout/StatusRow.d.ts +0 -54
- package/dist/types/layout/panel-dialog-error.d.ts +0 -9
- package/dist/types/layout/panel-sheet-handle.d.ts +0 -8
- package/dist/types/layout-check.d.ts +0 -52
- package/dist/types/surfaces/Area.d.ts +0 -38
- package/dist/types/surfaces/FactGroup.d.ts +0 -33
- package/dist/types/surfaces/FieldGrid.d.ts +0 -14
- package/dist/types/surfaces/RowGroup.d.ts +0 -20
- package/dist/types/surfaces/flat-block-messages.d.ts +0 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["v2/content.tsx"],"sourcesContent":["import { Link } from \"@k2b/ssr/nav\";\nimport {\n createContext,\n createMemo,\n createUniqueId,\n For,\n type JSX,\n onCleanup,\n onMount,\n children as resolveChildren,\n Show,\n useContext,\n} from \"solid-js\";\nimport { Dynamic } from \"solid-js/web\";\nimport { renderSafeMarkdown } from \"../content/MarkdownView\";\nimport { useLocale } from \"../intl/locale\";\nimport { ActionButton, CopyButton } from \"./button\";\nimport { MarkCheck } from \"./controls\";\nimport { Avatar, custom, Dot, Icon } from \"./marks\";\nimport { Empty, type EmptyProps, Loading, LoadingStatus } from \"./states\";\nimport type { TypeRole } from \"./tokens\";\nimport type { Action, OnNavigate, Person, Status } from \"./types\";\n\n// ── Text ─────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type TextProps = {\n /**\n * One of the four type roles. Without one, text takes the role of its place (13/20 in a pane, the role of the\n * sentence it stands in). (Named `type`, not `role`, so it never reads as an ARIA role.)\n */\n type?: TypeRole;\n /**\n * Emphasis is a weight, never a size: `strong` (600) stresses a word, `medium` (500) lets a state or an amount stand\n * out a little, such as \"Quittung offen\".\n */\n weight?: \"medium\" | \"strong\";\n /** The muted ink, for a second voice beside the main text. */\n muted?: boolean;\n /** A colour of meaning, never decoration. */\n tone?: Status | \"ai\" | \"draft\";\n /** The words lead to this page: they keep the ink of the text and are underlined (blue is only the main action). */\n href?: string;\n children: JSX.Element;\n};\n\nconst typeClass = { meta: \"k2-t-meta\", row: \"k2-t-row\", body: \"k2-t-body\", lead: \"k2-t-lead\" } as const;\nconst weightClass = { medium: \"k2-medium\", strong: \"k2-strong\" } as const;\n\n/**\n * Text in one of the four type roles. Standing in the flow of a column (a pane, a band, a section, a group) it is a\n * block that carries the text edge itself; anywhere else (a bar, a row, a sentence) it runs inline, and in a bar it is\n * cut to one line with \"…\". The stylesheet decides by place, so text passed as data behaves the same.\n */\nexport const Text = (props: TextProps) => (\n <Dynamic\n component={props.href ? \"a\" : \"span\"}\n href={props.href}\n class={`k2-text${props.type ? ` ${typeClass[props.type]}` : \"\"}${props.weight ? ` ${weightClass[props.weight]}` : \"\"}${props.muted ? \" k2-muted\" : \"\"}${props.href ? \" k2-link\" : \"\"}`}\n data-k2-part=\"Text\"\n data-type={props.type}\n data-tone={props.tone}\n >\n {props.children}\n </Dynamic>\n);\n\n/** The links reading text may carry; any other target shows as text. */\nconst proseLinks = [\"https:\", \"http:\", \"mailto:\"] as const;\n\nexport type ProseProps =\n | {\n /**\n * Text in Markdown, such as a message. Raw HTML in it shows as text; links lead only to web pages and mail\n * addresses; images show their words, they load nothing.\n */\n markdown: string;\n children?: never;\n }\n | { markdown?: never; children: JSX.Element };\n\n/** Reading text: 14/22, a measure of 720 px, headings at 16 and 18. It carries the text edge itself. */\nexport const Prose = (props: ProseProps) => {\n const locale = useLocale();\n return (\n <Show\n when={props.markdown !== undefined}\n fallback={\n <div class=\"k2-prose\" data-k2-part=\"Prose\" data-k2-prose=\"\">\n {props.children}\n </div>\n }\n >\n <div\n class=\"k2-prose\"\n data-k2-part=\"Prose\"\n data-k2-prose=\"\"\n innerHTML={renderSafeMarkdown(props.markdown ?? \"\", { locale: locale(), allowImages: false, linkProtocols: proseLinks })}\n />\n </Show>\n );\n};\n\nexport type InlineProps = { children: JSX.Element };\n\n/**\n * One line of things with the one fixed gap of 8 px. In a column it carries the text edge itself. In a column narrower\n * than 480 px it wraps onto more lines instead of cutting a thing; in a bar it flows together with the bar's end.\n */\nexport const Inline = (props: InlineProps) => (\n <div class=\"k2-inline\" data-k2-part=\"Inline\">\n {props.children}\n </div>\n);\n\n// ── Facts ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type Fact = {\n label: string;\n value: JSX.Element;\n /** A quiet word under the value, such as \"Standard\". */\n hint?: string;\n /** Offers a copy button at the value; the text that is copied. */\n copy?: string;\n};\n\nexport type FactsProps = {\n items: readonly Fact[];\n /** All facts on one line, labels quiet before their values. */\n inline?: boolean;\n /** At the end of the inline line, such as \"Print\". */\n end?: JSX.Element;\n};\n\n/** Values with their labels: label 12 quiet, value 13, 32 px a row, copy at the value. */\nexport const Facts = (props: FactsProps) => {\n // A list of pairs (dt, dd); a copy button stands inside its value, the end of an inline line beside the list.\n const list = (part?: string) => (\n <dl class=\"k2-facts\" data-k2-part={part} data-inline={props.inline ? \"\" : undefined}>\n <For each={props.items}>\n {(item) => (\n <div class=\"k2-fact-pair\">\n <dt>{item.label}</dt>\n <dd>\n <span class=\"k2-fact-value\">\n {item.value}\n <Show when={item.hint}>\n <small>{item.hint}</small>\n </Show>\n </span>\n <Show when={!props.inline && item.copy}>{(value) => <CopyButton label={item.label} value={value()} />}</Show>\n </dd>\n </div>\n )}\n </For>\n </dl>\n );\n const end = resolveChildren(() => props.end);\n return (\n <Show when={props.inline && end() !== undefined} fallback={list(\"Facts\")}>\n <div class=\"k2-facts-line\" data-k2-part=\"Facts\">\n {list()}\n <div class=\"k2-facts-end\">{end()}</div>\n </div>\n </Show>\n );\n};\n\n// ── Row and List ─────────────────────────────────────────────────────────────────────────────────────────────────\n\nconst ListContext = createContext(false);\n\nexport type ListProps = { children: JSX.Element; label?: string };\n\n/**\n * Rows that come or go above the place someone works on (a new mail on top) leave that place where it was: the\n * focused row, else the first visible one, keeps its distance to the top of the column. When that row goes itself,\n * the row after it takes its place, else the row before it keeps its own. Browsers with CSS scroll anchoring already\n * hold the place, so nothing moves twice there; Safari ships none. At the very top nothing is held, so a new row shows\n * up there. (As v1's `MailConversationList`.)\n */\nconst keepPlace = (list: HTMLElement) => {\n const scroller = list.closest<HTMLElement>(\".k2-scroll\");\n if (!scroller || typeof MutationObserver === \"undefined\") return;\n type Place = { row: HTMLElement; top: number };\n let held: { place: Place; next?: Place; previous?: Place } | null = null;\n const isRow = (node: Node | null): node is HTMLElement => node instanceof HTMLElement && node.matches(\".k2-row\");\n const hold = () => {\n const view = scroller.getBoundingClientRect();\n const placeOf = (row: HTMLElement): Place => ({ row, top: row.getBoundingClientRect().top - view.top });\n const visible = (row: HTMLElement) => {\n const box = row.getBoundingClientRect();\n return box.bottom > view.top && box.top < view.bottom;\n };\n const focused = document.activeElement?.closest<HTMLElement>(\".k2-row\");\n const row =\n scroller.scrollTop <= 0\n ? undefined\n : focused && focused.parentElement === list && visible(focused)\n ? focused\n : Array.from(list.children).find((each) => isRow(each) && each.getBoundingClientRect().top >= view.top);\n if (!row || !isRow(row)) {\n held = null;\n return;\n }\n const next = row.nextElementSibling;\n const previous = row.previousElementSibling;\n held = {\n place: placeOf(row),\n // the row after it would take its place, the row before it keeps its own\n next: isRow(next) ? { row: next, top: placeOf(row).top } : undefined,\n previous: isRow(previous) ? placeOf(previous) : undefined,\n };\n };\n const changed = (records: MutationRecord[]) => {\n if (!records.some((record) => [...record.addedNodes, ...record.removedNodes].some(isRow))) return;\n const place = [held?.place, held?.next, held?.previous].find((each) => each?.row.isConnected);\n if (place) {\n const moved = place.row.getBoundingClientRect().top - scroller.getBoundingClientRect().top - place.top;\n if (Math.abs(moved) >= 1) scroller.scrollTop += moved;\n }\n hold();\n };\n const rows = new MutationObserver(changed);\n rows.observe(list, { childList: true });\n scroller.addEventListener(\"scroll\", hold, { passive: true });\n scroller.addEventListener(\"focusin\", hold);\n hold();\n onCleanup(() => {\n rows.disconnect();\n scroller.removeEventListener(\"scroll\", hold);\n scroller.removeEventListener(\"focusin\", hold);\n });\n};\n\n/** Rows one under the other. (Selection, keyboard and drag come with the behaviour layer.) */\nexport const List = (props: ListProps) => {\n let list: HTMLDivElement | undefined;\n onMount(() => {\n if (list) keepPlace(list);\n });\n return (\n <div ref={list} class=\"k2-list\" data-k2-part=\"List\" role=\"list\" aria-label={props.label}>\n <ListContext.Provider value={true}>{props.children}</ListContext.Provider>\n </div>\n );\n};\n\nexport type RowLines = readonly [JSX.Element] | readonly [JSX.Element, JSX.Element] | readonly [JSX.Element, JSX.Element, JSX.Element];\n\nexport type RowProps = {\n /**\n * One to three lines; the role follows the position: one line 40 px, two lines 52 px (the second quiet, 12 px),\n * three lines 72 px (the second a row, the third quiet). A row of three lines cuts each line with \"…\".\n */\n lines: RowLines;\n /** A quiet note after the title, such as a count or an address. */\n meta?: JSX.Element;\n /** The lead: a symbol in the colour of its area … */\n icon?: string;\n /** … the data colour of that symbol … */\n color?: string;\n /** … or a person. */\n avatar?: Person;\n /** Unread: a dot leads and the first two lines turn 600. */\n unread?: boolean;\n /** The title in 600. */\n strong?: boolean;\n /** The open one, in the tint of the app. */\n selected?: boolean;\n /** \"You are next\", in the blue tint. */\n yours?: boolean;\n /** Top right, quiet: a time or a date. */\n time?: JSX.Element;\n /** Bottom right on the third line: chips, icons, people. */\n marks?: JSX.Element;\n /** The one deed of this entry, a framed button at the end; on the phone it moves under the text. */\n action?: Action;\n /** At the end: a few icon buttons, such as \"Reply\" and \"More\". */\n end?: JSX.Element;\n /** The row opens this link … */\n href?: string;\n /** … in place on a plain click, while the link still opens in a new tab (see `OnNavigate`) … */\n onNavigate?: OnNavigate;\n /** … or calls this. */\n onOpen?: () => void;\n};\n\n/**\n * What opens an entry: the title becomes a link or a button, stretched over the whole entry. It is never the entry\n * itself, so buttons and links inside the entry stay buttons and links of their own (no control inside a control).\n */\nexport const RowOpen = (props: { href?: string; onNavigate?: OnNavigate; onOpen?: () => void; children: JSX.Element }) => (\n <Show when={props.href !== undefined || props.onOpen} fallback={props.children}>\n <Show\n when={props.href !== undefined}\n fallback={\n <button type=\"button\" class=\"k2-row-open\" onClick={() => props.onOpen?.()}>\n {props.children}\n </button>\n }\n >\n <Link class=\"k2-row-open\" href={props.href ?? \"\"} onNavigate={props.onNavigate} onClick={() => props.onOpen?.()}>\n {props.children}\n </Link>\n </Show>\n </Show>\n);\n\n/** One entry: from column edge to column edge, square, also when it opens something. */\nexport const Row = (props: RowProps) => {\n const inList = useContext(ListContext);\n // Parts passed as JSX are made once and read from here: reading a prop again would make its JSX again.\n const text = createMemo(() => props.lines);\n const lines = () => text().length;\n const meta = resolveChildren(() => props.meta);\n const time = resolveChildren(() => props.time);\n const end = resolveChildren(() => props.end);\n const marks = resolveChildren(() => props.marks);\n const title = createUniqueId();\n return (\n <div\n class=\"k2-row\"\n data-k2-part=\"Row\"\n role={inList ? \"listitem\" : undefined}\n data-open={props.href !== undefined || props.onOpen ? \"\" : undefined}\n data-lines={String(lines())}\n data-unread={props.unread ? \"\" : undefined}\n data-strong={props.strong ? \"\" : undefined}\n data-selected={props.selected ? \"\" : undefined}\n aria-current={props.selected ? \"true\" : undefined}\n data-yours={props.yours ? \"\" : undefined}\n data-avatar={props.avatar ? \"\" : undefined}\n data-time={time() !== undefined ? \"\" : undefined}\n data-action={props.action ? \"\" : undefined}\n style={custom({ \"--k2-c\": props.color })}\n >\n {/* What opens the row lies over all of it and is named by the title; it holds no part of the row, so a link in\n the title stays a link of its own (no link inside a link). */}\n <Show when={props.href !== undefined || props.onOpen}>\n <Show\n when={props.href !== undefined}\n fallback={<button type=\"button\" class=\"k2-row-open\" aria-labelledby={title} onClick={() => props.onOpen?.()} />}\n >\n {/* The row's title names the link through aria-labelledby; holding the title would put a link of the title\n inside this one. */}\n <Link\n class=\"k2-row-open\"\n href={props.href ?? \"\"}\n aria-labelledby={title}\n onNavigate={props.onNavigate}\n onClick={() => props.onOpen?.()}\n />\n </Show>\n </Show>\n <span class=\"k2-row-lead\">\n <Show\n when={props.avatar}\n fallback={\n <Show\n when={props.icon}\n fallback={\n <Show when={props.unread}>\n <Dot status=\"ok\" />\n </Show>\n }\n >\n {(name) => <Icon name={name()} />}\n </Show>\n }\n >\n {(person) => <Avatar {...person()} />}\n </Show>\n </span>\n <span class=\"k2-row-l1\">\n <span class=\"k2-row-title\" id={title}>\n {text()[0]}\n </span>\n <Show when={meta() !== undefined}>\n <span class=\"k2-row-meta\">{meta()}</span>\n </Show>\n </span>\n <Show when={lines() > 1}>\n <span class=\"k2-row-l2\">{text()[1]}</span>\n </Show>\n <Show when={lines() > 2}>\n <span class=\"k2-row-l3\">{text()[2]}</span>\n </Show>\n <Show when={time() !== undefined}>\n <span class=\"k2-row-time\">{time()}</span>\n </Show>\n <Show when={end() !== undefined || props.action}>\n <span class=\"k2-row-end\">\n <Show when={props.action}>{(action) => <ActionButton action={action()} />}</Show>\n {end()}\n </span>\n </Show>\n <Show when={marks() !== undefined}>\n <span class=\"k2-row-marks\">{marks()}</span>\n </Show>\n </div>\n );\n};\n\n// ── Table ────────────────────────────────────────────────────────────────────────────────────────────────────────\n\n/** Two lines of a cell: the line itself and a quiet second line under it. */\nexport type CellLines = { lines: readonly [JSX.Element, JSX.Element] };\n\n/** What a cell shows: one line, or two lines named as such (`{ lines: [first, second] }`). */\nexport type CellValue = JSX.Element | CellLines;\n\nexport type Column<T> = {\n title: string;\n cell: (row: T) => CellValue;\n /** Numbers and amounts stand at the end. */\n align?: \"start\" | \"end\";\n /**\n * A column that can be dragged wider or narrower: its minimum and default in px. The column is exactly its\n * default wide; cut text never widens it.\n */\n width?: { min: number; default: number };\n /** A text column that may wrap to at most three lines; the row grows, every other cell stays on its first line. */\n wrap?: boolean;\n /** Drops away on the phone (rule 7: columns drop, they do not shrink). */\n drop?: boolean;\n};\n\n/** Where an entry leads: a page (a real link, also before the page is live) or a deed in place. */\nexport type OpenTarget =\n | { href: string; onNavigate?: OnNavigate; onOpen?: () => void }\n | { href?: undefined; onNavigate?: undefined; onOpen: () => void };\n\ntype TableBase<T> = {\n columns: readonly Column<T>[];\n rows: readonly T[];\n /** A name for the table, for assistive technology. */\n label?: string;\n /** The first column (and the box column) stays while the table scrolls sideways; an edge shows behind it. */\n sticky?: boolean;\n /** The column the rows are sorted by: an arrow in its head. */\n sort?: { column: number; direction: \"ascending\" | \"descending\" };\n /** What a row opens, on the desktop and on the phone: its first cell is the link or button. */\n open?: (row: T) => OpenTarget;\n /** On the phone each row becomes a row of two lines instead (rule 7). */\n phone?: (row: T) => { lines: readonly [JSX.Element, JSX.Element]; avatar?: Person; time?: JSX.Element };\n /**\n * While the rows load: the head stays and square placeholders hold the place of the rows, so nothing moves when they\n * come; `rows` (3 when not set) and `lines` (1 or 2) say how many and how high.\n */\n loading?: boolean | { rows?: number; lines?: 1 | 2 };\n /** No rows and nothing loading: the empty state stands in place of the table, such as \"Keine Aufträge mit diesem Filter.\" */\n empty?: EmptyProps;\n};\n\n/** A table whose rows are told apart: selection, the open row and groups need the stable key of a row. */\ntype KeyedTable<T> = {\n /** The stable key of a row. */\n rowKey: (row: T) => string;\n /**\n * A large table (Grids): a box column to select rows. The status row shows what can be done with them\n * (`StatusRow selection`).\n */\n select?: {\n selected: readonly string[];\n onChange: (keys: readonly string[]) => void;\n /** The name of the box of all rows and of one row, such as \"Alle Aufträge\" and the row's title. */\n all: string;\n row: (row: T) => string;\n };\n /** The key of the open row, in the tint of the app. */\n current?: string;\n /** Rows of a group follow one another under a tinted group row of 36 px (no frame: it would cut the columns). */\n group?: (row: T) => TableGroup;\n};\n\ntype PlainTable = { rowKey?: undefined; select?: undefined; current?: undefined; group?: undefined };\n\nexport type TableProps<T> = TableBase<T> & (KeyedTable<T> | PlainTable);\n\n/** Two lines only when they are named so: an array of two parts (a fragment) stays one line. */\nconst isPair = (value: CellValue): value is CellLines =>\n typeof value === \"object\" &&\n value !== null &&\n !Array.isArray(value) &&\n !(typeof Node !== \"undefined\" && value instanceof Node) &&\n \"lines\" in value;\n\n/**\n * A group of rows: its key, its head (such as a state chip), quiet figures after it, and the count for the phone.\n * The head is made where it stands (the table and the phone list each make their own), so it is a function.\n */\nexport type TableGroup = { key: string; head: () => JSX.Element; meta?: string; count?: string };\n\ntype TableItem<T> = { group: TableGroup } | { row: T; index: number };\n\n/**\n * Many like things in columns: head 36, a line under every row, none between columns. Long text stays on one line\n * with \"…\" and a fixed row height (variant a, decided 22.11.); `wrap` lets one text column take three lines. With\n * `select` or `sticky` it is the large table of Grids: one scroller for head and rows, a sticky head and first column,\n * rows and cells under the pointer, groups as tinted rows.\n */\nexport const Table = <T,>(props: TableProps<T>) => {\n const grid = () => props.select !== undefined || props.sticky === true;\n const sized = () => grid() || props.columns.some((column) => column.width);\n // Every cell is made once: what `cell` returns is placed, never rendered a second time.\n const values = createMemo(() => props.rows.map((row) => props.columns.map((column) => column.cell(row))));\n // the shape of the placeholders while the rows load\n const loading = () => {\n const shape = props.loading;\n return shape === true ? { rows: 3, lines: 1 as const } : shape ? { rows: shape.rows ?? 3, lines: shape.lines ?? 1 } : undefined;\n };\n const empty = () => (loading() || props.rows.length > 0 ? undefined : props.empty);\n const lines = () => (loading()?.lines === 2 || values().some((row) => row.some(isPair)) ? \"2\" : \"1\");\n const key = (row: T, index: number) => props.rowKey?.(row) ?? String(index);\n const items = createMemo((): TableItem<T>[] => {\n const out: TableItem<T>[] = [];\n let last: string | undefined;\n props.rows.forEach((row, index) => {\n const group = props.group?.(row);\n if (group && group.key !== last) out.push({ group });\n last = group?.key;\n out.push({ row, index });\n });\n return out;\n });\n const selected = (row: T, index: number) => props.select?.selected.includes(key(row, index)) ?? false;\n // A click anywhere on a row that opens something opens it, unless it was meant for a control in the row.\n const openRow = (event: MouseEvent & { currentTarget: HTMLTableRowElement }) => {\n if (!(event.target instanceof Element) || event.target.closest(\"a, button, input, label, select, textarea\")) return;\n const open = event.currentTarget.querySelector<HTMLElement>(\".k2-row-open\");\n if (!open || event.altKey) return;\n // With Ctrl, Cmd or Shift a link opens elsewhere, as on the link itself. A click handed on loses that in WebKit,\n // which follows it in this tab, so the row opens the link's address in a new tab itself.\n if (open instanceof HTMLAnchorElement && (event.ctrlKey || event.metaKey || event.shiftKey)) {\n window.open(open.href, \"_blank\", \"noopener\");\n return;\n }\n // a plain click is handed on to the link or button, which decides (`onNavigate`, `onOpen`, or the browser)\n open.dispatchEvent(new MouseEvent(\"click\", { bubbles: true, cancelable: true, view: window, detail: event.detail }));\n };\n const all = (): boolean | \"mixed\" => {\n const count = props.select?.selected.length ?? 0;\n return count === 0 ? false : count === props.rows.length ? true : \"mixed\";\n };\n const toggle = (rowKey: string, on: boolean) => {\n const select = props.select;\n if (!select) return;\n select.onChange(on ? [...select.selected, rowKey] : select.selected.filter((selectedKey) => selectedKey !== rowKey));\n };\n const span = () => props.columns.length + (props.select ? 1 : 0);\n // The sticky first data column stands after the box column (44 px).\n const stickyLeft = () => (props.select ? \"44px\" : \"0px\");\n const firstSticky = (index: number) => (props.sticky && index === 0 ? \"last\" : undefined);\n\n const cell = (column: Column<T>, value: CellValue, target?: OpenTarget) => {\n // Every line of a cell is a block of its own: cut with \"…\" in a sized table, wrapped in a small one.\n const line = (content: JSX.Element, second = false) => (\n <span class=\"k2-cell-line\" data-wrap={!second && column.wrap ? \"\" : undefined} data-second={second ? \"\" : undefined}>\n {content}\n </span>\n );\n const first = (content: JSX.Element) =>\n line(\n target ? (\n <RowOpen href={target.href} onNavigate={target.onNavigate} onOpen={target.onOpen}>\n {content}\n </RowOpen>\n ) : (\n content\n ),\n );\n return isPair(value) ? [first(value.lines[0]), line(value.lines[1], true)] : first(value);\n };\n\n const table = () => (\n <>\n <div\n class=\"k2-table-scroll\"\n data-k2-part=\"Table\"\n data-grid={grid() ? \"\" : undefined}\n data-wrap={props.columns.some((column) => column.wrap) ? \"\" : undefined}\n >\n {/* said outside the table, which is busy while its rows load */}\n <Show when={loading()}>\n <LoadingStatus />\n </Show>\n <table\n class=\"k2-table\"\n data-lines={lines()}\n data-sized={sized() ? \"\" : undefined}\n data-grid={grid() ? \"\" : undefined}\n aria-label={props.label}\n aria-busy={loading() ? \"true\" : undefined}\n >\n <Show when={sized()}>\n <colgroup>\n <Show when={props.select}>\n <col style={{ width: \"44px\" }} />\n </Show>\n {/* every column is its default wide; in a small table the last one takes the rest of the row */}\n <For each={props.columns}>\n {(column, index) => (\n <col\n style={\n column.width && (grid() || index() < props.columns.length - 1) ? { width: `${column.width.default}px` } : undefined\n }\n />\n )}\n </For>\n </colgroup>\n </Show>\n <thead>\n <tr>\n <Show when={props.select}>\n {(select) => (\n <th scope=\"col\" data-select=\"\" data-sticky={props.sticky ? \"\" : undefined}>\n <MarkCheck label={select().all} checked={all()} onChange={(on) => select().onChange(on ? props.rows.map(key) : [])} />\n </th>\n )}\n </Show>\n <For each={props.columns}>\n {(column, index) => (\n <th\n scope=\"col\"\n data-align={column.align}\n data-drop={column.drop ? \"\" : undefined}\n data-sticky={firstSticky(index())}\n style={firstSticky(index()) ? custom({ \"--k2-sticky-left\": stickyLeft() }) : undefined}\n aria-sort={props.sort?.column === index() ? props.sort.direction : undefined}\n >\n <Show when={index() > 0 && props.columns[index() - 1]?.width}>\n <span\n class=\"k2-cgrip\"\n role=\"separator\"\n aria-orientation=\"vertical\"\n aria-label={props.columns[index() - 1]!.title}\n aria-valuemin={props.columns[index() - 1]!.width!.min}\n aria-valuenow={props.columns[index() - 1]!.width!.default}\n tabindex=\"0\"\n />\n </Show>\n {column.title}\n <Show when={props.sort?.column === index()}>\n <Icon name={props.sort?.direction === \"descending\" ? \"arrow-down\" : \"arrow-up\"} />\n </Show>\n </th>\n )}\n </For>\n </tr>\n </thead>\n <tbody>\n <Show when={loading()}>\n {(shape) => (\n <For each={Array.from({ length: shape().rows }, (_, index) => index)}>\n {() => (\n <tr data-loading=\"\" aria-hidden=\"true\">\n <Show when={props.select}>\n {/* the placeholder of the box stands where the box will stand */}\n <td data-select=\"\" data-sticky={props.sticky ? \"\" : undefined}>\n <span class=\"k2-skel\" data-box=\"\" />\n </td>\n </Show>\n <For each={props.columns}>\n {(column, columnIndex) => (\n <td\n data-align={column.align}\n data-drop={column.drop ? \"\" : undefined}\n data-sticky={firstSticky(columnIndex())}\n style={firstSticky(columnIndex()) ? custom({ \"--k2-sticky-left\": stickyLeft() }) : undefined}\n >\n <span class=\"k2-cell-line\">\n <span class=\"k2-skel\" />\n </span>\n <Show when={shape().lines === 2}>\n <span class=\"k2-cell-line\" data-second=\"\">\n <span class=\"k2-skel\" />\n </span>\n </Show>\n </td>\n )}\n </For>\n </tr>\n )}\n </For>\n )}\n </Show>\n <For each={loading() ? [] : items()}>\n {(item) =>\n \"group\" in item ? (\n <tr data-group=\"\">\n <td colSpan={span()}>\n <span class=\"k2-group-row\">\n {item.group.head()}\n <Show when={item.group.meta}>\n <span class=\"k2-group-row-meta\">{item.group.meta}</span>\n </Show>\n </span>\n </td>\n </tr>\n ) : (\n (() => {\n const target = props.open?.(item.row);\n return (\n <tr\n data-open={target ? \"\" : undefined}\n data-selected={props.select && selected(item.row, item.index) ? \"\" : undefined}\n aria-current={props.current !== undefined && props.current === key(item.row, item.index) ? \"true\" : undefined}\n onClick={target ? openRow : undefined}\n >\n <Show when={props.select}>\n {(select) => (\n <td data-select=\"\" data-sticky={props.sticky ? \"\" : undefined}>\n <MarkCheck\n label={select().row(item.row)}\n checked={selected(item.row, item.index)}\n onChange={(on) => toggle(key(item.row, item.index), on)}\n />\n </td>\n )}\n </Show>\n <For each={props.columns}>\n {(column, columnIndex) => (\n <td\n data-align={column.align}\n data-drop={column.drop ? \"\" : undefined}\n data-sticky={firstSticky(columnIndex())}\n style={firstSticky(columnIndex()) ? custom({ \"--k2-sticky-left\": stickyLeft() }) : undefined}\n >\n {cell(column, values()[item.index]![columnIndex()]!, columnIndex() === 0 ? target : undefined)}\n </td>\n )}\n </For>\n </tr>\n );\n })()\n )\n }\n </For>\n </tbody>\n </table>\n </div>\n <Show when={props.phone}>\n {(phone) => (\n <div class=\"k2-table-phone\">\n {/* while the rows load, the phone shows rows of placeholders of two lines, not an empty list */}\n <Show when={!loading()} fallback={<Loading rows={loading()?.rows} lines={2} />}>\n <List label={props.label}>\n <For each={items()}>\n {(item) =>\n \"group\" in item ? (\n <div class=\"k2-bar\" role=\"presentation\">\n <div class=\"k2-bar-start\">\n {item.group.head()}\n <Show when={item.group.count ?? item.group.meta}>\n <span class=\"k2-t-meta\">{item.group.count ?? item.group.meta}</span>\n </Show>\n </div>\n </div>\n ) : (\n (() => {\n const form = phone()(item.row);\n const target = props.open?.(item.row);\n return (\n <Row\n lines={form.lines}\n avatar={form.avatar}\n time={form.time}\n strong\n href={target?.href}\n onNavigate={target?.onNavigate}\n onOpen={target?.onOpen}\n selected={props.current !== undefined && props.current === key(item.row, item.index)}\n />\n );\n })()\n )\n }\n </For>\n </List>\n </Show>\n </div>\n )}\n </Show>\n </>\n );\n\n return (\n <Show when={empty()} fallback={table()}>\n {(state) => <Empty {...state()} />}\n </Show>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,IAAI,QAAQ,cAAc;AACnC,SACE,aAAa,EACb,UAAU,EACV,cAAc,EACd,GAAG,EAEH,SAAS,EACT,OAAO,EACP,QAAQ,IAAI,eAAe,EAC3B,IAAI,EACJ,UAAU,QACL,UAAU;AACjB,SAAS,OAAO,QAAQ,cAAc;AACtC,SAAS,kBAAkB,QAAQ,yBAAyB;AAC5D,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,YAAY,EAAE,UAAU,QAAQ,UAAU;AACnD,SAAS,SAAS,QAAQ,YAAY;AACtC,SAAS,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,QAAQ,SAAS;AACnD,SAAS,KAAK,EAAmB,OAAO,EAAE,aAAa,QAAQ,UAAU;;AAIzE;;AAsBA,MAAM,SAAS,GAAG;EAAE,IAAI,EAAE,WAAW;EAAE,GAAG,EAAE,UAAU;EAAE,IAAI,EAAE,WAAW;EAAE,IAAI,EAAE;AAAY,CAAU;AACvG,MAAM,WAAW,GAAG;EAAE,MAAM,EAAE,WAAW;EAAE,MAAM,EAAE;AAAY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
1
|
+
import { ssrElement as _$ssrElement } from "solid-js/web";
|
|
2
|
+
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
3
|
+
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
4
|
+
import { memo as _$memo } from "solid-js/web";
|
|
5
|
+
import { ssr as _$ssr } from "solid-js/web";
|
|
6
|
+
import { escape as _$escape } from "solid-js/web";
|
|
7
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
8
|
+
var _tmpl$ = ["<span class=\"k2-field-optional\">", "</span>"],
|
|
9
|
+
_tmpl$2 = ["<span class=\"k2-field-message\"", ">", "</span>"],
|
|
10
|
+
_tmpl$3 = ["<div class=\"k2-field\" data-k2-part=\"Field\" role=\"group\"", "><span class=\"k2-field-label\"", ">", "</span>", "", "</div>"],
|
|
11
|
+
_tmpl$4 = ["<div class=\"k2-field\" data-k2-part=\"Field\"><label class=\"k2-field-label\"", ">", "</label>", "", "</div>"],
|
|
12
|
+
_tmpl$5 = ["<div class=\"k2-frow\" data-k2-part=\"Field.Row\">", "</div>"],
|
|
13
|
+
_tmpl$6 = ["<span class=\"k2-input-end\">", "</span>"],
|
|
14
|
+
_tmpl$7 = ["<span class=\"k2-input\" data-k2-part=\"Input\"", ">", "", "", "</span>"],
|
|
15
|
+
_tmpl$8 = ["<option value>", "</option>"],
|
|
16
|
+
_tmpl$9 = ["<span class=\"k2-input\" data-k2-part=\"Select\" data-select", "><span class=\"k2-input-value\"", ">", "</span>", "<select class=\"k2-native-select\"", "", ">", "", "</select></span>"],
|
|
17
|
+
_tmpl$0 = ["<option", "", ">", "</option>"],
|
|
18
|
+
_tmpl$1 = ["<span class=\"k2-input\" data-k2-part=\"DateInput\"", "><input", " type=\"text\" inputmode=\"numeric\"", "", ">", "</span>"],
|
|
19
|
+
_tmpl$10 = ["<span class=\"k2-switch\"", " data-k2-mark></span>"],
|
|
20
|
+
_tmpl$11 = ["<label class=\"k2-choice\" data-k2-part=\"Check\"", "><span class=\"k2-mark\"><input class=\"k2-mark-input\" type=\"checkbox\"", "", "", "", ">", "</span><span class=\"k2-choice-text\">", "</span></label>"],
|
|
21
|
+
_tmpl$12 = ["<span class=\"k2-check\"", " data-k2-mark>", "</span>"],
|
|
22
|
+
_tmpl$13 = ["<span class=\"k2-mark\"><input class=\"k2-mark-input\" type=\"checkbox\"", "", "><span class=\"k2-check\"", " data-k2-mark>", "</span></span>"],
|
|
23
|
+
_tmpl$14 = ["<div class=\"k2-choices\" data-k2-part=\"Choice\" role=\"radiogroup\"", ">", "</div>"],
|
|
24
|
+
_tmpl$15 = ["<label class=\"k2-choice\"><span class=\"k2-mark\"><input class=\"k2-mark-input\" type=\"radio\"", "", "", "><span class=\"k2-radio\"", " data-k2-mark></span></span><span class=\"k2-choice-text\">", "</span></label>"];
|
|
25
|
+
import { createContext, createRenderEffect, createSignal, createUniqueId, For, children as resolveChildren, Show, useContext } from "solid-js";
|
|
26
|
+
import { Icon } from "./marks";
|
|
27
|
+
const FieldContext = createContext();
|
|
28
|
+
/**
|
|
29
|
+
* A field: a label line of 20 px, the control of 36 px, a hint or the error under it. The label line has a fixed
|
|
30
|
+
* height, so fields in a row stand on one line (rule K5).
|
|
31
|
+
*/
|
|
32
|
+
export const Field = props => {
|
|
33
|
+
const control = createUniqueId();
|
|
34
|
+
const label = createUniqueId();
|
|
35
|
+
const message = createUniqueId();
|
|
36
|
+
// The control is made first, so the field knows whether it labels one control or names a group of choices; the
|
|
37
|
+
// order is the same on the server and in the browser.
|
|
38
|
+
let grouped = false;
|
|
39
|
+
const content = _$createComponent(FieldContext.Provider, {
|
|
40
|
+
value: {
|
|
41
|
+
control,
|
|
42
|
+
label,
|
|
43
|
+
get invalid() {
|
|
44
|
+
return !!props.error;
|
|
45
|
+
},
|
|
46
|
+
get required() {
|
|
47
|
+
return props.required === true;
|
|
48
|
+
},
|
|
49
|
+
get name() {
|
|
50
|
+
return props.name;
|
|
51
|
+
},
|
|
52
|
+
get described() {
|
|
53
|
+
return props.error || props.hint ? message : undefined;
|
|
54
|
+
},
|
|
55
|
+
group: () => {
|
|
56
|
+
grouped = true;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
get children() {
|
|
60
|
+
return props.children;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
const labelLine = [props.label, _$createComponent(Show, {
|
|
64
|
+
get when() {
|
|
65
|
+
return props.optional;
|
|
66
|
+
},
|
|
67
|
+
get children() {
|
|
68
|
+
return _$ssr(_tmpl$, _$escape(props.optional));
|
|
69
|
+
}
|
|
70
|
+
})];
|
|
71
|
+
const messageLine = _$createComponent(Show, {
|
|
72
|
+
get when() {
|
|
73
|
+
return props.error ?? props.hint;
|
|
74
|
+
},
|
|
75
|
+
children: text => _$ssr(_tmpl$2, _$ssrAttribute("id", _$escape(message, true), false) + _$ssrAttribute("data-error", props.error ? "" : _$escape(undefined, true), false) + _$ssrAttribute("role", props.error ? "alert" : _$escape(undefined, true), false), _$escape(text()))
|
|
76
|
+
});
|
|
77
|
+
// A group of choices is named by its label line; one control is labelled by it.
|
|
78
|
+
return grouped ? _$ssr(_tmpl$3, _$ssrAttribute("aria-labelledby", _$escape(label, true), false), _$ssrAttribute("id", _$escape(label, true), false), _$escape(labelLine), _$escape(content), _$escape(messageLine)) : _$ssr(_tmpl$4, _$ssrAttribute("id", _$escape(label, true), false) + _$ssrAttribute("for", _$escape(control, true), false), _$escape(labelLine), _$escape(content), _$escape(messageLine));
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/** Fields side by side on one grid; one column on the phone. */
|
|
82
|
+
Field.Row = props => _$ssr(_tmpl$5, _$escape(props.children));
|
|
83
|
+
const useField = () => useContext(FieldContext);
|
|
84
|
+
/** Hands the text field to a `ref` prop; Solid turns `ref={variable}` into a function that sets the variable. */
|
|
85
|
+
const forwardRef = (ref, element) => {
|
|
86
|
+
if (typeof ref === "function") ref(element);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** A round text field: 36 px, 1 px edge, a blue ring on focus. In a field it takes its name and error. */
|
|
90
|
+
export const Input = props => {
|
|
91
|
+
const field = useField();
|
|
92
|
+
// the end is made once, here (reading the prop twice would make its JSX twice)
|
|
93
|
+
const end = resolveChildren(() => props.end);
|
|
94
|
+
const shared = () => ({
|
|
95
|
+
id: field?.control,
|
|
96
|
+
name: props.name ?? field?.name,
|
|
97
|
+
placeholder: props.placeholder,
|
|
98
|
+
value: props.value ?? "",
|
|
99
|
+
"aria-label": field ? undefined : props.label,
|
|
100
|
+
"aria-invalid": field?.invalid ? "true" : undefined,
|
|
101
|
+
"aria-describedby": field?.described,
|
|
102
|
+
required: field?.required || undefined
|
|
103
|
+
});
|
|
104
|
+
return _$ssr(_tmpl$7, _$ssrAttribute("data-invalid", field?.invalid ? "" : _$escape(undefined, true), false) + _$ssrAttribute("data-multiline", props.multiline ? "" : _$escape(undefined, true), false) + _$ssrAttribute("data-search", props.type === "search" ? "" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
|
|
105
|
+
get when() {
|
|
106
|
+
return props.icon;
|
|
107
|
+
},
|
|
108
|
+
children: name => _$createComponent(Icon, {
|
|
109
|
+
get name() {
|
|
110
|
+
return name();
|
|
111
|
+
}
|
|
112
|
+
})
|
|
113
|
+
})), _$escape(_$createComponent(Show, {
|
|
114
|
+
get when() {
|
|
115
|
+
return props.multiline;
|
|
116
|
+
},
|
|
117
|
+
get fallback() {
|
|
118
|
+
return _$ssrElement("input", _$mergeProps(shared, {
|
|
119
|
+
get type() {
|
|
120
|
+
return props.type ?? "text";
|
|
121
|
+
},
|
|
122
|
+
get min() {
|
|
123
|
+
return props.min;
|
|
124
|
+
},
|
|
125
|
+
get max() {
|
|
126
|
+
return props.max;
|
|
127
|
+
}
|
|
128
|
+
}), undefined, false);
|
|
129
|
+
},
|
|
130
|
+
get children() {
|
|
131
|
+
return _$ssrElement("textarea", _$mergeProps(shared), undefined, false);
|
|
132
|
+
}
|
|
133
|
+
})), _$escape(_$createComponent(Show, {
|
|
134
|
+
get when() {
|
|
135
|
+
return end() !== undefined;
|
|
136
|
+
},
|
|
137
|
+
get children() {
|
|
138
|
+
return _$ssr(_tmpl$6, _$escape(end()));
|
|
139
|
+
}
|
|
140
|
+
})));
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* The closed shape of a selection: the value and a chevron in the round field. (The list opens with the behaviour
|
|
144
|
+
* layer; until then it is a native select laid over the shape, so it works with the keyboard and in forms.) The
|
|
145
|
+
* shape always shows the value that is chosen now.
|
|
146
|
+
*/
|
|
147
|
+
export const Select = props => {
|
|
148
|
+
const field = useField();
|
|
149
|
+
const options = () => props.options.map(option => typeof option === "string" ? {
|
|
150
|
+
value: option,
|
|
151
|
+
label: option
|
|
152
|
+
} : option);
|
|
153
|
+
const [chosen, setChosen] = createSignal(props.value);
|
|
154
|
+
const value = () => props.onChange ? props.value : chosen();
|
|
155
|
+
const current = () => options().find(option => option.value === value());
|
|
156
|
+
return _$ssr(_tmpl$9, _$ssrAttribute("data-invalid", field?.invalid ? "" : _$escape(undefined, true), false), _$ssrAttribute("data-placeholder", current() ? _$escape(undefined, true) : "", false), _$escape(current()?.label ?? props.placeholder ?? ""), _$escape(_$createComponent(Icon, {
|
|
157
|
+
name: "chevron-down"
|
|
158
|
+
})), _$ssrAttribute("id", _$escape(field?.control, true), false) + _$ssrAttribute("name", _$escape(props.name ?? field?.name, true), false) + _$ssrAttribute("aria-label", field ? _$escape(undefined, true) : _$escape(props.label, true), false) + _$ssrAttribute("aria-invalid", field?.invalid ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-describedby", _$escape(field?.described, true), false), _$ssrAttribute("required", field?.required || undefined, true), _$escape(_$createComponent(Show, {
|
|
159
|
+
get when() {
|
|
160
|
+
return !current();
|
|
161
|
+
},
|
|
162
|
+
get children() {
|
|
163
|
+
return _$ssr(_tmpl$8, _$escape(props.placeholder ?? ""));
|
|
164
|
+
}
|
|
165
|
+
})), _$escape(_$createComponent(For, {
|
|
166
|
+
get each() {
|
|
167
|
+
return options();
|
|
168
|
+
},
|
|
169
|
+
children: option => _$ssr(_tmpl$0, _$ssrAttribute("value", _$escape(option.value, true), false), _$ssrAttribute("selected", option.value === value(), true), _$escape(option.label))
|
|
170
|
+
})));
|
|
171
|
+
};
|
|
172
|
+
/** The shape of a date field: the date and a calendar symbol. (The picker opens with the behaviour layer.) */
|
|
173
|
+
export const DateInput = props => {
|
|
174
|
+
const field = useField();
|
|
175
|
+
return _$ssr(_tmpl$1, _$ssrAttribute("data-invalid", field?.invalid ? "" : _$escape(undefined, true), false), _$ssrAttribute("id", _$escape(field?.control, true), false) + _$ssrAttribute("name", _$escape(props.name ?? field?.name, true), false), _$ssrAttribute("value", _$escape(props.value ?? "", true), false) + _$ssrAttribute("placeholder", _$escape(props.placeholder, true), false) + _$ssrAttribute("aria-label", field ? _$escape(undefined, true) : _$escape(props.label, true), false) + _$ssrAttribute("aria-invalid", field?.invalid ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-describedby", _$escape(field?.described, true), false), _$ssrAttribute("required", field?.required || undefined, true), _$escape(_$createComponent(Icon, {
|
|
176
|
+
name: "calendar"
|
|
177
|
+
})));
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* A box, or a switch, with its label. The mark takes exactly one 20 px text line and never aligns by baseline, so it
|
|
181
|
+
* sits on the same pixel empty, set and mixed (guard: mark-geometry).
|
|
182
|
+
*/
|
|
183
|
+
export const Check = props => {
|
|
184
|
+
const field = useField();
|
|
185
|
+
field?.group();
|
|
186
|
+
const [own, setOwn] = createSignal(props.checked);
|
|
187
|
+
// With `onChange` the caller holds the state; without, the box keeps it, so the mark always shows what is set.
|
|
188
|
+
const checked = () => props.onChange ? props.checked : own();
|
|
189
|
+
const set = () => checked() === true || checked() === "mixed";
|
|
190
|
+
return _$ssr(_tmpl$11, _$ssrAttribute("data-switch", props.switch ? "" : _$escape(undefined, true), false), _$ssrAttribute("role", props.switch ? "switch" : _$escape(undefined, true), false) + _$ssrAttribute("name", _$escape(props.name ?? field?.name, true), false), _$ssrAttribute("checked", checked() === true, true) + _$ssrAttribute("aria-describedby", _$escape(field?.described, true), false), _$ssrAttribute("required", field?.required || undefined, true), _$ssrAttribute("disabled", props.disabled, true), _$escape(_$createComponent(Show, {
|
|
191
|
+
get when() {
|
|
192
|
+
return props.switch;
|
|
193
|
+
},
|
|
194
|
+
get fallback() {
|
|
195
|
+
return _$ssr(_tmpl$12, _$ssrAttribute("data-checked", set() ? "" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
|
|
196
|
+
get when() {
|
|
197
|
+
return set();
|
|
198
|
+
},
|
|
199
|
+
get children() {
|
|
200
|
+
return _$createComponent(Icon, {
|
|
201
|
+
get name() {
|
|
202
|
+
return checked() === "mixed" ? "minus" : "check";
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
})));
|
|
207
|
+
},
|
|
208
|
+
get children() {
|
|
209
|
+
return _$ssr(_tmpl$10, _$ssrAttribute("data-checked", checked() === true ? "" : _$escape(undefined, true), false));
|
|
210
|
+
}
|
|
211
|
+
})), _$escape(props.label));
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* A box that is set for some of a group shows it as the browser's own third state (`indeterminate`), which assistive
|
|
216
|
+
* technology reads as "mixed"; it is a property of the box, not an attribute, so it follows in the browser.
|
|
217
|
+
*/
|
|
218
|
+
const mixed = (input, when) => {
|
|
219
|
+
createRenderEffect(() => {
|
|
220
|
+
input.indeterminate = when();
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
/** A box without visible words, named for assistive technology (internal: "select all", "select this row"). */
|
|
225
|
+
export const MarkCheck = props => _$ssr(_tmpl$13, _$ssrAttribute("aria-label", _$escape(props.label, true), false), _$ssrAttribute("checked", props.checked === true, true), _$ssrAttribute("data-checked", props.checked ? "" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
|
|
226
|
+
get when() {
|
|
227
|
+
return props.checked;
|
|
228
|
+
},
|
|
229
|
+
get children() {
|
|
230
|
+
return _$createComponent(Icon, {
|
|
231
|
+
get name() {
|
|
232
|
+
return props.checked === "mixed" ? "minus" : "check";
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
})));
|
|
237
|
+
/**
|
|
238
|
+
* A few visible options, one of which is chosen: round points, each on one 20 px text line. With a `label` and no
|
|
239
|
+
* Field around it, it stands in a field of its own, so its question is visible and names the group.
|
|
240
|
+
*/
|
|
241
|
+
export const Choice = props => {
|
|
242
|
+
if (!useField() && props.label !== undefined) return _$createComponent(Field, {
|
|
243
|
+
get label() {
|
|
244
|
+
return props.label;
|
|
245
|
+
},
|
|
246
|
+
get children() {
|
|
247
|
+
return _$createComponent(ChoiceGroup, props);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
return _$createComponent(ChoiceGroup, props);
|
|
251
|
+
};
|
|
252
|
+
const ChoiceGroup = props => {
|
|
253
|
+
const field = useField();
|
|
254
|
+
field?.group();
|
|
255
|
+
const options = () => props.options.map(option => typeof option === "string" ? {
|
|
256
|
+
value: option,
|
|
257
|
+
label: option
|
|
258
|
+
} : option);
|
|
259
|
+
const [own, setOwn] = createSignal(props.value);
|
|
260
|
+
const value = () => props.onChange ? props.value : own();
|
|
261
|
+
return _$ssr(_tmpl$14, _$ssrAttribute("aria-label", field ? _$escape(undefined, true) : _$escape(props.label, true), false) + _$ssrAttribute("aria-labelledby", _$escape(field?.label, true), false) + _$ssrAttribute("aria-describedby", _$escape(field?.described, true), false), _$escape(_$createComponent(For, {
|
|
262
|
+
get each() {
|
|
263
|
+
return options();
|
|
264
|
+
},
|
|
265
|
+
children: option => _$ssr(_tmpl$15, _$ssrAttribute("name", _$escape(props.name, true), false) + _$ssrAttribute("value", _$escape(option.value, true), false), _$ssrAttribute("checked", option.value === value(), true), _$ssrAttribute("required", field?.required || undefined, true), _$ssrAttribute("data-checked", option.value === value() ? "" : _$escape(undefined, true), false), _$escape(option.label))
|
|
266
|
+
})));
|
|
267
|
+
};
|
|
268
|
+
//# sourceMappingURL=controls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["v2/controls.tsx"],"sourcesContent":["import {\n createContext,\n createRenderEffect,\n createSignal,\n createUniqueId,\n For,\n type JSX,\n children as resolveChildren,\n Show,\n useContext,\n} from \"solid-js\";\nimport { Icon } from \"./marks\";\n\ntype FieldIds = {\n /** The id of the one control the label names. */\n control: string;\n /** The id of the label line. */\n label: string;\n invalid: boolean;\n required: boolean;\n name?: string;\n /** The id of the hint or error, while there is one. */\n described?: string;\n /** A control of several choices (Check, Choice) makes the field a named group instead of a labelled control. */\n group: () => void;\n};\nconst FieldContext = createContext<FieldIds>();\n\nexport type FieldProps = {\n label: string;\n /** The name the value is sent under; the control inside takes it. */\n name?: string;\n /** A quiet hint under the control. */\n hint?: string;\n /** The error at the field; it replaces the hint and marks the control. */\n error?: string;\n /** \"Optional\" or a unit, quiet at the end of the label line. */\n optional?: string;\n /**\n * The form is not sent without a value here: the control says so to the browser and to assistive technology. The\n * label line shows nothing for it; the fields that may stay empty say \"optional\" instead (as the mockup does).\n */\n required?: boolean;\n children: JSX.Element;\n};\n\n/**\n * A field: a label line of 20 px, the control of 36 px, a hint or the error under it. The label line has a fixed\n * height, so fields in a row stand on one line (rule K5).\n */\nexport const Field = (props: FieldProps) => {\n const control = createUniqueId();\n const label = createUniqueId();\n const message = createUniqueId();\n // The control is made first, so the field knows whether it labels one control or names a group of choices; the\n // order is the same on the server and in the browser.\n let grouped = false;\n const content = (\n <FieldContext.Provider\n value={{\n control,\n label,\n get invalid() {\n return !!props.error;\n },\n get required() {\n return props.required === true;\n },\n get name() {\n return props.name;\n },\n get described() {\n return props.error || props.hint ? message : undefined;\n },\n group: () => {\n grouped = true;\n },\n }}\n >\n {props.children}\n </FieldContext.Provider>\n );\n const labelLine = (\n <>\n {props.label}\n <Show when={props.optional}>\n <span class=\"k2-field-optional\">{props.optional}</span>\n </Show>\n </>\n );\n const messageLine = (\n <Show when={props.error ?? props.hint}>\n {(text) => (\n <span class=\"k2-field-message\" id={message} data-error={props.error ? \"\" : undefined} role={props.error ? \"alert\" : undefined}>\n {text()}\n </span>\n )}\n </Show>\n );\n // A group of choices is named by its label line; one control is labelled by it.\n return grouped ? (\n <div class=\"k2-field\" data-k2-part=\"Field\" role=\"group\" aria-labelledby={label}>\n <span class=\"k2-field-label\" id={label}>\n {labelLine}\n </span>\n {content}\n {messageLine}\n </div>\n ) : (\n <div class=\"k2-field\" data-k2-part=\"Field\">\n <label class=\"k2-field-label\" id={label} for={control}>\n {labelLine}\n </label>\n {content}\n {messageLine}\n </div>\n );\n};\n\n/** Fields side by side on one grid; one column on the phone. */\nField.Row = (props: { children: JSX.Element }) => (\n <div class=\"k2-frow\" data-k2-part=\"Field.Row\">\n {props.children}\n </div>\n);\n\nconst useField = () => useContext(FieldContext);\n\nexport type InputProps = {\n value?: string;\n placeholder?: string;\n type?: \"text\" | \"email\" | \"number\" | \"search\" | \"tel\" | \"url\" | \"password\";\n /** A Tabler icon before the text, such as `search`. */\n icon?: string;\n /** A text of several lines (80 px). */\n multiline?: boolean;\n min?: number;\n max?: number;\n name?: string;\n /** A name when the input stands without a Field, such as a search in a head. */\n label?: string;\n onInput?: (value: string) => void;\n /**\n * A key in the field, such as Enter to search or Escape to clear; the handler may call `preventDefault`. While\n * `event.isComposing` is true the key belongs to an input method (Japanese, Chinese, …): Enter then confirms the\n * characters and must not search.\n */\n onKeyDown?: (event: KeyboardEvent) => void;\n /**\n * The text field itself, to focus it (`input.focus()`) or select its text: `let input; <Input ref={input} />` or a\n * function that takes it.\n */\n ref?: HTMLInputElement | HTMLTextAreaElement | ((element: HTMLInputElement | HTMLTextAreaElement) => void);\n /** At the end inside the field: a symbol, or a ghost icon button such as the filter of a search. */\n end?: JSX.Element;\n};\n\n/** Hands the text field to a `ref` prop; Solid turns `ref={variable}` into a function that sets the variable. */\nconst forwardRef = (ref: InputProps[\"ref\"], element: HTMLInputElement | HTMLTextAreaElement) => {\n if (typeof ref === \"function\") ref(element);\n};\n\n/** A round text field: 36 px, 1 px edge, a blue ring on focus. In a field it takes its name and error. */\nexport const Input = (props: InputProps) => {\n const field = useField();\n // the end is made once, here (reading the prop twice would make its JSX twice)\n const end = resolveChildren(() => props.end);\n const shared = () => ({\n id: field?.control,\n name: props.name ?? field?.name,\n placeholder: props.placeholder,\n value: props.value ?? \"\",\n \"aria-label\": field ? undefined : props.label,\n \"aria-invalid\": field?.invalid ? (\"true\" as const) : undefined,\n \"aria-describedby\": field?.described,\n required: field?.required || undefined,\n });\n return (\n <span\n class=\"k2-input\"\n data-k2-part=\"Input\"\n data-invalid={field?.invalid ? \"\" : undefined}\n data-multiline={props.multiline ? \"\" : undefined}\n data-search={props.type === \"search\" ? \"\" : undefined}\n >\n <Show when={props.icon}>{(name) => <Icon name={name()} />}</Show>\n <Show\n when={props.multiline}\n fallback={\n <input\n {...shared()}\n ref={(element) => forwardRef(props.ref, element)}\n type={props.type ?? \"text\"}\n min={props.min}\n max={props.max}\n onInput={(event) => props.onInput?.(event.currentTarget.value)}\n onKeyDown={(event) => props.onKeyDown?.(event)}\n />\n }\n >\n <textarea\n {...shared()}\n ref={(element) => forwardRef(props.ref, element)}\n onInput={(event) => props.onInput?.(event.currentTarget.value)}\n onKeyDown={(event) => props.onKeyDown?.(event)}\n />\n </Show>\n <Show when={end() !== undefined}>\n <span class=\"k2-input-end\">{end()}</span>\n </Show>\n </span>\n );\n};\n\nexport type SelectProps = {\n options: readonly (string | { value: string; label: string })[];\n /** The chosen value. With `onChange` the caller holds it; without, the selection keeps the choice itself. */\n value?: string;\n onChange?: (value: string) => void;\n placeholder?: string;\n name?: string;\n label?: string;\n};\n\n/**\n * The closed shape of a selection: the value and a chevron in the round field. (The list opens with the behaviour\n * layer; until then it is a native select laid over the shape, so it works with the keyboard and in forms.) The\n * shape always shows the value that is chosen now.\n */\nexport const Select = (props: SelectProps) => {\n const field = useField();\n const options = () => props.options.map((option) => (typeof option === \"string\" ? { value: option, label: option } : option));\n const [chosen, setChosen] = createSignal(props.value);\n const value = () => (props.onChange ? props.value : chosen());\n const current = () => options().find((option) => option.value === value());\n return (\n <span class=\"k2-input\" data-k2-part=\"Select\" data-select=\"\" data-invalid={field?.invalid ? \"\" : undefined}>\n <span class=\"k2-input-value\" data-placeholder={current() ? undefined : \"\"}>\n {current()?.label ?? props.placeholder ?? \"\"}\n </span>\n <Icon name=\"chevron-down\" />\n <select\n class=\"k2-native-select\"\n id={field?.control}\n name={props.name ?? field?.name}\n aria-label={field ? undefined : props.label}\n aria-invalid={field?.invalid ? \"true\" : undefined}\n aria-describedby={field?.described}\n required={field?.required || undefined}\n onChange={(event) => {\n setChosen(event.currentTarget.value);\n props.onChange?.(event.currentTarget.value);\n }}\n >\n <Show when={!current()}>\n <option value=\"\">{props.placeholder ?? \"\"}</option>\n </Show>\n <For each={options()}>\n {(option) => (\n <option value={option.value} selected={option.value === value()}>\n {option.label}\n </option>\n )}\n </For>\n </select>\n </span>\n );\n};\n\nexport type DateInputProps = {\n value?: string;\n onInput?: (value: string) => void;\n placeholder?: string;\n name?: string;\n label?: string;\n};\n\n/** The shape of a date field: the date and a calendar symbol. (The picker opens with the behaviour layer.) */\nexport const DateInput = (props: DateInputProps) => {\n const field = useField();\n return (\n <span class=\"k2-input\" data-k2-part=\"DateInput\" data-invalid={field?.invalid ? \"\" : undefined}>\n <input\n id={field?.control}\n name={props.name ?? field?.name}\n type=\"text\"\n inputmode=\"numeric\"\n value={props.value ?? \"\"}\n placeholder={props.placeholder}\n aria-label={field ? undefined : props.label}\n aria-invalid={field?.invalid ? \"true\" : undefined}\n aria-describedby={field?.described}\n required={field?.required || undefined}\n onInput={(event) => props.onInput?.(event.currentTarget.value)}\n />\n <Icon name=\"calendar\" />\n </span>\n );\n};\n\nexport type CheckProps = {\n label: JSX.Element;\n name?: string;\n /** Set, not set, or mixed (some of a group). */\n checked?: boolean | \"mixed\";\n /** A switch instead of a box: on and off take effect at once. */\n switch?: boolean;\n disabled?: boolean;\n onChange?: (checked: boolean) => void;\n};\n\n/**\n * A box, or a switch, with its label. The mark takes exactly one 20 px text line and never aligns by baseline, so it\n * sits on the same pixel empty, set and mixed (guard: mark-geometry).\n */\nexport const Check = (props: CheckProps) => {\n const field = useField();\n field?.group();\n const [own, setOwn] = createSignal(props.checked);\n // With `onChange` the caller holds the state; without, the box keeps it, so the mark always shows what is set.\n const checked = () => (props.onChange ? props.checked : own());\n const set = () => checked() === true || checked() === \"mixed\";\n return (\n <label class=\"k2-choice\" data-k2-part=\"Check\" data-switch={props.switch ? \"\" : undefined}>\n <span class=\"k2-mark\">\n <input\n class=\"k2-mark-input\"\n type=\"checkbox\"\n role={props.switch ? \"switch\" : undefined}\n name={props.name ?? field?.name}\n checked={checked() === true}\n ref={(input) => mixed(input, () => checked() === \"mixed\")}\n aria-describedby={field?.described}\n required={field?.required || undefined}\n disabled={props.disabled}\n onChange={(event) => {\n setOwn(event.currentTarget.checked);\n props.onChange?.(event.currentTarget.checked);\n }}\n />\n <Show\n when={props.switch}\n fallback={\n <span class=\"k2-check\" data-checked={set() ? \"\" : undefined} data-k2-mark=\"\">\n <Show when={set()}>\n <Icon name={checked() === \"mixed\" ? \"minus\" : \"check\"} />\n </Show>\n </span>\n }\n >\n <span class=\"k2-switch\" data-checked={checked() === true ? \"\" : undefined} data-k2-mark=\"\" />\n </Show>\n </span>\n <span class=\"k2-choice-text\">{props.label}</span>\n </label>\n );\n};\n\n/**\n * A box that is set for some of a group shows it as the browser's own third state (`indeterminate`), which assistive\n * technology reads as \"mixed\"; it is a property of the box, not an attribute, so it follows in the browser.\n */\nconst mixed = (input: HTMLInputElement, when: () => boolean) => {\n createRenderEffect(() => {\n input.indeterminate = when();\n });\n};\n\n/** A box without visible words, named for assistive technology (internal: \"select all\", \"select this row\"). */\nexport const MarkCheck = (props: { label: string; checked?: boolean | \"mixed\"; onChange?: (checked: boolean) => void }) => (\n <span class=\"k2-mark\">\n <input\n class=\"k2-mark-input\"\n type=\"checkbox\"\n aria-label={props.label}\n checked={props.checked === true}\n ref={(input) => mixed(input, () => props.checked === \"mixed\")}\n onChange={(event) => props.onChange?.(event.currentTarget.checked)}\n />\n <span class=\"k2-check\" data-checked={props.checked ? \"\" : undefined} data-k2-mark=\"\">\n <Show when={props.checked}>\n <Icon name={props.checked === \"mixed\" ? \"minus\" : \"check\"} />\n </Show>\n </span>\n </span>\n);\n\nexport type ChoiceProps = {\n name: string;\n options: readonly (string | { value: string; label: string })[];\n value?: string;\n /** The question of the choice when it stands without a Field: shown as the label line of a field of its own. */\n label?: string;\n onChange?: (value: string) => void;\n};\n\n/**\n * A few visible options, one of which is chosen: round points, each on one 20 px text line. With a `label` and no\n * Field around it, it stands in a field of its own, so its question is visible and names the group.\n */\nexport const Choice = (props: ChoiceProps) => {\n if (!useField() && props.label !== undefined)\n return (\n <Field label={props.label}>\n <ChoiceGroup {...props} />\n </Field>\n );\n return <ChoiceGroup {...props} />;\n};\n\nconst ChoiceGroup = (props: ChoiceProps) => {\n const field = useField();\n field?.group();\n const options = () => props.options.map((option) => (typeof option === \"string\" ? { value: option, label: option } : option));\n const [own, setOwn] = createSignal(props.value);\n const value = () => (props.onChange ? props.value : own());\n return (\n <div\n class=\"k2-choices\"\n data-k2-part=\"Choice\"\n role=\"radiogroup\"\n aria-label={field ? undefined : props.label}\n aria-labelledby={field?.label}\n aria-describedby={field?.described}\n >\n <For each={options()}>\n {(option) => (\n <label class=\"k2-choice\">\n <span class=\"k2-mark\">\n <input\n class=\"k2-mark-input\"\n type=\"radio\"\n name={props.name}\n value={option.value}\n checked={option.value === value()}\n required={field?.required || undefined}\n onChange={() => {\n setOwn(option.value);\n props.onChange?.(option.value);\n }}\n />\n <span class=\"k2-radio\" data-checked={option.value === value() ? \"\" : undefined} data-k2-mark=\"\" />\n </span>\n <span class=\"k2-choice-text\">{option.label}</span>\n </label>\n )}\n </For>\n </div>\n );\n};\n"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