@smwb/ui-solid 2.0.0 → 2.1.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 +115 -0
- package/dist/assets/styles/less/components/appBar/appBar.entry.css +1 -1
- package/dist/assets/styles/less/components/avatar/avatar.entry.css +1 -1
- package/dist/assets/styles/less/components/breadcrumbs/breadcrumbs.entry.css +1 -1
- package/dist/assets/styles/less/components/button/button.entry.css +1 -1
- package/dist/assets/styles/less/components/buttonGroup/buttonGroup.entry.css +1 -1
- package/dist/assets/styles/less/components/dagView/dagView.entry.css +1 -1
- package/dist/assets/styles/less/components/meter/meter.entry.css +1 -1
- package/dist/assets/styles/less/components/screenDivider/screenDivider.entry.css +1 -1
- package/dist/assets/styles/less/components/sheet/sheet.entry.css +1 -1
- package/dist/assets/styles/less/components/statusDot/statusDot.entry.css +1 -1
- package/dist/assets/styles/less/components/tabGroups/tabGroups.entry.css +1 -1
- package/dist/assets/styles/less/components/tabs/tab/tab.entry.css +1 -1
- package/dist/assets/styles/less/components/toggle/toggle.entry.css +1 -1
- package/dist/assets/styles/less/components/treeView/treeView.entry.css +1 -1
- package/dist/assets/styles/less/tokens.entry.css +1 -1
- package/dist/components/dataDisplay/avatar/avatar.d.ts +5 -2
- package/dist/components/dataDisplay/avatar/avatar.js +9 -9
- package/dist/components/dataDisplay/avatar/avatar.js.map +1 -1
- package/dist/components/dataDisplay/chart/chart.d.ts +16 -8
- package/dist/components/dataDisplay/chart/chartFull.d.ts +14 -0
- package/dist/components/dataDisplay/chart/core.d.ts +19 -0
- package/dist/components/dataDisplay/chart/index.d.ts +1 -1
- package/dist/components/dataDisplay/dagView/dagView.d.ts +4 -0
- package/dist/components/dataDisplay/dagView/dagView.js +124 -123
- package/dist/components/dataDisplay/dagView/dagView.js.map +1 -1
- package/dist/components/dataDisplay/dagView/index.d.ts +1 -1
- package/dist/components/dataDisplay/meter/index.d.ts +1 -1
- package/dist/components/dataDisplay/meter/meter.d.ts +14 -0
- package/dist/components/dataDisplay/meter/meter.js +32 -30
- package/dist/components/dataDisplay/meter/meter.js.map +1 -1
- package/dist/components/dataDisplay/statusDot/index.d.ts +1 -1
- package/dist/components/dataDisplay/statusDot/statusDot.d.ts +10 -1
- package/dist/components/dataDisplay/statusDot/statusDot.js +20 -11
- package/dist/components/dataDisplay/statusDot/statusDot.js.map +1 -1
- package/dist/components/dataDisplay/treeView/treeView.d.ts +18 -2
- package/dist/components/dataDisplay/treeView/treeView.js +140 -121
- package/dist/components/dataDisplay/treeView/treeView.js.map +1 -1
- package/dist/components/inputs/button/button.d.ts +7 -0
- package/dist/components/inputs/button/button.js +57 -51
- package/dist/components/inputs/button/button.js.map +1 -1
- package/dist/components/inputs/toggle/toggle.d.ts +6 -0
- package/dist/components/inputs/toggle/toggle.js +23 -23
- package/dist/components/inputs/toggle/toggle.js.map +1 -1
- package/dist/components/layout/appLayout/appLayout.d.ts +6 -1
- package/dist/components/layout/appLayout/appLayout.js +49 -42
- package/dist/components/layout/appLayout/appLayout.js.map +1 -1
- package/dist/components/layout/screenDivider/screenDivider.d.ts +12 -0
- package/dist/components/layout/screenDivider/screenDivider.js +87 -46
- package/dist/components/layout/screenDivider/screenDivider.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +11 -0
- package/dist/components/layout/sheet/sheet.js +122 -102
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/tabGroups/index.d.ts +1 -1
- package/dist/components/layout/tabGroups/tabGroups.d.ts +44 -1
- package/dist/components/layout/tabGroups/tabGroups.js +500 -460
- package/dist/components/layout/tabGroups/tabGroups.js.map +1 -1
- package/dist/components/layout/tabGroups/tabGroupsFocus.d.ts +16 -0
- package/dist/components/layout/tabGroups/tabGroupsFocus.js +102 -70
- package/dist/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
- package/dist/components/navigation/appBar/appBar.d.ts +12 -0
- package/dist/components/navigation/appBar/appBar.js.map +1 -1
- package/dist/components/navigation/breadcrumbs/breadcrumbs.d.ts +9 -0
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js +47 -31
- package/dist/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/components/navigation/tabs/tab/tab.js +71 -68
- package/dist/components/navigation/tabs/tab/tab.js.map +1 -1
- package/dist/components/navigation/tabs/tabs.d.ts +11 -0
- package/dist/components/navigation/tabs/tabs.js +19 -16
- package/dist/components/navigation/tabs/tabs.js.map +1 -1
- package/dist/components/navigation/tabs/tabsContext.d.ts +2 -0
- package/dist/components/navigation/tabs/tabsContext.js.map +1 -1
- package/dist/headless/components/dataDisplay/avatar/avatar.js +9 -9
- package/dist/headless/components/dataDisplay/avatar/avatar.js.map +1 -1
- package/dist/headless/components/dataDisplay/dagView/dagView.js +133 -132
- package/dist/headless/components/dataDisplay/dagView/dagView.js.map +1 -1
- package/dist/headless/components/dataDisplay/meter/meter.js +32 -30
- package/dist/headless/components/dataDisplay/meter/meter.js.map +1 -1
- package/dist/headless/components/dataDisplay/statusDot/statusDot.js +19 -10
- package/dist/headless/components/dataDisplay/statusDot/statusDot.js.map +1 -1
- package/dist/headless/components/dataDisplay/treeView/treeView.js +139 -120
- package/dist/headless/components/dataDisplay/treeView/treeView.js.map +1 -1
- package/dist/headless/components/inputs/button/button.js +57 -51
- package/dist/headless/components/inputs/button/button.js.map +1 -1
- package/dist/headless/components/inputs/toggle/toggle.js +23 -23
- package/dist/headless/components/inputs/toggle/toggle.js.map +1 -1
- package/dist/headless/components/layout/appLayout/appLayout.js +52 -45
- package/dist/headless/components/layout/appLayout/appLayout.js.map +1 -1
- package/dist/headless/components/layout/screenDivider/screenDivider.js +88 -47
- package/dist/headless/components/layout/screenDivider/screenDivider.js.map +1 -1
- package/dist/headless/components/layout/sheet/sheet.js +124 -104
- package/dist/headless/components/layout/sheet/sheet.js.map +1 -1
- package/dist/headless/components/layout/tabGroups/tabGroups.js +500 -460
- package/dist/headless/components/layout/tabGroups/tabGroups.js.map +1 -1
- package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js +102 -70
- package/dist/headless/components/layout/tabGroups/tabGroupsFocus.js.map +1 -1
- package/dist/headless/components/navigation/appBar/appBar.js.map +1 -1
- package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js +46 -30
- package/dist/headless/components/navigation/breadcrumbs/breadcrumbs.js.map +1 -1
- package/dist/headless/components/navigation/tabs/tab/tab.js +70 -67
- package/dist/headless/components/navigation/tabs/tab/tab.js.map +1 -1
- package/dist/headless/components/navigation/tabs/tabs.js +19 -16
- package/dist/headless/components/navigation/tabs/tabs.js.map +1 -1
- package/dist/headless/components/navigation/tabs/tabsContext.js.map +1 -1
- package/dist/headless/primitives/publishHeaderOffset.js +19 -0
- package/dist/headless/primitives/publishHeaderOffset.js.map +1 -0
- package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx +1 -0
- package/dist/headless/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
- package/dist/headless/source/components/dataDisplay/chart/chart.jsx +14 -12
- package/dist/headless/source/components/dataDisplay/chart/chart.jsx.map +1 -1
- package/dist/headless/source/components/dataDisplay/chart/chartFull.js +12 -0
- package/dist/headless/source/components/dataDisplay/chart/chartFull.js.map +7 -0
- package/dist/headless/source/components/dataDisplay/chart/core.js +11 -0
- package/dist/headless/source/components/dataDisplay/chart/core.js.map +7 -0
- package/dist/headless/source/components/dataDisplay/chart/index.js +1 -1
- package/dist/headless/source/components/dataDisplay/chart/index.js.map +1 -1
- package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx +2 -1
- package/dist/headless/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
- package/dist/headless/source/components/dataDisplay/dagView/index.js.map +2 -2
- package/dist/headless/source/components/dataDisplay/meter/index.js.map +1 -1
- package/dist/headless/source/components/dataDisplay/meter/meter.jsx +14 -2
- package/dist/headless/source/components/dataDisplay/meter/meter.jsx.map +1 -1
- package/dist/headless/source/components/dataDisplay/statusDot/index.js.map +1 -1
- package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
- package/dist/headless/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
- package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx +16 -3
- package/dist/headless/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
- package/dist/headless/source/components/inputs/button/button.jsx +26 -1
- package/dist/headless/source/components/inputs/button/button.jsx.map +1 -1
- package/dist/headless/source/components/inputs/toggle/toggle.jsx +9 -2
- package/dist/headless/source/components/inputs/toggle/toggle.jsx.map +1 -1
- package/dist/headless/source/components/layout/appLayout/appLayout.jsx +14 -2
- package/dist/headless/source/components/layout/appLayout/appLayout.jsx.map +1 -1
- package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx +102 -18
- package/dist/headless/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
- package/dist/headless/source/components/layout/sheet/sheet.jsx +14 -1
- package/dist/headless/source/components/layout/sheet/sheet.jsx.map +1 -1
- package/dist/headless/source/components/layout/tabGroups/index.js.map +1 -1
- package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx +55 -1
- package/dist/headless/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
- package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
- package/dist/headless/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
- package/dist/headless/source/components/navigation/appBar/appBar.jsx.map +1 -1
- package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
- package/dist/headless/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
- package/dist/headless/source/components/navigation/tabs/tab/tab.jsx +7 -1
- package/dist/headless/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
- package/dist/headless/source/components/navigation/tabs/tabs.jsx +5 -1
- package/dist/headless/source/components/navigation/tabs/tabs.jsx.map +1 -1
- package/dist/headless/source/components/navigation/tabs/tabsContext.js.map +2 -2
- package/dist/headless/source/index.js +8 -1
- package/dist/headless/source/index.js.map +2 -2
- package/dist/headless/source/primitives/publishHeaderOffset.js +34 -0
- package/dist/headless/source/primitives/publishHeaderOffset.js.map +7 -0
- package/dist/index.d.ts +5 -5
- package/dist/primitives/publishHeaderOffset.d.ts +7 -0
- package/dist/primitives/publishHeaderOffset.js +19 -0
- package/dist/primitives/publishHeaderOffset.js.map +1 -0
- package/dist/source/components/dataDisplay/avatar/avatar.jsx +1 -0
- package/dist/source/components/dataDisplay/avatar/avatar.jsx.map +1 -1
- package/dist/source/components/dataDisplay/chart/chart.jsx +14 -12
- package/dist/source/components/dataDisplay/chart/chart.jsx.map +1 -1
- package/dist/source/components/dataDisplay/chart/chartFull.js +12 -0
- package/dist/source/components/dataDisplay/chart/chartFull.js.map +7 -0
- package/dist/source/components/dataDisplay/chart/core.js +11 -0
- package/dist/source/components/dataDisplay/chart/core.js.map +7 -0
- package/dist/source/components/dataDisplay/chart/index.js +1 -1
- package/dist/source/components/dataDisplay/chart/index.js.map +1 -1
- package/dist/source/components/dataDisplay/dagView/dagView.jsx +2 -1
- package/dist/source/components/dataDisplay/dagView/dagView.jsx.map +1 -1
- package/dist/source/components/dataDisplay/dagView/index.js.map +2 -2
- package/dist/source/components/dataDisplay/meter/index.js.map +1 -1
- package/dist/source/components/dataDisplay/meter/meter.jsx +14 -2
- package/dist/source/components/dataDisplay/meter/meter.jsx.map +1 -1
- package/dist/source/components/dataDisplay/statusDot/index.js.map +1 -1
- package/dist/source/components/dataDisplay/statusDot/statusDot.jsx +13 -1
- package/dist/source/components/dataDisplay/statusDot/statusDot.jsx.map +1 -1
- package/dist/source/components/dataDisplay/treeView/treeView.jsx +16 -3
- package/dist/source/components/dataDisplay/treeView/treeView.jsx.map +1 -1
- package/dist/source/components/inputs/button/button.jsx +26 -1
- package/dist/source/components/inputs/button/button.jsx.map +1 -1
- package/dist/source/components/inputs/toggle/toggle.jsx +9 -2
- package/dist/source/components/inputs/toggle/toggle.jsx.map +1 -1
- package/dist/source/components/layout/appLayout/appLayout.jsx +14 -2
- package/dist/source/components/layout/appLayout/appLayout.jsx.map +1 -1
- package/dist/source/components/layout/screenDivider/screenDivider.jsx +102 -18
- package/dist/source/components/layout/screenDivider/screenDivider.jsx.map +1 -1
- package/dist/source/components/layout/sheet/sheet.jsx +14 -1
- package/dist/source/components/layout/sheet/sheet.jsx.map +1 -1
- package/dist/source/components/layout/tabGroups/index.js.map +1 -1
- package/dist/source/components/layout/tabGroups/tabGroups.jsx +55 -1
- package/dist/source/components/layout/tabGroups/tabGroups.jsx.map +1 -1
- package/dist/source/components/layout/tabGroups/tabGroupsFocus.js +42 -0
- package/dist/source/components/layout/tabGroups/tabGroupsFocus.js.map +2 -2
- package/dist/source/components/navigation/appBar/appBar.jsx.map +1 -1
- package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx +39 -4
- package/dist/source/components/navigation/breadcrumbs/breadcrumbs.jsx.map +1 -1
- package/dist/source/components/navigation/tabs/tab/tab.jsx +7 -1
- package/dist/source/components/navigation/tabs/tab/tab.jsx.map +1 -1
- package/dist/source/components/navigation/tabs/tabs.jsx +5 -1
- package/dist/source/components/navigation/tabs/tabs.jsx.map +1 -1
- package/dist/source/components/navigation/tabs/tabsContext.js.map +2 -2
- package/dist/source/index.js +8 -1
- package/dist/source/index.js.map +2 -2
- package/dist/source/primitives/publishHeaderOffset.js +34 -0
- package/dist/source/primitives/publishHeaderOffset.js.map +7 -0
- package/package.json +9 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/components/navigation/tabs/tabs.tsx"],"sourcesContent":["import {\n type Accessor,\n type JSX,\n type ParentProps,\n For,\n Show,\n children,\n createComputed,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n mergeProps,\n on,\n onCleanup,\n onMount,\n splitProps,\n} from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport cn from \"clsx\";\nimport { debounce } from \"../../../utils/debounce\";\nimport { animate } from \"../../../utils/animate\";\nimport { matchesKeyboardShortcut } from \"../../../utils/keyboardShortcut\";\nimport { TabsContext, type TabInfo, type TabsContextValue } from \"./tabsContext\";\nimport { Tab } from \"./tab/tab\";\nimport { getHiddenIndexes } from \"./tabs.utils\";\nimport { Menu } from \"../menu\";\nimport { MenuItem } from \"../menu/menuItem\";\nimport { Icon } from \"../../base/icon\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\nimport { createRovingTabIndex } from \"../../../primitives/createRovingTabIndex\";\n\n/**\n * Tabs follow the WAI-ARIA tabs pattern with manual activation. The selected tab is the row's one\n * tab stop (`tabindex` 0, the others -1). The arrow keys along the row's `orientation` move focus to\n * the next or the previous tab (wrapping at the ends), Home and End to the first and the last one;\n * disabled tabs are skipped. Enter or Space then selects the focused tab, as a click does:\n * `onChange` is called for it, with the key's click. Moving focus changes nothing by itself, so a\n * row of link tabs does not navigate as the arrows pass them. Tab leaves the row for what follows\n * it, the selected `TabPanel` first when `panels` are given.\n *\n * A `Tab` can be `closable` and take `actions`; they sit beside the tab and out of the Tab order.\n * Delete on the focused tab, its close button or its `actions` (through `close`) ask `onClose` to\n * close it, and when it goes, focus moves to the tab that takes its place instead of falling to the\n * page. A middle click on a closable tab closes it too.\n *\n * With `onReorder` the row's tabs drag onto one another to reorder: `onReorder(from, to)` reports\n * the drop and the owner moves the tabs; dropping the selected tab reports its new index through\n * `onChange` as well, so the selection follows the moved tab. With `overflowMenu` a scrollable\n * row that overflows gains\n * a trigger beside it listing the clipped tabs. The chords Mod+W (close the focused closable tab)\n * and Mod+Shift+[ / Mod+Shift+] (switch to the previous / next tab) are handled on the row, as\n * best-effort: a browser of its own tabs reserves them.\n */\nexport interface TabsProps {\n /**\n * Index of the selected tab: its position in the row. Tabs count in the order they\n * render, so a tab behind a `<Show>` that is off takes no index, and tabs added,\n * removed or reordered count by their new place.\n */\n value: number;\n /**\n * Called with the index of the clicked tab, counted as for `value`. A tab chosen from the keyboard\n * (Enter or Space on the focused tab) calls it with that click too. A modified or non-primary\n * click (Ctrl, Meta, Shift or Alt held, or a button other than the main one) on a link tab\n * (`Tab` with `href`) is the browser's, as \"open in a new tab\": it does not call `onChange`.\n */\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Which way the tabs run. It sets `aria-orientation` on the tab list and picks the arrow keys that\n * move between tabs: Left and Right when horizontal, Up and Down when vertical. The styles draw\n * a horizontal row; a vertical list is yours to lay out.\n */\n orientation?: \"horizontal\" | \"vertical\";\n /**\n * The content of the tabs: `TabPanel`s, rendered after the tab row. With them each tab gets\n * `aria-controls` its panel and each panel `aria-labelledby` its tab. Without them the tabs link\n * to nothing, as before. Give a panel to every tab: a tab whose panel is left out still names it.\n * A `TabPanel` placed anywhere else is not linked to the tabs and is always shown.\n */\n panels?: JSX.Element;\n /**\n * Base of the ids that link tabs and panels: tab `n` is `{id}-tab-{n}`, its panel `{id}-panel-{n}`.\n * It is also the id of the root element. A generated one by default.\n */\n id?: string;\n /** Draw the indicator as wide as the selected tab's label rather than the whole tab. */\n indicatorContent?: boolean;\n /**\n * Let the tab row scroll sideways instead of clipping it. The edge beyond which\n * more tabs are hidden fades out.\n */\n scrollable?: boolean;\n /**\n * With `scrollable`: buttons at both ends that scroll the row while it overflows. They are for\n * the pointer and stay out of the Tab order: the arrow keys reach every tab and scroll it into\n * view.\n */\n scrollButtons?: boolean;\n /**\n * Present ⇒ the row is reorderable by dragging a tab onto another (pointer-only; there is no\n * keyboard reorder). `Tabs` does not move the tabs itself: it reports the drag with\n * `onReorder(from, to)` — indexes counted as for `value` — and the owner reorders its state.\n * The tabs keep their focus through a reorder; when the moved tab is the selected one,\n * `onChange` reports its new index too, so a controlled owner keeps it selected. That `onChange`\n * carries the drop's own event standing in for the click's: the index argument is authoritative —\n * `currentTarget` is the scroll area the drop delegates to, not the tab.\n */\n onReorder?: (from: number, to: number) => void;\n /**\n * With `scrollable`: when the row overflows, a trigger button is rendered beside the scroller\n * (in the scroll buttons' spot) that opens a menu of the tabs the viewport clips — any clipped\n * part beyond a 1px tolerance counts. Each entry shows the tab's icon and label, the selected one is marked\n * `aria-current=\"true\"`, and choosing one calls `onChange` for it and scrolls it into view.\n * The trigger appears only after the browser has measured an overflow, so the server markup\n * shows none.\n */\n overflowMenu?: boolean;\n /** Accessible label of the overflow-menu trigger. English by default; set it to localise. */\n overflowMenuAriaLabel?: string;\n /**\n * Compact tabs: a shorter row — `--smui-tabDenseHeight` (36px) — with labels as written (no\n * capitals, no letter spacing) and less padding.\n */\n dense?: boolean;\n /** Accessible label of the button that scrolls back. */\n scrollBackAriaLabel?: string;\n /** Accessible label of the button that scrolls forward. */\n scrollForwardAriaLabel?: string;\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\ninterface IndicatorStyle {\n root: { left?: number; width?: number };\n content?: { width: number };\n}\n\nconst VIEW_NEXT_TAB_PX = 40;\n/** A scroll button moves the row by this share of its visible width. */\nconst SCROLL_PAGE = 0.8;\n\n/** What Tabs knows of each of its tabs. */\ninterface Registration extends TabInfo {\n index: Accessor<number>;\n}\n\n/**\n * The tab list's children, resolved once, with their elements reported in order\n * whenever they change. It renders inside the context provider, so the tabs it\n * creates find their Tabs.\n */\nfunction TabListItems(props: { children?: JSX.Element; onItems: (items: Element[]) => void }): JSX.Element {\n const resolved = children(() => props.children);\n if (!isServer) {\n createComputed(() => props.onItems(resolved.toArray().filter((node) => node instanceof Element)));\n }\n return <>{resolved()}</>;\n}\n\n/**\n * The `panels`, resolved once, inside the context provider so that the panels find their Tabs, and\n * before the tab row renders so that the tabs know whether they control anything. It draws\n * nothing itself: Tabs places what it reports after the row.\n */\nfunction PanelsResolver(props: {\n children?: JSX.Element;\n onPanels: (panels: JSX.Element, has: boolean) => void;\n}): null {\n const resolved = children(() => props.children);\n createComputed(() =>\n props.onPanels(\n resolved(),\n resolved.toArray().some((node) => node != null && node !== false && node !== \"\")\n )\n );\n return null;\n}\n\nexport function Tabs(props: ParentProps<TabsProps>): JSX.Element {\n const merged = mergeProps(\n {\n indicatorContent: false,\n scrollable: false,\n scrollButtons: false,\n overflowMenu: false,\n dense: false,\n orientation: \"horizontal\" as const,\n scrollBackAriaLabel: \"Scroll tabs back\",\n scrollForwardAriaLabel: \"Scroll tabs forward\",\n overflowMenuAriaLabel: \"More tabs\",\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"children\",\n \"onChange\",\n \"value\",\n \"indicatorContent\",\n \"scrollable\",\n \"scrollButtons\",\n \"onReorder\",\n \"overflowMenu\",\n \"overflowMenuAriaLabel\",\n \"dense\",\n \"orientation\",\n \"panels\",\n \"id\",\n \"scrollBackAriaLabel\",\n \"scrollForwardAriaLabel\",\n \"aria-label\",\n \"ref\",\n ]);\n\n const generatedId = createUniqueId();\n const baseId = (): string => local.id ?? generatedId;\n const [registrations, setRegistrations] = createSignal<Registration[]>([]);\n // A tab's own id is the one its panel is labelled by.\n const tabId = (index: number): string =>\n registrations()\n .find((registration) => registration.index() === index)\n ?.id() ?? `${baseId()}-tab-${index}`;\n const panelId = (index: number): string => `${baseId()}-panel-${index}`;\n const [panels, setPanels] = createSignal<JSX.Element>();\n const [hasPanels, setHasPanels] = createSignal(false);\n // The tab that has focus while focus is in the tab list: it is the row's tab stop then, so\n // Tab from there leaves the row instead of landing on the selected tab again.\n const [focusedIndex, setFocusedIndex] = createSignal<number | null>(null);\n\n const [mounted, setMounted] = createSignal(false);\n const [indicatorStyle, setIndicatorStyle] = createSignal<IndicatorStyle>({ root: {} });\n // Whether tabs are hidden past the start / the end of a scrollable row. Only\n // measured in the browser, so the server markup shows neither.\n const [overflowStart, setOverflowStart] = createSignal(false);\n const [overflowEnd, setOverflowEnd] = createSignal(false);\n // The indexes of the tabs the scroller's viewport clips: what the overflow menu lists.\n // Empty on the server and until the first measurement, like the overflow state.\n const [hiddenIndexes, setHiddenIndexes] = createSignal<number[]>([]);\n // The overflow-menu trigger and its menu, composed here when `overflowMenu` is on.\n const [overflowOpen, setOverflowOpen] = createSignal(false);\n let overflowTriggerEl: HTMLButtonElement | undefined;\n\n let tabsEl: HTMLDivElement | undefined;\n let tabListEl: HTMLDivElement | undefined;\n // The tab the user asked to close while it, or something beside it, had focus: its item, which\n // goes with it, and its place. If it goes while focus is lost with it, focus moves on to a neighbour.\n let closingTab: { item: Element; index: number } | null = null;\n // The tab list's elements in order, known once its children have resolved in\n // the browser. Before that, and on the server, a tab's index is the order it\n // was created in, which is its order in the markup.\n const [items, setItems] = createSignal<Element[]>();\n let created = 0;\n\n const getTabsMeta = () => {\n let tabsMeta: { clientWidth: number; scrollLeft: number; left: number; right: number } | undefined;\n if (tabsEl) {\n const rect = tabsEl.getBoundingClientRect();\n tabsMeta = { clientWidth: tabsEl.clientWidth, scrollLeft: tabsEl.scrollLeft, left: rect.left, right: rect.right };\n }\n let tabMeta: DOMRect | null = null;\n let tabContentMeta: DOMRect | null = null;\n if (tabsEl && tabListEl && tabListEl.children.length > 0) {\n const tab = tabListEl.children[local.value];\n tabMeta = tab ? tab.getBoundingClientRect() : null;\n if (local.indicatorContent) {\n tabContentMeta = tab?.querySelector(\".smwb-tab__content\")?.getBoundingClientRect() ?? null;\n }\n }\n return { tabsMeta, tabMeta, tabContentMeta };\n };\n\n const updateIndicatorState = (): void => {\n const { tabsMeta, tabMeta, tabContentMeta } = getTabsMeta();\n let startValue = 0;\n if (tabMeta && tabsMeta) {\n startValue = tabMeta.left - tabsMeta.left + tabsMeta.scrollLeft;\n }\n const next: IndicatorStyle = { root: { left: startValue, width: tabMeta ? tabMeta.width : 0 } };\n if (local.indicatorContent && tabContentMeta) {\n next.content = { width: tabContentMeta.width };\n }\n const prev = indicatorStyle();\n if (prev.root.left === undefined || prev.root.width === undefined) {\n setIndicatorStyle(next);\n return;\n }\n const dStart = Math.abs((prev.root.left ?? 0) - (next.root.left ?? 0));\n const dSize = Math.abs((prev.root.width ?? 0) - (next.root.width ?? 0));\n if (dStart >= 1 || dSize >= 1) {\n setIndicatorStyle(next);\n }\n };\n\n const updateOverflow = (): void => {\n if (!tabsEl || !local.scrollable) {\n setOverflowStart(false);\n setOverflowEnd(false);\n setHiddenIndexes((prev) => (prev.length === 0 ? prev : []));\n return;\n }\n const max = tabsEl.scrollWidth - tabsEl.clientWidth;\n setOverflowStart(tabsEl.scrollLeft > 1);\n setOverflowEnd(tabsEl.scrollLeft < max - 1);\n // Which tabs the viewport clips, measured the same way: the scroller is `position: relative`,\n // so a tab's `offsetLeft` is its place in the row's content. Only the menu needs the list,\n // so nothing is measured without it. Kept by identity when unchanged, because this runs on\n // every scroll tick.\n const hidden = local.overflowMenu\n ? getHiddenIndexes(\n tabListEl\n ? Array.from(tabListEl.children).map((child) => {\n const item = child as HTMLElement;\n return { offsetLeft: item.offsetLeft, offsetWidth: item.offsetWidth };\n })\n : [],\n tabsEl.scrollLeft,\n tabsEl.clientWidth\n )\n : [];\n setHiddenIndexes((prev) =>\n prev.length === hidden.length && prev.every((index, at) => index === hidden[at]) ? prev : hidden\n );\n };\n\n const scroll = (scrollValue: number): void => {\n if (!tabsEl) return;\n animate(tabsEl, \"scrollLeft\", scrollValue, { duration: 300 });\n };\n\n const scrollByPage = (direction: -1 | 1): void => {\n if (!tabsEl) return;\n scroll(tabsEl.scrollLeft + direction * tabsEl.clientWidth * SCROLL_PAGE);\n };\n\n const scrollIndexIntoView = (index: number): void => {\n if (!tabsEl || !tabListEl) return;\n const tab = tabListEl.children[index];\n if (!tab) return;\n const tabsRect = tabsEl.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n if (tabRect.left < tabsRect.left) {\n scroll(tabsEl.scrollLeft + (tabRect.left - tabsRect.left) - VIEW_NEXT_TAB_PX);\n } else if (tabRect.right > tabsRect.right) {\n scroll(tabsEl.scrollLeft + (tabRect.right - tabsRect.right) + VIEW_NEXT_TAB_PX);\n }\n };\n\n const scrollSelectedIntoView = (): void => {\n scrollIndexIntoView(local.value);\n };\n\n onMount(() => setMounted(true));\n\n // Re-measure when the active value or the tabs change (and on mount).\n createEffect(\n on([() => local.value, items], () => {\n updateIndicatorState();\n updateOverflow();\n })\n );\n\n // Keep the indicator and the overflow state in sync with resizes: of the\n // window, of the row, and of each tab (a label can grow with its data).\n onMount(() => {\n const onResize = debounce(() => {\n updateIndicatorState();\n updateOverflow();\n }, 166);\n const view = tabsEl?.ownerDocument.defaultView;\n view?.addEventListener(\"resize\", onResize);\n tabsEl?.addEventListener(\"scroll\", updateOverflow, { passive: true });\n let resizeObserver: ResizeObserver | undefined;\n if (typeof ResizeObserver !== \"undefined\" && tabListEl) {\n resizeObserver = new ResizeObserver(onResize);\n if (tabsEl) resizeObserver.observe(tabsEl);\n Array.from(tabListEl.children).forEach((child) => resizeObserver?.observe(child));\n }\n updateOverflow();\n onCleanup(() => {\n onResize.cancel();\n view?.removeEventListener(\"resize\", onResize);\n tabsEl?.removeEventListener(\"scroll\", updateOverflow);\n resizeObserver?.disconnect();\n });\n });\n\n // Scroll the selected tab into view when the indicator moves.\n createEffect(() => {\n indicatorStyle();\n scrollSelectedIntoView();\n });\n\n // The tabs in the DOM, by what they are: their indexes are the ones `value` counts.\n const getTabNodes = (): HTMLElement[] => Array.from(tabListEl?.querySelectorAll<HTMLElement>('[role=\"tab\"]') ?? []);\n // A tab with a close button or actions sits in an item with them: focus on any of it is focus on the tab.\n const itemOf = (tab: HTMLElement): HTMLElement => tab.closest<HTMLElement>(\".smwb-tab-item\") ?? tab;\n const indexOfFocus = (target: Node | null | undefined): number =>\n target ? getTabNodes().findIndex((node) => itemOf(node).contains(target)) : -1;\n const isNodeDisabled = (node: HTMLElement | undefined): boolean =>\n !node || node.getAttribute(\"aria-disabled\") === \"true\" || (node as HTMLButtonElement).disabled === true;\n\n // The selected tab is the stop; a value that points at no tab leaves the first one, and a\n // disabled one, which cannot take focus, leaves the first tab that can.\n const selectedStop = (): number => {\n const count = items()?.length;\n const candidate = count === undefined || (local.value >= 0 && local.value < count) ? local.value : 0;\n const list = registrations();\n if (!list.some((registration) => registration.index() === candidate && registration.disabled())) return candidate;\n const enabled = list\n .filter((registration) => !registration.disabled())\n .map((registration) => registration.index())\n .filter((index) => index >= 0);\n return enabled.length > 0 ? Math.min(...enabled) : candidate;\n };\n const stopIndex = (): number => focusedIndex() ?? selectedStop();\n\n const onRovingKeyDown = createRovingTabIndex({\n count: () => getTabNodes().length,\n activeIndex: stopIndex,\n get orientation() {\n return local.orientation;\n },\n onMove: (next) => getTabNodes()[next]?.focus(),\n isDisabled: (index) => isNodeDisabled(getTabNodes()[index]),\n });\n\n // Drag-to-reorder (with `onReorder`): the drag's source and drop target are the tab items,\n // tracked here on the row; Tabs only reports `onReorder(from, to)` — and, when the moved tab\n // is the selected one, its new index through `onChange` — and keeps the tabs' focus alone;\n // the owner moves the tabs in its state.\n // Only while `onReorder` is given do the items carry `draggable`, and a disabled tab\n // never: the attribute is rendered declaratively by each `Tab` on its item (the wrapper,\n // or the bare tab when there is none), so it is part of the server markup — as in React.\n let dragSourceIndex: number | null = null;\n let draggingItem: HTMLElement | null = null;\n let dropTargetItem: HTMLElement | null = null;\n const dragItemOf = (target: EventTarget | null): HTMLElement | null =>\n target instanceof Element ? itemOf(target as HTMLElement) : null;\n const clearDragMarks = (): void => {\n draggingItem?.classList.remove(\"smwb-tab-item--dragging\");\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n draggingItem = null;\n dropTargetItem = null;\n };\n\n const onItemDragStart: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (!local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n const index = indexOfFocus(item);\n if (index < 0 || isNodeDisabled(getTabNodes()[index])) return;\n dragSourceIndex = index;\n draggingItem = item;\n item.classList.add(\"smwb-tab-item--dragging\");\n // Firefox wants the drag given something to carry.\n event.dataTransfer?.setData(\"text/plain\", String(index));\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = \"move\";\n }\n };\n\n const onItemDragOver: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null || !local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n // Without it the drop is not allowed here.\n event.preventDefault();\n if (item === dropTargetItem) return;\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n dropTargetItem = item;\n item.classList.add(\"smwb-tab-item--drop-target\");\n };\n\n const onItemDrop: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null) return;\n const from = dragSourceIndex;\n dragSourceIndex = null;\n const to = indexOfFocus(dragItemOf(event.target));\n // Read before the drop is reported: the owner may answer `onReorder` synchronously and move\n // `value` with the tab, and moving a node in the DOM loses the focus in some environments.\n const sourceItem = draggingItem;\n const wasSelected = from === local.value;\n const doc = sourceItem?.ownerDocument;\n const hadFocus = Boolean(sourceItem && doc?.activeElement && sourceItem.contains(doc.activeElement));\n clearDragMarks();\n event.preventDefault();\n if (to >= 0 && to !== from) {\n local.onReorder?.(from, to);\n // The selection belongs to the tab: when the moved tab is the selected one, report its\n // new index as a click would, so a controlled owner moves the value with the tab. The\n // drop's event stands in for the click's, as the overflow menu's choice does.\n if (wasSelected) {\n local.onChange(event as unknown as MouseEvent & { currentTarget: HTMLElement; target: Element }, to);\n }\n // The focus belongs to the tab too: put it back on the moved tab when it had it. The\n // check that the node landed at `to` keeps this honest when the owner reorders later.\n if (hadFocus) {\n const moved = getTabNodes()[to];\n if (moved && itemOf(moved) === sourceItem) moved.focus();\n }\n }\n };\n\n const onItemDragEnd: JSX.EventHandler<HTMLDivElement, DragEvent> = () => {\n dragSourceIndex = null;\n clearDragMarks();\n };\n\n // Select the enabled tab `delta` places from the focused one, wrapping at the ends and\n // skipping disabled tabs: as Enter or Space would, through a synthesized click on the tab.\n const switchByChord = (event: KeyboardEvent & { target: Element }, delta: -1 | 1): void => {\n const nodes = getTabNodes();\n const from = indexOfFocus(event.target);\n if (from < 0 || nodes.length === 0) return;\n for (let step = 1; step <= nodes.length; step += 1) {\n const next = (from + delta * step + nodes.length) % nodes.length;\n const node = nodes[next];\n if (node && !isNodeDisabled(node)) {\n node.focus();\n node.click();\n return;\n }\n }\n };\n\n const onTabListKeyDown = (event: KeyboardEvent & { currentTarget: HTMLElement; target: Element }): void => {\n if (event.defaultPrevented) return;\n // The tabs' chords, ahead of the \"chords belong to the browser\" guard below. They are\n // best-effort: a browser of its own tabs reserves Mod+W and Mod+Shift+[/], and they\n // bite only in an embedded webview.\n if ((event.ctrlKey || event.metaKey) && !event.altKey && indexOfFocus(event.target) >= 0) {\n const index = indexOfFocus(event.target);\n const registration = registrations().find((candidate) => candidate.index() === index);\n if (matchesKeyboardShortcut(event, [\"Mod\", \"W\"])) {\n if (registration && !registration.disabled() && registration.closable()) {\n event.preventDefault();\n registration.requestClose(event);\n }\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"[\"])) {\n event.preventDefault();\n switchByChord(event, -1);\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"]\"])) {\n event.preventDefault();\n switchByChord(event, 1);\n return;\n }\n }\n // Chords belong to the browser; a handler that took the key first keeps it.\n if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return;\n if (!event.target.closest('[role=\"tab\"]')) return;\n onRovingKeyDown(event);\n };\n\n // Focus can leave the row without a focusout: the focused tab is removed, and the browser moves\n // focus to the body. The row keeps the focused tab as its stop only while focus is in it, on\n // the tab that has it now (tabs before it may have come or gone).\n createEffect(\n on(\n items,\n () => {\n const doc = tabListEl?.ownerDocument;\n const closing = closingTab;\n if (doc && closing && !closing.item.isConnected) {\n closingTab = null;\n // A tab the user closed took the focus with it: the tab that takes its place gets it (the\n // previous one if it was last), the nearest that is not disabled. Focus that went anywhere\n // else meanwhile stays there.\n if (!doc.activeElement || doc.activeElement === doc.body) {\n const nodes = getTabNodes();\n const from = Math.min(closing.index, nodes.length - 1);\n const candidates = [...nodes.keys()].filter((index) => !isNodeDisabled(nodes[index]));\n const target = candidates.find((index) => index >= from) ?? candidates[candidates.length - 1];\n if (target !== undefined) {\n nodes[target]?.focus();\n setFocusedIndex(target);\n return;\n }\n }\n }\n if (focusedIndex() === null) return;\n const index = indexOfFocus(doc?.activeElement);\n setFocusedIndex(index >= 0 ? index : null);\n },\n { defer: true }\n )\n );\n\n const onTabListFocusIn = (event: FocusEvent): void => {\n const index = indexOfFocus(event.target as Node);\n if (index >= 0) setFocusedIndex(index);\n if (closingTab && !closingTab.item.contains(event.target as Node)) closingTab = null;\n };\n\n const onTabListFocusOut = (event: FocusEvent & { currentTarget: HTMLElement }): void => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n setFocusedIndex(null);\n // Chromium fires this too as the focused tab is removed, just before it goes, and the removal\n // is what the marker is for: it stays until the effect that follows the removal has used it.\n // One still standing once the current task's microtasks run was a real blur: that close no\n // longer takes the focus anywhere.\n queueMicrotask(() => {\n if (closingTab?.item.isConnected) closingTab = null;\n });\n }\n };\n\n const contextValue: TabsContextValue = {\n value: () => local.value,\n tabStop: (index) => stopIndex() === index,\n tabId,\n panelId,\n hasPanels,\n reorderable: () => local.onReorder !== undefined,\n onChange: local.onChange,\n closing: (index, reason) => {\n const tab = getTabNodes()[index];\n const active = tab?.ownerDocument.activeElement;\n // Focus in the item is focus on the tab. A close from the tab's own `actions` is the user's\n // wherever focus is: it is in the menu then, which is drawn outside the row.\n const focused = reason === \"actions\" || Boolean(active && tab && itemOf(tab).contains(active));\n closingTab = tab && focused ? { item: itemOf(tab), index } : null;\n },\n registerTab: (element, info) => {\n const order = created++;\n const index = createMemo(() => {\n const list = items();\n if (!list) return order;\n const el = element();\n return el ? list.findIndex((item) => item.contains(el)) : -1;\n });\n const registration: Registration = { ...info, index };\n setRegistrations((list) => [...list, registration]);\n onCleanup(() => setRegistrations((list) => list.filter((item) => item !== registration)));\n return index;\n },\n };\n\n const showScrollButtons = (): boolean =>\n local.scrollable && local.scrollButtons && (overflowStart() || overflowEnd());\n\n // The overflow menu's trigger appears only once the browser has measured a clipped tab,\n // so the server markup — and the first client render — shows none.\n const showOverflowTrigger = (): boolean =>\n local.scrollable && local.overflowMenu && hiddenIndexes().length > 0;\n\n // The menu lists what the viewport clips; each entry shows a copy of the tab's icon and\n // label (the live nodes belong to the row, so they are cloned into the entry, not moved),\n // kept in step with the tab while the menu is open.\n const overflowItemIcon = (node: HTMLElement | undefined): Element | undefined =>\n node?.querySelector(\".smwb-tab__icon\") ?? undefined;\n const overflowItemLabel = (node: HTMLElement | undefined): string =>\n node?.querySelector(\".smwb-tab__text-label\")?.textContent ?? \"\";\n const cloneIconInto = (el: HTMLElement, node: HTMLElement | undefined): void => {\n const source = overflowItemIcon(node);\n if (!source) return;\n Array.from(source.childNodes).forEach((child) => el.appendChild(child.cloneNode(true)));\n };\n\n const chooseOverflowItem = (\n event: MouseEvent & { currentTarget: HTMLLIElement; target: Element },\n index: number\n ): void => {\n setOverflowOpen(false);\n local.onChange(event, index);\n scrollIndexIntoView(index);\n };\n\n return (\n <TabsContext.Provider value={contextValue}>\n <PanelsResolver onPanels={(resolved, has) => (setPanels(() => resolved), setHasPanels(has))}>\n {local.panels}\n </PanelsResolver>\n <div\n {...rest}\n id={local.id}\n class={cn(\n \"smwb-tabs\",\n {\n \"smwb-tabs--dense\": local.dense,\n \"smwb-tabs--overflow-start\": overflowStart(),\n \"smwb-tabs--overflow-end\": overflowEnd(),\n },\n local.class\n )}\n ref={mergeRefs(local.ref)}\n >\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--start\"\n aria-label={local.scrollBackAriaLabel}\n disabled={!overflowStart()}\n tabindex={-1}\n onClick={() => scrollByPage(-1)}\n >\n <Icon name=\"chevron_left\" size={20} />\n </button>\n </Show>\n {/* The scroller's class is static so it is on the element from the start:\n a ref on Tabs can find the row by class right away. */}\n <div\n class=\"smwb-tabs__scroller\"\n classList={{ \"smwb-tabs__scroller--scrollable\": local.scrollable }}\n ref={(el) => (tabsEl = el)}\n >\n <div\n class=\"smwb-tabs__scroll-area\"\n ref={(el) => (tabListEl = el)}\n role=\"tablist\"\n aria-label={local[\"aria-label\"]}\n aria-orientation={local.orientation}\n onKeyDown={onTabListKeyDown}\n onFocusIn={onTabListFocusIn}\n onFocusOut={onTabListFocusOut}\n onDragStart={onItemDragStart}\n onDragOver={onItemDragOver}\n onDrop={onItemDrop}\n onDragEnd={onItemDragEnd}\n >\n <TabListItems onItems={setItems}>{local.children}</TabListItems>\n </div>\n <Show when={mounted()}>\n <span\n class=\"smwb-tabs__indicator\"\n style={{\n left: `${indicatorStyle().root.left ?? 0}px`,\n width: `${indicatorStyle().root.width ?? 0}px`,\n }}\n >\n <span\n class=\"smwb-tabs__indicator-content\"\n style={indicatorStyle().content ? { width: `${indicatorStyle().content?.width ?? 0}px` } : {}}\n />\n </span>\n </Show>\n </div>\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--end\"\n aria-label={local.scrollForwardAriaLabel}\n disabled={!overflowEnd()}\n tabindex={-1}\n onClick={() => scrollByPage(1)}\n >\n <Icon name=\"chevron_right\" size={20} />\n </button>\n </Show>\n <Show when={showOverflowTrigger()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__overflow-trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={overflowOpen()}\n aria-label={local.overflowMenuAriaLabel}\n tabindex={-1}\n ref={(el) => (overflowTriggerEl = el)}\n onClick={() => setOverflowOpen((open) => !open)}\n >\n <Icon name=\"more_horiz\" size={20} />\n </button>\n <Menu\n anchorElement={overflowTriggerEl ?? null}\n isOpen={overflowOpen()}\n onClose={() => setOverflowOpen(false)}\n placement=\"bottom-end\"\n >\n <For each={hiddenIndexes()}>\n {(index) => {\n // The entry mirrors the tab it stands for. Solid children resolve to DOM, not to\n // prop objects, so the tab's own node is the source for the label and the icon;\n // a MutationObserver keeps the entry in step with renames and re-icons while the\n // menu is open. Disabled follows the tab's registration, as in the row's other\n // disabled bookkeeping, so a tab that flips `disabled` in place greys its entry out.\n //\n // Which node that is cannot be settled once, when the entry is drawn: an owner that\n // keys its list by value replaces the tab's node when its label changes, while the\n // clipped set — and so this entry — keeps its identity. `items` and `registrations`\n // are what announce the row moving, and the effect below reads the node from the row\n // when it runs, which is after Solid has landed that move in the DOM; a node sampled\n // earlier, into a memo or into a const, is the detached one by then.\n const nodeNow = (): HTMLElement | undefined => getTabNodes()[index];\n // What the row shows at this index as the entry is drawn, so its first paint is not\n // an empty entry; the effect below keeps it current from then on.\n const drawn = nodeNow();\n const [label, setLabel] = createSignal(overflowItemLabel(drawn));\n const [hasIcon, setHasIcon] = createSignal(Boolean(overflowItemIcon(drawn)));\n const disabled = createMemo(() => {\n const registration = registrations().find((candidate) => candidate.index() === index);\n return registration ? registration.disabled() : isNodeDisabled(nodeNow());\n });\n let iconEl: HTMLSpanElement | undefined;\n // The node the entry's content was last taken from: the icon span copies from it\n // when it is drawn, which is after the sync that asked for it.\n let shownNode = drawn;\n const syncIcon = (node: HTMLElement | undefined): void => {\n shownNode = node;\n const source = overflowItemIcon(node);\n setHasIcon(Boolean(source));\n if (iconEl && source) {\n iconEl.textContent = \"\";\n cloneIconInto(iconEl, node);\n }\n };\n createEffect(\n on([items, registrations], () => {\n const node = nodeNow();\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n const item = node ? itemOf(node) : null;\n const view = item?.ownerDocument.defaultView;\n if (!item || !view || typeof view.MutationObserver === \"undefined\") return;\n const observer = new view.MutationObserver(() => {\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n });\n observer.observe(item, { subtree: true, childList: true, characterData: true });\n onCleanup(() => observer.disconnect());\n })\n );\n return (\n <MenuItem\n disabled={disabled()}\n aria-current={index === local.value ? \"true\" : undefined}\n onClick={(event) => chooseOverflowItem(event, index)}\n >\n <Show when={hasIcon()}>\n <span\n class=\"smwb-tab__icon\"\n aria-hidden=\"true\"\n ref={(el) => {\n iconEl = el;\n // The span is drawn by the flag the sync above sets, so it is born after\n // that sync: it copies the icon of the node the entry last followed.\n if (overflowItemIcon(shownNode)) cloneIconInto(el, shownNode);\n }}\n />\n </Show>\n <span class=\"smwb-tab__text-label\">{label()}</span>\n </MenuItem>\n );\n }}\n </For>\n </Menu>\n </Show>\n </div>\n {panels()}\n </TabsContext.Provider>\n );\n}\n\nexport { Tab };\nexport type { TabProps, TabActionsApi, TabCloseReason } from \"./tab/tab\";\nexport default Tabs;\n"],"mappings":"AAAA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,gBAAgB;AACzB,OAAO,QAAQ;AACf,SAAS,gBAAgB;AACzB,SAAS,eAAe;AACxB,SAAS,+BAA+B;AACxC,SAAS,mBAAwD;AACjE,SAAS,WAAW;AACpB,SAAS,wBAAwB;AACjC,SAAS,YAAY;AACrB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,SAAS,iBAA2B;AACpC,SAAS,4BAA4B;AA8GrC,MAAM,mBAAmB;AAEzB,MAAM,cAAc;AAYpB,SAAS,aAAa,OAAqF;AACzG,QAAM,WAAW,SAAS,MAAM,MAAM,QAAQ;AAC9C,MAAI,CAAC,UAAU;AACb,mBAAe,MAAM,MAAM,QAAQ,SAAS,QAAQ,EAAE,OAAO,CAAC,SAAS,gBAAgB,OAAO,CAAC,CAAC;AAAA,EAClG;AACA,SAAO,GAAG,SAAS,EAAE;AACvB;AAOA,SAAS,eAAe,OAGf;AACP,QAAM,WAAW,SAAS,MAAM,MAAM,QAAQ;AAC9C;AAAA,IAAe,MACb,MAAM;AAAA,MACJ,SAAS;AAAA,MACT,SAAS,QAAQ,EAAE,KAAK,CAAC,SAAS,QAAQ,QAAQ,SAAS,SAAS,SAAS,EAAE;AAAA,IACjF;AAAA,EACF;AACA,SAAO;AACT;AAEO,SAAS,KAAK,OAA4C;AAC/D,QAAM,SAAS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names":["index"],"file":"tabs.jsx"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/navigation/tabs/tabs.tsx"],"sourcesContent":["import {\n type Accessor,\n type JSX,\n type ParentProps,\n For,\n Show,\n children,\n createComputed,\n createEffect,\n createMemo,\n createSignal,\n createUniqueId,\n mergeProps,\n on,\n onCleanup,\n onMount,\n splitProps,\n} from \"solid-js\";\nimport { isServer } from \"solid-js/web\";\nimport cn from \"clsx\";\nimport { debounce } from \"../../../utils/debounce\";\nimport { animate } from \"../../../utils/animate\";\nimport { matchesKeyboardShortcut } from \"../../../utils/keyboardShortcut\";\nimport { TabsContext, type TabInfo, type TabsContextValue } from \"./tabsContext\";\nimport { Tab } from \"./tab/tab\";\nimport { getHiddenIndexes } from \"./tabs.utils\";\nimport { Menu } from \"../menu\";\nimport { MenuItem } from \"../menu/menuItem\";\nimport { Icon } from \"../../base/icon\";\nimport { mergeRefs, type Ref } from \"../../../primitives/mergeRefs\";\nimport { createRovingTabIndex } from \"../../../primitives/createRovingTabIndex\";\n\n/**\n * Tabs follow the WAI-ARIA tabs pattern with manual activation. The selected tab is the row's one\n * tab stop (`tabindex` 0, the others -1). The arrow keys along the row's `orientation` move focus to\n * the next or the previous tab (wrapping at the ends), Home and End to the first and the last one;\n * disabled tabs are skipped. Enter or Space then selects the focused tab, as a click does:\n * `onChange` is called for it, with the key's click. Moving focus changes nothing by itself, so a\n * row of link tabs does not navigate as the arrows pass them. Tab leaves the row for what follows\n * it, the selected `TabPanel` first when `panels` are given.\n *\n * A `Tab` can be `closable` and take `actions`; they sit beside the tab and out of the Tab order.\n * Delete on the focused tab, its close button or its `actions` (through `close`) ask `onClose` to\n * close it, and when it goes, focus moves to the tab that takes its place instead of falling to the\n * page. A middle click on a closable tab closes it too.\n *\n * With `onReorder` the row's tabs drag onto one another to reorder: `onReorder(from, to)` reports\n * the drop and the owner moves the tabs; dropping the selected tab reports its new index through\n * `onChange` as well, so the selection follows the moved tab. With `overflowMenu` a scrollable\n * row that overflows gains\n * a trigger beside it listing the clipped tabs. The chords Mod+W (close the focused closable tab)\n * and Mod+Shift+[ / Mod+Shift+] (switch to the previous / next tab) are handled on the row, as\n * best-effort: a browser of its own tabs reserves them.\n */\nexport interface TabsProps {\n /**\n * Index of the selected tab: its position in the row. Tabs count in the order they\n * render, so a tab behind a `<Show>` that is off takes no index, and tabs added,\n * removed or reordered count by their new place.\n */\n value: number;\n /**\n * Called with the index of the clicked tab, counted as for `value`. A tab chosen from the keyboard\n * (Enter or Space on the focused tab) calls it with that click too. A modified or non-primary\n * click (Ctrl, Meta, Shift or Alt held, or a button other than the main one) on a link tab\n * (`Tab` with `href`) is the browser's, as \"open in a new tab\": it does not call `onChange`.\n */\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Which way the tabs run. It sets `aria-orientation` on the tab list and picks the arrow keys that\n * move between tabs: Left and Right when horizontal, Up and Down when vertical. The styles draw\n * a horizontal row; a vertical list is yours to lay out.\n */\n orientation?: \"horizontal\" | \"vertical\";\n /**\n * The content of the tabs: `TabPanel`s, rendered after the tab row. With them each tab gets\n * `aria-controls` its panel and each panel `aria-labelledby` its tab. Without them the tabs link\n * to nothing, as before. Give a panel to every tab: a tab whose panel is left out still names it.\n * A `TabPanel` placed anywhere else is not linked to the tabs and is always shown.\n */\n panels?: JSX.Element;\n /**\n * Base of the ids that link tabs and panels: tab `n` is `{id}-tab-{n}`, its panel `{id}-panel-{n}`.\n * It is also the id of the root element. A generated one by default.\n */\n id?: string;\n /** Draw the indicator as wide as the selected tab's label rather than the whole tab. */\n indicatorContent?: boolean;\n /**\n * Let the tab row scroll sideways instead of clipping it. The edge beyond which\n * more tabs are hidden fades out.\n */\n scrollable?: boolean;\n /**\n * With `scrollable`: buttons at both ends that scroll the row while it overflows. They are for\n * the pointer and stay out of the Tab order: the arrow keys reach every tab and scroll it into\n * view.\n */\n scrollButtons?: boolean;\n /**\n * Present ⇒ the row is reorderable by dragging a tab onto another (pointer-only; there is no\n * keyboard reorder). `Tabs` does not move the tabs itself: it reports the drag with\n * `onReorder(from, to)` — indexes counted as for `value` — and the owner reorders its state.\n * The tabs keep their focus through a reorder; when the moved tab is the selected one,\n * `onChange` reports its new index too, so a controlled owner keeps it selected. That `onChange`\n * carries the drop's own event standing in for the click's: the index argument is authoritative —\n * `currentTarget` is the scroll area the drop delegates to, not the tab.\n */\n onReorder?: (from: number, to: number) => void;\n /**\n * With `scrollable`: when the row overflows, a trigger button is rendered beside the scroller\n * (in the scroll buttons' spot) that opens a menu of the tabs the viewport clips — any clipped\n * part beyond a 1px tolerance counts. Each entry shows the tab's icon and label, the selected one is marked\n * `aria-current=\"true\"`, and choosing one calls `onChange` for it and scrolls it into view.\n * The trigger appears only after the browser has measured an overflow, so the server markup\n * shows none.\n */\n overflowMenu?: boolean;\n /** Accessible label of the overflow-menu trigger. English by default; set it to localise. */\n overflowMenuAriaLabel?: string;\n /**\n * Compact tabs: a shorter row — `--smui-tabDenseHeight` (36px) — with labels as written (no\n * capitals, no letter spacing) and less padding.\n */\n dense?: boolean;\n /**\n * Content-width tabs: each tab is as wide as what it holds (marker, label, close button) and the\n * row does not stretch them, so what is left of the row stays empty; a plain row shares its whole\n * width between its tabs. A tab stays between `--smui-tabFitMinWidth` (80px) and\n * `--smui-tabFitMaxWidth` (256px), set in the theme; a longer label is cut with an ellipsis, and a\n * string `label` is also the label's `title`, so the full text shows on hover (a `Tab` whose label\n * is not a string takes a `title` of its own, which is the tooltip of the whole tab). The indicator, `scrollable`, `scrollButtons`, the\n * overflow menu and the close button need nothing more. Dropping a dragged tab on the row's empty\n * part does nothing.\n */\n fit?: boolean;\n /** Accessible label of the button that scrolls back. */\n scrollBackAriaLabel?: string;\n /** Accessible label of the button that scrolls forward. */\n scrollForwardAriaLabel?: string;\n class?: string;\n children?: JSX.Element;\n \"aria-label\"?: string;\n ref?: Ref<HTMLDivElement>;\n}\n\ninterface IndicatorStyle {\n root: { left?: number; width?: number };\n content?: { width: number };\n}\n\nconst VIEW_NEXT_TAB_PX = 40;\n/** A scroll button moves the row by this share of its visible width. */\nconst SCROLL_PAGE = 0.8;\n\n/** What Tabs knows of each of its tabs. */\ninterface Registration extends TabInfo {\n index: Accessor<number>;\n}\n\n/**\n * The tab list's children, resolved once, with their elements reported in order\n * whenever they change. It renders inside the context provider, so the tabs it\n * creates find their Tabs.\n */\nfunction TabListItems(props: { children?: JSX.Element; onItems: (items: Element[]) => void }): JSX.Element {\n const resolved = children(() => props.children);\n if (!isServer) {\n createComputed(() => props.onItems(resolved.toArray().filter((node) => node instanceof Element)));\n }\n return <>{resolved()}</>;\n}\n\n/**\n * The `panels`, resolved once, inside the context provider so that the panels find their Tabs, and\n * before the tab row renders so that the tabs know whether they control anything. It draws\n * nothing itself: Tabs places what it reports after the row.\n */\nfunction PanelsResolver(props: {\n children?: JSX.Element;\n onPanels: (panels: JSX.Element, has: boolean) => void;\n}): null {\n const resolved = children(() => props.children);\n createComputed(() =>\n props.onPanels(\n resolved(),\n resolved.toArray().some((node) => node != null && node !== false && node !== \"\")\n )\n );\n return null;\n}\n\nexport function Tabs(props: ParentProps<TabsProps>): JSX.Element {\n const merged = mergeProps(\n {\n indicatorContent: false,\n scrollable: false,\n scrollButtons: false,\n overflowMenu: false,\n dense: false,\n fit: false,\n orientation: \"horizontal\" as const,\n scrollBackAriaLabel: \"Scroll tabs back\",\n scrollForwardAriaLabel: \"Scroll tabs forward\",\n overflowMenuAriaLabel: \"More tabs\",\n },\n props\n );\n const [local, rest] = splitProps(merged, [\n \"class\",\n \"children\",\n \"onChange\",\n \"value\",\n \"indicatorContent\",\n \"scrollable\",\n \"scrollButtons\",\n \"onReorder\",\n \"overflowMenu\",\n \"overflowMenuAriaLabel\",\n \"dense\",\n \"fit\",\n \"orientation\",\n \"panels\",\n \"id\",\n \"scrollBackAriaLabel\",\n \"scrollForwardAriaLabel\",\n \"aria-label\",\n \"ref\",\n ]);\n\n const generatedId = createUniqueId();\n const baseId = (): string => local.id ?? generatedId;\n const [registrations, setRegistrations] = createSignal<Registration[]>([]);\n // A tab's own id is the one its panel is labelled by.\n const tabId = (index: number): string =>\n registrations()\n .find((registration) => registration.index() === index)\n ?.id() ?? `${baseId()}-tab-${index}`;\n const panelId = (index: number): string => `${baseId()}-panel-${index}`;\n const [panels, setPanels] = createSignal<JSX.Element>();\n const [hasPanels, setHasPanels] = createSignal(false);\n // The tab that has focus while focus is in the tab list: it is the row's tab stop then, so\n // Tab from there leaves the row instead of landing on the selected tab again.\n const [focusedIndex, setFocusedIndex] = createSignal<number | null>(null);\n\n const [mounted, setMounted] = createSignal(false);\n const [indicatorStyle, setIndicatorStyle] = createSignal<IndicatorStyle>({ root: {} });\n // Whether tabs are hidden past the start / the end of a scrollable row. Only\n // measured in the browser, so the server markup shows neither.\n const [overflowStart, setOverflowStart] = createSignal(false);\n const [overflowEnd, setOverflowEnd] = createSignal(false);\n // The indexes of the tabs the scroller's viewport clips: what the overflow menu lists.\n // Empty on the server and until the first measurement, like the overflow state.\n const [hiddenIndexes, setHiddenIndexes] = createSignal<number[]>([]);\n // The overflow-menu trigger and its menu, composed here when `overflowMenu` is on.\n const [overflowOpen, setOverflowOpen] = createSignal(false);\n let overflowTriggerEl: HTMLButtonElement | undefined;\n\n let tabsEl: HTMLDivElement | undefined;\n let tabListEl: HTMLDivElement | undefined;\n // The tab the user asked to close while it, or something beside it, had focus: its item, which\n // goes with it, and its place. If it goes while focus is lost with it, focus moves on to a neighbour.\n let closingTab: { item: Element; index: number } | null = null;\n // The tab list's elements in order, known once its children have resolved in\n // the browser. Before that, and on the server, a tab's index is the order it\n // was created in, which is its order in the markup.\n const [items, setItems] = createSignal<Element[]>();\n let created = 0;\n\n const getTabsMeta = () => {\n let tabsMeta: { clientWidth: number; scrollLeft: number; left: number; right: number } | undefined;\n if (tabsEl) {\n const rect = tabsEl.getBoundingClientRect();\n tabsMeta = { clientWidth: tabsEl.clientWidth, scrollLeft: tabsEl.scrollLeft, left: rect.left, right: rect.right };\n }\n let tabMeta: DOMRect | null = null;\n let tabContentMeta: DOMRect | null = null;\n if (tabsEl && tabListEl && tabListEl.children.length > 0) {\n const tab = tabListEl.children[local.value];\n tabMeta = tab ? tab.getBoundingClientRect() : null;\n if (local.indicatorContent) {\n tabContentMeta = tab?.querySelector(\".smwb-tab__content\")?.getBoundingClientRect() ?? null;\n }\n }\n return { tabsMeta, tabMeta, tabContentMeta };\n };\n\n const updateIndicatorState = (): void => {\n const { tabsMeta, tabMeta, tabContentMeta } = getTabsMeta();\n let startValue = 0;\n if (tabMeta && tabsMeta) {\n startValue = tabMeta.left - tabsMeta.left + tabsMeta.scrollLeft;\n }\n const next: IndicatorStyle = { root: { left: startValue, width: tabMeta ? tabMeta.width : 0 } };\n if (local.indicatorContent && tabContentMeta) {\n next.content = { width: tabContentMeta.width };\n }\n const prev = indicatorStyle();\n if (prev.root.left === undefined || prev.root.width === undefined) {\n setIndicatorStyle(next);\n return;\n }\n const dStart = Math.abs((prev.root.left ?? 0) - (next.root.left ?? 0));\n const dSize = Math.abs((prev.root.width ?? 0) - (next.root.width ?? 0));\n if (dStart >= 1 || dSize >= 1) {\n setIndicatorStyle(next);\n }\n };\n\n const updateOverflow = (): void => {\n if (!tabsEl || !local.scrollable) {\n setOverflowStart(false);\n setOverflowEnd(false);\n setHiddenIndexes((prev) => (prev.length === 0 ? prev : []));\n return;\n }\n const max = tabsEl.scrollWidth - tabsEl.clientWidth;\n setOverflowStart(tabsEl.scrollLeft > 1);\n setOverflowEnd(tabsEl.scrollLeft < max - 1);\n // Which tabs the viewport clips, measured the same way: the scroller is `position: relative`,\n // so a tab's `offsetLeft` is its place in the row's content. Only the menu needs the list,\n // so nothing is measured without it. Kept by identity when unchanged, because this runs on\n // every scroll tick.\n const hidden = local.overflowMenu\n ? getHiddenIndexes(\n tabListEl\n ? Array.from(tabListEl.children).map((child) => {\n const item = child as HTMLElement;\n return { offsetLeft: item.offsetLeft, offsetWidth: item.offsetWidth };\n })\n : [],\n tabsEl.scrollLeft,\n tabsEl.clientWidth\n )\n : [];\n setHiddenIndexes((prev) =>\n prev.length === hidden.length && prev.every((index, at) => index === hidden[at]) ? prev : hidden\n );\n };\n\n const scroll = (scrollValue: number): void => {\n if (!tabsEl) return;\n animate(tabsEl, \"scrollLeft\", scrollValue, { duration: 300 });\n };\n\n const scrollByPage = (direction: -1 | 1): void => {\n if (!tabsEl) return;\n scroll(tabsEl.scrollLeft + direction * tabsEl.clientWidth * SCROLL_PAGE);\n };\n\n const scrollIndexIntoView = (index: number): void => {\n if (!tabsEl || !tabListEl) return;\n const tab = tabListEl.children[index];\n if (!tab) return;\n const tabsRect = tabsEl.getBoundingClientRect();\n const tabRect = tab.getBoundingClientRect();\n if (tabRect.left < tabsRect.left) {\n scroll(tabsEl.scrollLeft + (tabRect.left - tabsRect.left) - VIEW_NEXT_TAB_PX);\n } else if (tabRect.right > tabsRect.right) {\n scroll(tabsEl.scrollLeft + (tabRect.right - tabsRect.right) + VIEW_NEXT_TAB_PX);\n }\n };\n\n const scrollSelectedIntoView = (): void => {\n scrollIndexIntoView(local.value);\n };\n\n onMount(() => setMounted(true));\n\n // Re-measure when the active value or the tabs change (and on mount).\n createEffect(\n on([() => local.value, items], () => {\n updateIndicatorState();\n updateOverflow();\n })\n );\n\n // Keep the indicator and the overflow state in sync with resizes: of the\n // window, of the row, and of each tab (a label can grow with its data).\n onMount(() => {\n const onResize = debounce(() => {\n updateIndicatorState();\n updateOverflow();\n }, 166);\n const view = tabsEl?.ownerDocument.defaultView;\n view?.addEventListener(\"resize\", onResize);\n tabsEl?.addEventListener(\"scroll\", updateOverflow, { passive: true });\n let resizeObserver: ResizeObserver | undefined;\n if (typeof ResizeObserver !== \"undefined\" && tabListEl) {\n resizeObserver = new ResizeObserver(onResize);\n if (tabsEl) resizeObserver.observe(tabsEl);\n Array.from(tabListEl.children).forEach((child) => resizeObserver?.observe(child));\n }\n updateOverflow();\n onCleanup(() => {\n onResize.cancel();\n view?.removeEventListener(\"resize\", onResize);\n tabsEl?.removeEventListener(\"scroll\", updateOverflow);\n resizeObserver?.disconnect();\n });\n });\n\n // Scroll the selected tab into view when the indicator moves.\n createEffect(() => {\n indicatorStyle();\n scrollSelectedIntoView();\n });\n\n // The tabs in the DOM, by what they are: their indexes are the ones `value` counts.\n const getTabNodes = (): HTMLElement[] => Array.from(tabListEl?.querySelectorAll<HTMLElement>('[role=\"tab\"]') ?? []);\n // A tab with a close button or actions sits in an item with them: focus on any of it is focus on the tab.\n const itemOf = (tab: HTMLElement): HTMLElement => tab.closest<HTMLElement>(\".smwb-tab-item\") ?? tab;\n const indexOfFocus = (target: Node | null | undefined): number =>\n target ? getTabNodes().findIndex((node) => itemOf(node).contains(target)) : -1;\n const isNodeDisabled = (node: HTMLElement | undefined): boolean =>\n !node || node.getAttribute(\"aria-disabled\") === \"true\" || (node as HTMLButtonElement).disabled === true;\n\n // The selected tab is the stop; a value that points at no tab leaves the first one, and a\n // disabled one, which cannot take focus, leaves the first tab that can.\n const selectedStop = (): number => {\n const count = items()?.length;\n const candidate = count === undefined || (local.value >= 0 && local.value < count) ? local.value : 0;\n const list = registrations();\n if (!list.some((registration) => registration.index() === candidate && registration.disabled())) return candidate;\n const enabled = list\n .filter((registration) => !registration.disabled())\n .map((registration) => registration.index())\n .filter((index) => index >= 0);\n return enabled.length > 0 ? Math.min(...enabled) : candidate;\n };\n const stopIndex = (): number => focusedIndex() ?? selectedStop();\n\n const onRovingKeyDown = createRovingTabIndex({\n count: () => getTabNodes().length,\n activeIndex: stopIndex,\n get orientation() {\n return local.orientation;\n },\n onMove: (next) => getTabNodes()[next]?.focus(),\n isDisabled: (index) => isNodeDisabled(getTabNodes()[index]),\n });\n\n // Drag-to-reorder (with `onReorder`): the drag's source and drop target are the tab items,\n // tracked here on the row; Tabs only reports `onReorder(from, to)` — and, when the moved tab\n // is the selected one, its new index through `onChange` — and keeps the tabs' focus alone;\n // the owner moves the tabs in its state.\n // Only while `onReorder` is given do the items carry `draggable`, and a disabled tab\n // never: the attribute is rendered declaratively by each `Tab` on its item (the wrapper,\n // or the bare tab when there is none), so it is part of the server markup — as in React.\n let dragSourceIndex: number | null = null;\n let draggingItem: HTMLElement | null = null;\n let dropTargetItem: HTMLElement | null = null;\n // The tab list itself is no item: a content-width row leaves an empty part past its last tab, and\n // the drag marks nothing there and drops nothing.\n const dragItemOf = (target: EventTarget | null): HTMLElement | null =>\n target instanceof Element && target !== tabListEl ? itemOf(target as HTMLElement) : null;\n const clearDragMarks = (): void => {\n draggingItem?.classList.remove(\"smwb-tab-item--dragging\");\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n draggingItem = null;\n dropTargetItem = null;\n };\n\n const onItemDragStart: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (!local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n const index = indexOfFocus(item);\n if (index < 0 || isNodeDisabled(getTabNodes()[index])) return;\n dragSourceIndex = index;\n draggingItem = item;\n item.classList.add(\"smwb-tab-item--dragging\");\n // Firefox wants the drag given something to carry.\n event.dataTransfer?.setData(\"text/plain\", String(index));\n if (event.dataTransfer) {\n event.dataTransfer.effectAllowed = \"move\";\n }\n };\n\n const onItemDragOver: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null || !local.onReorder) return;\n const item = dragItemOf(event.target);\n if (!item) return;\n // Without it the drop is not allowed here.\n event.preventDefault();\n if (item === dropTargetItem) return;\n dropTargetItem?.classList.remove(\"smwb-tab-item--drop-target\");\n dropTargetItem = item;\n item.classList.add(\"smwb-tab-item--drop-target\");\n };\n\n const onItemDrop: JSX.EventHandler<HTMLDivElement, DragEvent> = (event) => {\n if (dragSourceIndex === null) return;\n const from = dragSourceIndex;\n dragSourceIndex = null;\n const to = indexOfFocus(dragItemOf(event.target));\n // Read before the drop is reported: the owner may answer `onReorder` synchronously and move\n // `value` with the tab, and moving a node in the DOM loses the focus in some environments.\n const sourceItem = draggingItem;\n const wasSelected = from === local.value;\n const doc = sourceItem?.ownerDocument;\n const hadFocus = Boolean(sourceItem && doc?.activeElement && sourceItem.contains(doc.activeElement));\n clearDragMarks();\n event.preventDefault();\n if (to >= 0 && to !== from) {\n local.onReorder?.(from, to);\n // The selection belongs to the tab: when the moved tab is the selected one, report its\n // new index as a click would, so a controlled owner moves the value with the tab. The\n // drop's event stands in for the click's, as the overflow menu's choice does.\n if (wasSelected) {\n local.onChange(event as unknown as MouseEvent & { currentTarget: HTMLElement; target: Element }, to);\n }\n // The focus belongs to the tab too: put it back on the moved tab when it had it. The\n // check that the node landed at `to` keeps this honest when the owner reorders later.\n if (hadFocus) {\n const moved = getTabNodes()[to];\n if (moved && itemOf(moved) === sourceItem) moved.focus();\n }\n }\n };\n\n const onItemDragEnd: JSX.EventHandler<HTMLDivElement, DragEvent> = () => {\n dragSourceIndex = null;\n clearDragMarks();\n };\n\n // Select the enabled tab `delta` places from the focused one, wrapping at the ends and\n // skipping disabled tabs: as Enter or Space would, through a synthesized click on the tab.\n const switchByChord = (event: KeyboardEvent & { target: Element }, delta: -1 | 1): void => {\n const nodes = getTabNodes();\n const from = indexOfFocus(event.target);\n if (from < 0 || nodes.length === 0) return;\n for (let step = 1; step <= nodes.length; step += 1) {\n const next = (from + delta * step + nodes.length) % nodes.length;\n const node = nodes[next];\n if (node && !isNodeDisabled(node)) {\n node.focus();\n node.click();\n return;\n }\n }\n };\n\n const onTabListKeyDown = (event: KeyboardEvent & { currentTarget: HTMLElement; target: Element }): void => {\n if (event.defaultPrevented) return;\n // The tabs' chords, ahead of the \"chords belong to the browser\" guard below. They are\n // best-effort: a browser of its own tabs reserves Mod+W and Mod+Shift+[/], and they\n // bite only in an embedded webview.\n if ((event.ctrlKey || event.metaKey) && !event.altKey && indexOfFocus(event.target) >= 0) {\n const index = indexOfFocus(event.target);\n const registration = registrations().find((candidate) => candidate.index() === index);\n if (matchesKeyboardShortcut(event, [\"Mod\", \"W\"])) {\n if (registration && !registration.disabled() && registration.closable()) {\n event.preventDefault();\n registration.requestClose(event);\n }\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"[\"])) {\n event.preventDefault();\n switchByChord(event, -1);\n return;\n }\n if (matchesKeyboardShortcut(event, [\"Mod\", \"Shift\", \"]\"])) {\n event.preventDefault();\n switchByChord(event, 1);\n return;\n }\n }\n // Chords belong to the browser; a handler that took the key first keeps it.\n if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey) return;\n if (!event.target.closest('[role=\"tab\"]')) return;\n onRovingKeyDown(event);\n };\n\n // Focus can leave the row without a focusout: the focused tab is removed, and the browser moves\n // focus to the body. The row keeps the focused tab as its stop only while focus is in it, on\n // the tab that has it now (tabs before it may have come or gone).\n createEffect(\n on(\n items,\n () => {\n const doc = tabListEl?.ownerDocument;\n const closing = closingTab;\n if (doc && closing && !closing.item.isConnected) {\n closingTab = null;\n // A tab the user closed took the focus with it: the tab that takes its place gets it (the\n // previous one if it was last), the nearest that is not disabled. Focus that went anywhere\n // else meanwhile stays there.\n if (!doc.activeElement || doc.activeElement === doc.body) {\n const nodes = getTabNodes();\n const from = Math.min(closing.index, nodes.length - 1);\n const candidates = [...nodes.keys()].filter((index) => !isNodeDisabled(nodes[index]));\n const target = candidates.find((index) => index >= from) ?? candidates[candidates.length - 1];\n if (target !== undefined) {\n nodes[target]?.focus();\n setFocusedIndex(target);\n return;\n }\n }\n }\n if (focusedIndex() === null) return;\n const index = indexOfFocus(doc?.activeElement);\n setFocusedIndex(index >= 0 ? index : null);\n },\n { defer: true }\n )\n );\n\n const onTabListFocusIn = (event: FocusEvent): void => {\n const index = indexOfFocus(event.target as Node);\n if (index >= 0) setFocusedIndex(index);\n if (closingTab && !closingTab.item.contains(event.target as Node)) closingTab = null;\n };\n\n const onTabListFocusOut = (event: FocusEvent & { currentTarget: HTMLElement }): void => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n setFocusedIndex(null);\n // Chromium fires this too as the focused tab is removed, just before it goes, and the removal\n // is what the marker is for: it stays until the effect that follows the removal has used it.\n // One still standing once the current task's microtasks run was a real blur: that close no\n // longer takes the focus anywhere.\n queueMicrotask(() => {\n if (closingTab?.item.isConnected) closingTab = null;\n });\n }\n };\n\n const contextValue: TabsContextValue = {\n value: () => local.value,\n fit: () => local.fit,\n tabStop: (index) => stopIndex() === index,\n tabId,\n panelId,\n hasPanels,\n reorderable: () => local.onReorder !== undefined,\n onChange: local.onChange,\n closing: (index, reason) => {\n const tab = getTabNodes()[index];\n const active = tab?.ownerDocument.activeElement;\n // Focus in the item is focus on the tab. A close from the tab's own `actions` is the user's\n // wherever focus is: it is in the menu then, which is drawn outside the row.\n const focused = reason === \"actions\" || Boolean(active && tab && itemOf(tab).contains(active));\n closingTab = tab && focused ? { item: itemOf(tab), index } : null;\n },\n registerTab: (element, info) => {\n const order = created++;\n const index = createMemo(() => {\n const list = items();\n if (!list) return order;\n const el = element();\n return el ? list.findIndex((item) => item.contains(el)) : -1;\n });\n const registration: Registration = { ...info, index };\n setRegistrations((list) => [...list, registration]);\n onCleanup(() => setRegistrations((list) => list.filter((item) => item !== registration)));\n return index;\n },\n };\n\n const showScrollButtons = (): boolean =>\n local.scrollable && local.scrollButtons && (overflowStart() || overflowEnd());\n\n // The overflow menu's trigger appears only once the browser has measured a clipped tab,\n // so the server markup — and the first client render — shows none.\n const showOverflowTrigger = (): boolean =>\n local.scrollable && local.overflowMenu && hiddenIndexes().length > 0;\n\n // The menu lists what the viewport clips; each entry shows a copy of the tab's icon and\n // label (the live nodes belong to the row, so they are cloned into the entry, not moved),\n // kept in step with the tab while the menu is open.\n const overflowItemIcon = (node: HTMLElement | undefined): Element | undefined =>\n node?.querySelector(\".smwb-tab__icon\") ?? undefined;\n const overflowItemLabel = (node: HTMLElement | undefined): string =>\n node?.querySelector(\".smwb-tab__text-label\")?.textContent ?? \"\";\n const cloneIconInto = (el: HTMLElement, node: HTMLElement | undefined): void => {\n const source = overflowItemIcon(node);\n if (!source) return;\n Array.from(source.childNodes).forEach((child) => el.appendChild(child.cloneNode(true)));\n };\n\n const chooseOverflowItem = (\n event: MouseEvent & { currentTarget: HTMLLIElement; target: Element },\n index: number\n ): void => {\n setOverflowOpen(false);\n local.onChange(event, index);\n scrollIndexIntoView(index);\n };\n\n return (\n <TabsContext.Provider value={contextValue}>\n <PanelsResolver onPanels={(resolved, has) => (setPanels(() => resolved), setHasPanels(has))}>\n {local.panels}\n </PanelsResolver>\n <div\n {...rest}\n id={local.id}\n class={cn(\n \"smwb-tabs\",\n {\n \"smwb-tabs--dense\": local.dense,\n \"smwb-tabs--fit\": local.fit,\n \"smwb-tabs--overflow-start\": overflowStart(),\n \"smwb-tabs--overflow-end\": overflowEnd(),\n },\n local.class\n )}\n ref={mergeRefs(local.ref)}\n >\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--start\"\n aria-label={local.scrollBackAriaLabel}\n disabled={!overflowStart()}\n tabindex={-1}\n onClick={() => scrollByPage(-1)}\n >\n <Icon name=\"chevron_left\" size={20} />\n </button>\n </Show>\n {/* The scroller's class is static so it is on the element from the start:\n a ref on Tabs can find the row by class right away. */}\n <div\n class=\"smwb-tabs__scroller\"\n classList={{ \"smwb-tabs__scroller--scrollable\": local.scrollable }}\n ref={(el) => (tabsEl = el)}\n >\n <div\n class=\"smwb-tabs__scroll-area\"\n ref={(el) => (tabListEl = el)}\n role=\"tablist\"\n aria-label={local[\"aria-label\"]}\n aria-orientation={local.orientation}\n onKeyDown={onTabListKeyDown}\n onFocusIn={onTabListFocusIn}\n onFocusOut={onTabListFocusOut}\n onDragStart={onItemDragStart}\n onDragOver={onItemDragOver}\n onDrop={onItemDrop}\n onDragEnd={onItemDragEnd}\n >\n <TabListItems onItems={setItems}>{local.children}</TabListItems>\n </div>\n <Show when={mounted()}>\n <span\n class=\"smwb-tabs__indicator\"\n style={{\n left: `${indicatorStyle().root.left ?? 0}px`,\n width: `${indicatorStyle().root.width ?? 0}px`,\n }}\n >\n <span\n class=\"smwb-tabs__indicator-content\"\n style={indicatorStyle().content ? { width: `${indicatorStyle().content?.width ?? 0}px` } : {}}\n />\n </span>\n </Show>\n </div>\n <Show when={showScrollButtons()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__scroll-button smwb-tabs__scroll-button--end\"\n aria-label={local.scrollForwardAriaLabel}\n disabled={!overflowEnd()}\n tabindex={-1}\n onClick={() => scrollByPage(1)}\n >\n <Icon name=\"chevron_right\" size={20} />\n </button>\n </Show>\n <Show when={showOverflowTrigger()}>\n <button\n type=\"button\"\n class=\"smwb-tabs__overflow-trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={overflowOpen()}\n aria-label={local.overflowMenuAriaLabel}\n tabindex={-1}\n ref={(el) => (overflowTriggerEl = el)}\n onClick={() => setOverflowOpen((open) => !open)}\n >\n <Icon name=\"more_horiz\" size={20} />\n </button>\n <Menu\n anchorElement={overflowTriggerEl ?? null}\n isOpen={overflowOpen()}\n onClose={() => setOverflowOpen(false)}\n placement=\"bottom-end\"\n >\n <For each={hiddenIndexes()}>\n {(index) => {\n // The entry mirrors the tab it stands for. Solid children resolve to DOM, not to\n // prop objects, so the tab's own node is the source for the label and the icon;\n // a MutationObserver keeps the entry in step with renames and re-icons while the\n // menu is open. Disabled follows the tab's registration, as in the row's other\n // disabled bookkeeping, so a tab that flips `disabled` in place greys its entry out.\n //\n // Which node that is cannot be settled once, when the entry is drawn: an owner that\n // keys its list by value replaces the tab's node when its label changes, while the\n // clipped set — and so this entry — keeps its identity. `items` and `registrations`\n // are what announce the row moving, and the effect below reads the node from the row\n // when it runs, which is after Solid has landed that move in the DOM; a node sampled\n // earlier, into a memo or into a const, is the detached one by then.\n const nodeNow = (): HTMLElement | undefined => getTabNodes()[index];\n // What the row shows at this index as the entry is drawn, so its first paint is not\n // an empty entry; the effect below keeps it current from then on.\n const drawn = nodeNow();\n const [label, setLabel] = createSignal(overflowItemLabel(drawn));\n const [hasIcon, setHasIcon] = createSignal(Boolean(overflowItemIcon(drawn)));\n const disabled = createMemo(() => {\n const registration = registrations().find((candidate) => candidate.index() === index);\n return registration ? registration.disabled() : isNodeDisabled(nodeNow());\n });\n let iconEl: HTMLSpanElement | undefined;\n // The node the entry's content was last taken from: the icon span copies from it\n // when it is drawn, which is after the sync that asked for it.\n let shownNode = drawn;\n const syncIcon = (node: HTMLElement | undefined): void => {\n shownNode = node;\n const source = overflowItemIcon(node);\n setHasIcon(Boolean(source));\n if (iconEl && source) {\n iconEl.textContent = \"\";\n cloneIconInto(iconEl, node);\n }\n };\n createEffect(\n on([items, registrations], () => {\n const node = nodeNow();\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n const item = node ? itemOf(node) : null;\n const view = item?.ownerDocument.defaultView;\n if (!item || !view || typeof view.MutationObserver === \"undefined\") return;\n const observer = new view.MutationObserver(() => {\n setLabel(overflowItemLabel(node));\n syncIcon(node);\n });\n observer.observe(item, { subtree: true, childList: true, characterData: true });\n onCleanup(() => observer.disconnect());\n })\n );\n return (\n <MenuItem\n disabled={disabled()}\n aria-current={index === local.value ? \"true\" : undefined}\n onClick={(event) => chooseOverflowItem(event, index)}\n >\n <Show when={hasIcon()}>\n <span\n class=\"smwb-tab__icon\"\n aria-hidden=\"true\"\n ref={(el) => {\n iconEl = el;\n // The span is drawn by the flag the sync above sets, so it is born after\n // that sync: it copies the icon of the node the entry last followed.\n if (overflowItemIcon(shownNode)) cloneIconInto(el, shownNode);\n }}\n />\n </Show>\n <span class=\"smwb-tab__text-label\">{label()}</span>\n </MenuItem>\n );\n }}\n </For>\n </Menu>\n </Show>\n </div>\n {panels()}\n </TabsContext.Provider>\n );\n}\n\nexport { Tab };\nexport type { TabProps, TabActionsApi, TabCloseReason } from \"./tab/tab\";\nexport default Tabs;\n"],"mappings":"AAAA;AAAA,EAIE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;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BAAqB,YAAa;AACpE,cAAM,WAAW,IAAI,KAAK,iBAAiB,MAAM;AAC/C,mBAAS,kBAAkB,IAAI,CAAC;AAChC,mBAAS,IAAI;AAAA,QACf,CAAC;AACD,iBAAS,QAAQ,MAAM,EAAE,SAAS,MAAM,WAAW,MAAM,eAAe,KAAK,CAAC;AAC9E,kBAAU,MAAM,SAAS,WAAW,CAAC;AAAA,MACvC,CAAC;AAAA,IACH;AACA,WACE,CAAC;AAAA,MACC,UAAU,SAAS;AAAA,MACnB,cAAc,UAAU,MAAM,QAAQ,SAAS;AAAA,MAC/C,SAAS,CAAC,UAAU,mBAAmB,OAAO,KAAK;AAAA,KACpD;AAAA,oBACC,CAAC,KAAK,MAAM,QAAQ,GAAG;AAAA,sBACrB,CAAC;AAAA,MACC,MAAM;AAAA,MACN,YAAY;AAAA,MACZ,KAAK,CAAC,OAAO;AACX,iBAAS;AAGT,YAAI,iBAAiB,SAAS,EAAG,eAAc,IAAI,SAAS;AAAA,MAC9D;AAAA,IACF,EAAE;AAAA,oBACJ,EAXC,KAWM;AAAA,oBACP,CAAC,KAAK,MAAM,wBAAwB,MAAM,EAAE,EAA3C,KAAkD;AAAA,kBACrD,EAlBC;AAAA,EAoBL,EAAE;AAAA,YACJ,EA3EC,IA2EK;AAAA,UACR,EAlFC,KAkFM;AAAA,QACT,EAhGC,KAgGM;AAAA,MACT,EA9KC,IA8KK;AAAA,OACL,OAAO,EAAE;AAAA,IACZ,EApLC,YAAY;AAsLjB;AAIA,IAAO,eAAQ;","names":["index"],"file":"tabs.jsx"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/components/navigation/tabs/tabsContext.ts"],
|
|
4
|
-
"sourcesContent": ["import { type Accessor, createContext, useContext } from \"solid-js\";\n\n/** What asked for a tab to close: its close button, Delete or Backspace on it, its `actions`, or a middle click. */\nexport type TabCloseReason = \"button\" | \"key\" | \"actions\" | \"middleClick\";\n\n/** What a Tab tells its Tabs about itself, read when the Tabs needs it. */\nexport interface TabInfo {\n /** The tab's own `id`, if the caller gave one: the panel is labelled by it. */\n id: Accessor<string | undefined>;\n /** Whether the tab is disabled, so it cannot be the row's tab stop. */\n disabled: Accessor<boolean>;\n /** Whether the tab is `closable`: Mod+W on the focused tab asks to close it. */\n closable: Accessor<boolean>;\n /** Ask the tab to close with this event and the reason \"key\", as its own Delete handling would. */\n requestClose: (event: Event) => void;\n}\n\nexport interface TabsContextValue {\n value: Accessor<number>;\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Each Tab registers on setup with its root element (set once it renders) and\n * gets back its index: its position in the tab list, which follows the tab when\n * tabs are added, removed or reordered.\n */\n /** Whether the tab at `index` is the row's tab stop: the focused tab while focus is in the row, else the selected one. */\n tabStop: (index: number) => boolean;\n /** The id of the tab at `index`, its own if it has one: the one the panel at that index is labelled by. */\n tabId: (index: number) => string;\n /** The id of the panel at `index`: the one the tab at that index controls. */\n panelId: (index: number) => string;\n /** Whether the Tabs were given `panels`, so that its tabs control something. */\n hasPanels: Accessor<boolean>;\n /** Whether the row is reorderable (`onReorder` given): a tab's item is the drag surface then. */\n reorderable: Accessor<boolean>;\n registerTab: (element: Accessor<Element | undefined>, info: TabInfo) => Accessor<number>;\n /**\n * The tab at `index` is being closed by the user (its Delete key, its close button, its\n * `actions` or a middle click):\n * if focus is in it, or the close came from its actions, whose menu is drawn elsewhere, focus moves\n * to a neighbour when it goes, instead of falling to the page.\n */\n closing: (index: number, reason: TabCloseReason) => void;\n}\n\nexport const TabsContext = createContext<TabsContextValue>();\n\nexport const useTabsContext = (): TabsContextValue | undefined => useContext(TabsContext);\n"],
|
|
5
|
-
"mappings": "AAAA,SAAwB,eAAe,kBAAkB;
|
|
4
|
+
"sourcesContent": ["import { type Accessor, createContext, useContext } from \"solid-js\";\n\n/** What asked for a tab to close: its close button, Delete or Backspace on it, its `actions`, or a middle click. */\nexport type TabCloseReason = \"button\" | \"key\" | \"actions\" | \"middleClick\";\n\n/** What a Tab tells its Tabs about itself, read when the Tabs needs it. */\nexport interface TabInfo {\n /** The tab's own `id`, if the caller gave one: the panel is labelled by it. */\n id: Accessor<string | undefined>;\n /** Whether the tab is disabled, so it cannot be the row's tab stop. */\n disabled: Accessor<boolean>;\n /** Whether the tab is `closable`: Mod+W on the focused tab asks to close it. */\n closable: Accessor<boolean>;\n /** Ask the tab to close with this event and the reason \"key\", as its own Delete handling would. */\n requestClose: (event: Event) => void;\n}\n\nexport interface TabsContextValue {\n value: Accessor<number>;\n /** Whether the row is content-width (`fit`): a tab's label may be cut, so its text is the tab's title. */\n fit?: Accessor<boolean>;\n onChange: (event: MouseEvent & { currentTarget: HTMLElement; target: Element }, index: number) => void;\n /**\n * Each Tab registers on setup with its root element (set once it renders) and\n * gets back its index: its position in the tab list, which follows the tab when\n * tabs are added, removed or reordered.\n */\n /** Whether the tab at `index` is the row's tab stop: the focused tab while focus is in the row, else the selected one. */\n tabStop: (index: number) => boolean;\n /** The id of the tab at `index`, its own if it has one: the one the panel at that index is labelled by. */\n tabId: (index: number) => string;\n /** The id of the panel at `index`: the one the tab at that index controls. */\n panelId: (index: number) => string;\n /** Whether the Tabs were given `panels`, so that its tabs control something. */\n hasPanels: Accessor<boolean>;\n /** Whether the row is reorderable (`onReorder` given): a tab's item is the drag surface then. */\n reorderable: Accessor<boolean>;\n registerTab: (element: Accessor<Element | undefined>, info: TabInfo) => Accessor<number>;\n /**\n * The tab at `index` is being closed by the user (its Delete key, its close button, its\n * `actions` or a middle click):\n * if focus is in it, or the close came from its actions, whose menu is drawn elsewhere, focus moves\n * to a neighbour when it goes, instead of falling to the page.\n */\n closing: (index: number, reason: TabCloseReason) => void;\n}\n\nexport const TabsContext = createContext<TabsContextValue>();\n\nexport const useTabsContext = (): TabsContextValue | undefined => useContext(TabsContext);\n"],
|
|
5
|
+
"mappings": "AAAA,SAAwB,eAAe,kBAAkB;AA+ClD,MAAM,cAAc,cAAgC;AAEpD,MAAM,iBAAiB,MAAoC,WAAW,WAAW;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -38,7 +38,14 @@ import { LazyImage } from "./components/dataDisplay/lazyImage";
|
|
|
38
38
|
import { ChipGroup } from "./components/dataDisplay/chipGroup";
|
|
39
39
|
import { Meter, meterColor, DEFAULT_METER_THRESHOLDS } from "./components/dataDisplay/meter";
|
|
40
40
|
import { Kbd, detectKbdPlatform, kbdKeyLabel } from "./components/dataDisplay/kbd";
|
|
41
|
-
import {
|
|
41
|
+
import {
|
|
42
|
+
DiffStat,
|
|
43
|
+
diffStatCells,
|
|
44
|
+
diffStatCount,
|
|
45
|
+
groupDiffStatCount,
|
|
46
|
+
DEFAULT_DIFF_STAT_FORMAT,
|
|
47
|
+
DIFF_STAT_CELLS
|
|
48
|
+
} from "./components/dataDisplay/diffStat";
|
|
42
49
|
import { StatusDot } from "./components/dataDisplay/statusDot";
|
|
43
50
|
import { QrCode } from "./components/dataDisplay/qrCode";
|
|
44
51
|
import { ThumbCard } from "./components/dataDisplay/thumbCard";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["// Public entry point for @smwb/ui-solid.\n// Exports are added as components are ported (see src/components/**).\n\n// primitives\nexport { mergeRefs } from \"./primitives/mergeRefs\";\nexport type { Ref, RefCallback } from \"./primitives/mergeRefs\";\nexport { createId } from \"./primitives/createId\";\nexport { createControllableState } from \"./primitives/createControllableState\";\nexport type { CreateControllableStateParams } from \"./primitives/createControllableState\";\nexport { createTheme, Theme } from \"./primitives/createTheme\";\nexport { createFloating } from \"./primitives/createFloating\";\nexport type { CreateFloatingOptions, FloatingState } from \"./primitives/createFloating\";\nexport { createFocusTrap } from \"./primitives/createFocusTrap\";\nexport type { CreateFocusTrapOptions } from \"./primitives/createFocusTrap\";\nexport { createCssTransition } from \"./primitives/createCssTransition\";\nexport type {\n CreateCssTransitionOptions,\n CssTransitionState,\n CssTransitionClassNames,\n} from \"./primitives/createCssTransition\";\nexport { createDropzone } from \"./primitives/createDropzone\";\nexport type { DropzoneOptions, DropzoneState } from \"./primitives/createDropzone\";\nexport { createVirtualList } from \"./primitives/createVirtualList\";\nexport type { CreateVirtualListParams, VirtualListResult } from \"./primitives/createVirtualList\";\nexport { createMaskedInput } from \"./primitives/createMaskedInput\";\nexport type { CreateMaskedInputOptions, MaskedInputState } from \"./primitives/createMaskedInput\";\nexport { createMediaQuery } from \"./primitives/createMediaQuery\";\nexport { createPersistedJson } from \"./primitives/createPersistedJson\";\nexport type { PersistedJson } from \"./primitives/createPersistedJson\";\nexport { createRovingTabIndex } from \"./primitives/createRovingTabIndex\";\nexport type { CreateRovingTabIndexOptions } from \"./primitives/createRovingTabIndex\";\nexport { createHoverPopover } from \"./primitives/createHoverPopover\";\nexport type {\n CreateHoverPopoverOptions,\n HoverPopoverState,\n HoverPopoverPoint,\n HoverPopoverReferenceProps,\n HoverPopoverFloatingProps,\n} from \"./primitives/createHoverPopover\";\nexport { createKeyboardShortcut } from \"./primitives/createKeyboardShortcut\";\nexport type { CreateKeyboardShortcutOptions } from \"./primitives/createKeyboardShortcut\";\n\n// utils\nexport { resolvePlacement, buildFloatingMiddleware, placements } from \"./utils/floating\";\nexport type { Placement, ResolvedPlacement } from \"./utils/floating\";\nexport { matchesKeyboardShortcut } from \"./utils/keyboardShortcut\";\n\n// base\nexport { Icon, IconProvider, IconContext, useIconSource, createIconVersion } from \"./components/base/icon\";\nexport type { IconProps, IconColor, IconProviderProps, IconContextValue } from \"./components/base/icon\";\n// Icon registry API. The icons themselves live behind \"@smwb/ui-solid/icons\" so\n// an app bundles only the ones it registers.\nexport {\n registerIcons,\n unregisterIcons,\n clearIcons,\n getIcon,\n hasIcon,\n listIcons,\n normalizeIconName,\n} from \"./icons/registry\";\nexport type { IconInput } from \"./icons/registry\";\nexport { configureIcons, getIconConfig, resetIconConfig } from \"./icons/config\";\nexport type { IconConfig } from \"./icons/config\";\nexport { subscribeIcons, getIconVersion } from \"./icons/store\";\nexport type { IconDefinition, IconSource } from \"./icons/types\";\nexport { Ripple } from \"./components/base/ripple\";\nexport type { RippleProps, RippleActionsRef, RippleClasses } from \"./components/base/ripple\";\nexport { AnimateHeight } from \"./components/base/animateHeight\";\nexport type { AnimateHeightProps, Height } from \"./components/base/animateHeight\";\n\n// dataDisplay\nexport { Typography } from \"./components/dataDisplay/typography\";\nexport type { TypographyProps, TypographyVariant, TypographyColor } from \"./components/dataDisplay/typography\";\nexport { Badge } from \"./components/dataDisplay/badge\";\nexport type { BadgeProps } from \"./components/dataDisplay/badge\";\nexport { Card } from \"./components/dataDisplay/card\";\nexport type { CardProps } from \"./components/dataDisplay/card\";\nexport { Stat, StatGroup } from \"./components/dataDisplay/stat\";\nexport type { StatProps, StatGroupProps, StatTone } from \"./components/dataDisplay/stat\";\nexport { Chip } from \"./components/dataDisplay/chip\";\nexport type { ChipProps, ChipColor } from \"./components/dataDisplay/chip\";\nexport { LazyImage } from \"./components/dataDisplay/lazyImage\";\nexport type { LazyImageProps } from \"./components/dataDisplay/lazyImage\";\nexport { ChipGroup } from \"./components/dataDisplay/chipGroup\";\nexport type { ChipGroupProps, ChipGroupOption } from \"./components/dataDisplay/chipGroup\";\nexport { Meter, meterColor, DEFAULT_METER_THRESHOLDS } from \"./components/dataDisplay/meter\";\nexport type { MeterProps, MeterColor, MeterThreshold } from \"./components/dataDisplay/meter\";\nexport { Kbd, detectKbdPlatform, kbdKeyLabel } from \"./components/dataDisplay/kbd\";\nexport type { KbdProps, KbdPlatform, KbdKeyLabel } from \"./components/dataDisplay/kbd\";\nexport { DiffStat, diffStatCells, diffStatCount, groupDiffStatCount, DEFAULT_DIFF_STAT_FORMAT, DIFF_STAT_CELLS } from \"./components/dataDisplay/diffStat\";\nexport type { DiffStatProps, DiffStatCell, DiffStatFormat } from \"./components/dataDisplay/diffStat\";\nexport { StatusDot } from \"./components/dataDisplay/statusDot\";\nexport type {\n StatusDotProps,\n StatusDotStatus,\n StatusDotColor,\n StatusDotSize,\n} from \"./components/dataDisplay/statusDot\";\nexport { QrCode } from \"./components/dataDisplay/qrCode\";\nexport type { QrCodeProps, QrCodeErrorCorrection } from \"./components/dataDisplay/qrCode\";\nexport { ThumbCard } from \"./components/dataDisplay/thumbCard\";\nexport type { ThumbCardProps } from \"./components/dataDisplay/thumbCard\";\nexport { AssetGrid } from \"./components/dataDisplay/assetGrid\";\nexport type { AssetGridProps } from \"./components/dataDisplay/assetGrid\";\nexport { Avatar, AvatarGroup } from \"./components/dataDisplay/avatar\";\nexport type { AvatarProps, AvatarGroupProps, AvatarSize } from \"./components/dataDisplay/avatar\";\nexport { PersonChip, initialsOf, avatarColor } from \"./components/dataDisplay/personChip\";\nexport type { PersonChipProps } from \"./components/dataDisplay/personChip\";\nexport { List, ListItem } from \"./components/dataDisplay/list\";\nexport type { ListProps, ListItemProps } from \"./components/dataDisplay/list\";\nexport { DescriptionList, DescriptionItem } from \"./components/dataDisplay/descriptionList\";\nexport type {\n DescriptionListProps,\n DescriptionItemProps,\n DescriptionListEntry,\n DescriptionListLayout,\n} from \"./components/dataDisplay/descriptionList\";\nexport { Accordion } from \"./components/dataDisplay/accordion\";\nexport type { AccordionProps } from \"./components/dataDisplay/accordion\";\nexport { ExpansionPanel } from \"./components/dataDisplay/expansionPanel\";\nexport type {\n ExpansionPanelProps,\n ExpansionPanelLabels,\n ExpansionPanelRenderContext,\n ExpansionPanelControlsContext,\n ExpansionMode,\n} from \"./components/dataDisplay/expansionPanel\";\nexport {\n Table,\n TableHead,\n TableBody,\n TableRow,\n TableCell,\n TableHeadCell,\n TablePagination,\n} from \"./components/dataDisplay/table\";\nexport type {\n TableProps,\n TableHeadProps,\n TableBodyProps,\n TableRowProps,\n TableCellProps,\n TableHeadCellProps,\n TablePaginationProps,\n SortDirection,\n} from \"./components/dataDisplay/table\";\nexport { TreeView } from \"./components/dataDisplay/treeView\";\nexport type { TreeViewProps, ITreeNodeItem } from \"./components/dataDisplay/treeView\";\nexport { Timeline, TimelineGroup, TimelineItem } from \"./components/dataDisplay/timeline\";\nexport type {\n TimelineProps,\n TimelineGroupProps,\n TimelineItemProps,\n TimelineTone,\n} from \"./components/dataDisplay/timeline\";\nexport { Carousel } from \"./components/dataDisplay/carousel\";\nexport type { CarouselProps } from \"./components/dataDisplay/carousel\";\nexport { ImagesList, ImagesListItem, ImagesListItemModal } from \"./components/dataDisplay/imagesList\";\nexport type {\n ImagesListProps,\n ImagesListItemProps,\n ImagesListItemModalProps,\n ImageItem,\n} from \"./components/dataDisplay/imagesList\";\nexport { Kanban, KanbanColumn, KanbanCard } from \"./components/dataDisplay/kanban\";\nexport type { KanbanProps, KanbanColumnProps, KanbanCardProps } from \"./components/dataDisplay/kanban\";\nexport { DagView, dagLayout } from \"./components/dataDisplay/dagView\";\nexport type {\n DagViewProps,\n DagViewNode,\n DagViewEdge,\n DagViewStatus,\n DagViewViewport,\n DagViewApi,\n DagViewNodeState,\n DagViewLabels,\n DagLayoutInput,\n DagLayoutResult,\n} from \"./components/dataDisplay/dagView\";\nexport {\n Swimlanes,\n SWIMLANES_DEFAULT_ROW_HEIGHT,\n SWIMLANES_DEFAULT_HEIGHT,\n SWIMLANES_DEFAULT_OVERSCAN,\n} from \"./components/dataDisplay/swimlanes\";\nexport type { SwimlanesProps, SwimlanesLane } from \"./components/dataDisplay/swimlanes\";\nexport {\n Chat,\n ChatLayout,\n ChatOverlayLayout,\n ChatShell,\n ChatHeader,\n ChatMessages,\n ChatMessageItem,\n ChatMessageIncoming,\n ChatMessageOutgoing,\n ChatMessageSystem,\n ChatMessageBubble,\n ChatMessageSkeleton,\n ChatMessageStatus,\n ChatMessageAvatar,\n ChatAttachments,\n ChatAttachmentImage,\n ChatIconButton,\n ChatComposer,\n createChatInfiniteScroll,\n createChatFileUpload,\n resolveChatFileUploadMaxFiles,\n createChatStickToBottom,\n isScrolledToBottom,\n scrollChatToBottom,\n CHAT_EXPAND_LAYOUTS,\n CHAT_DEFAULT_FILE_UPLOAD_MAX_FILES,\n CHAT_MESSAGE_DELIVERY_STATUSES,\n CHAT_MESSAGE_STATUS_ICONS,\n CHAT_MESSAGE_STATUS_LABELS,\n isImageAttachment,\n formatChatTimestamp,\n resolveAllowedLayouts,\n isChatMessageDeliveryStatus,\n resolveChatMessageStatusIcon,\n resolveChatMessageStatusLabel,\n shouldComposerNewlineOnEnter,\n getChatLayoutActions,\n shouldShowChatCloseButton,\n} from \"./components/dataDisplay/chat\";\nexport type {\n ChatProps,\n ChatFooterComposerProps,\n ChatLayoutProps,\n ChatLayoutChatProps,\n ChatOverlayLayoutProps,\n ChatOverlayLayoutChatProps,\n ChatShellProps,\n ChatHeaderProps,\n ChatMessagesProps,\n ChatMessageItemProps,\n ChatMessageIncomingProps,\n ChatMessageOutgoingProps,\n ChatMessageSystemProps,\n ChatMessageBubbleProps,\n ChatMessageSkeletonProps,\n ChatMessageStatusProps,\n ChatMessageAvatarProps,\n ChatAttachmentsProps,\n ChatAttachmentImageProps,\n ChatIconButtonProps,\n ChatComposerProps,\n CreateChatInfiniteScrollParams,\n CreateChatFileUploadOptions,\n ChatFileUploadState,\n CreateChatStickToBottomParams,\n ChatMessage,\n ChatAttachment,\n ChatAuthor,\n ChatMessageVariant,\n ChatLayoutMode,\n ChatAnchor,\n ChatThemeMode,\n ChatMessageRenderContext,\n ChatLayoutSide,\n ChatMessageDeliveryStatus,\n ChatMessageStatusValue,\n ChatMessageStatusIcons,\n ChatMessageStatusRenderContext,\n ChatComposerNewlineOptions,\n} from \"./components/dataDisplay/chat\";\n\n// feedBack\nexport { Skeleton } from \"./components/feedBack/skeleton\";\nexport type { SkeletonProps } from \"./components/feedBack/skeleton\";\nexport { Message, MessageContainer } from \"./components/feedBack/message\";\nexport type { MessageProps, MessageSeverity } from \"./components/feedBack/message\";\nexport { ProgressIndicator, CircularProgress } from \"./components/feedBack/progressIndicator\";\nexport type {\n ProgressIndicatorProps,\n ProgressColor,\n CircularProgressProps,\n} from \"./components/feedBack/progressIndicator\";\nexport { Tooltip } from \"./components/feedBack/tooltip\";\nexport type { TooltipProps, TooltipTrigger } from \"./components/feedBack/tooltip\";\nexport { Modal } from \"./components/feedBack/modal\";\nexport type { ModalProps, ModalSlotProps } from \"./components/feedBack/modal\";\nexport { SaveAssetDialog } from \"./components/feedBack/saveAssetDialog\";\nexport type { SaveAssetDialogProps } from \"./components/feedBack/saveAssetDialog\";\nexport { ConfirmDialog } from \"./components/feedBack/confirmDialog\";\nexport type { ConfirmDialogProps } from \"./components/feedBack/confirmDialog\";\nexport { EmptyState } from \"./components/feedBack/emptyState\";\nexport type { EmptyStateProps } from \"./components/feedBack/emptyState\";\nexport { SnackbarProvider, Snackbar, useSnackbar } from \"./components/feedBack/snackbar\";\nexport type {\n SnackbarsProviderProps,\n SnackbarProps,\n SnackbarOptions,\n AddSnackbar,\n AddSnackbarOptions,\n Variants as SnackbarVariant,\n Position as SnackbarPosition,\n} from \"./components/feedBack/snackbar\";\n\n// utility\nexport { ClickAwayListener } from \"./components/clickAwayListener\";\nexport type { ClickAwayListenerProps } from \"./components/clickAwayListener\";\n\n// layout\nexport { Divider } from \"./components/layout/divider\";\nexport type { DividerProps, DividerColor } from \"./components/layout/divider\";\nexport { Stack } from \"./components/layout/stack\";\nexport type { StackProps, StackSpacing } from \"./components/layout/stack\";\nexport { Page } from \"./components/layout/page\";\nexport type { PageProps, PageMaxWidth } from \"./components/layout/page\";\nexport { PageHeader } from \"./components/layout/pageHeader\";\nexport type { PageHeaderProps } from \"./components/layout/pageHeader\";\nexport { SectionHeader } from \"./components/layout/sectionHeader\";\nexport type { SectionHeaderProps } from \"./components/layout/sectionHeader\";\nexport { Grid, Row, Column, Container } from \"./components/layout/grid\";\nexport type {\n RowProps,\n ColumnProps,\n ContainerProps,\n BreakpointType,\n ColumnSpan,\n OffsetType,\n Breakpoint,\n ResponsiveBool,\n ContainerMaxWidth,\n} from \"./components/layout/grid\";\nexport { AppLayout } from \"./components/layout/appLayout\";\nexport type { AppLayoutProps } from \"./components/layout/appLayout\";\nexport { ScreenDivider } from \"./components/layout/screenDivider\";\nexport type { ScreenDividerProps } from \"./components/layout/screenDivider\";\nexport { Sheet } from \"./components/layout/sheet\";\nexport type { SheetProps } from \"./components/layout/sheet\";\nexport { FloatingWindow } from \"./components/layout/floatingWindow\";\nexport type {\n FloatingWindowProps,\n FloatingWindowPosition,\n FloatingWindowSize,\n FloatingWindowResizeDir,\n} from \"./components/layout/floatingWindow\";\nexport { TabGroups, tabGroupsLayout } from \"./components/layout/tabGroups\";\nexport type {\n TabGroupsProps,\n TabGroupsTab,\n TabGroupsLabels,\n TabGroupsLayout,\n TabGroupsNode,\n TabGroupsGroup,\n TabGroupsSplit,\n TabGroupsChange,\n TabGroupsEdge,\n TabGroupsDropZone,\n TabGroupsMoveTarget,\n} from \"./components/layout/tabGroups\";\n\n// navigation\nexport { AppBar } from \"./components/navigation/appBar\";\nexport type { AppBarProps, AppBarColor } from \"./components/navigation/appBar\";\nexport { Breadcrumbs } from \"./components/navigation/breadcrumbs\";\nexport type { BreadcrumbsProps } from \"./components/navigation/breadcrumbs\";\nexport { CommandPalette } from \"./components/navigation/commandPalette\";\nexport { commandPaletteFilter, normalizeSearchText } from \"./components/navigation/commandPalette\";\nexport type { CommandPaletteProps } from \"./components/navigation/commandPalette\";\nexport type {\n CommandPaletteFilter,\n CommandPaletteGroup,\n CommandPaletteItem,\n CommandPaletteSource,\n} from \"./components/navigation/commandPalette\";\nexport { Pagination } from \"./components/navigation/pagination\";\nexport type { PaginationProps, PaginationColor } from \"./components/navigation/pagination\";\nexport { Stepper } from \"./components/navigation/stepper\";\nexport type { StepperProps, StepItem } from \"./components/navigation/stepper\";\nexport { Sidebar } from \"./components/navigation/sidebar\";\nexport type { SidebarProps, SidebarMenuItemProps, SidebarVariant } from \"./components/navigation/sidebar\";\nexport { Tabs, Tab, TabPanel, TabsContext, useTabsContext } from \"./components/navigation/tabs\";\nexport type {\n TabsProps,\n TabProps,\n TabActionsApi,\n TabCloseReason,\n TabPanelProps,\n TabsContextValue,\n} from \"./components/navigation/tabs\";\nexport { BottomBar } from \"./components/navigation/bottomBar\";\nexport type { BottomBarProps, BottomBarMenuItemProps } from \"./components/navigation/bottomBar\";\nexport {\n Menu,\n MenuFloating,\n MenuList,\n MenuItem,\n MenuItemIcon,\n MenuItemText,\n MenuDivider,\n MenuSubmenu,\n MenuContext,\n useMenuContext,\n buildMenuFloatingMiddleware,\n} from \"./components/navigation/menu\";\nexport type {\n MenuProps,\n MenuFloatingProps,\n MenuListProps,\n MenuItemProps,\n MenuItemIconProps,\n MenuItemTextProps,\n MenuDividerProps,\n MenuSubmenuProps,\n MenuContextValue,\n} from \"./components/navigation/menu\";\nexport { OverflowMenu } from \"./components/navigation/overflowMenu\";\nexport type { OverflowMenuProps, OverflowMenuItem } from \"./components/navigation/overflowMenu\";\n\n// inputs\nexport { Button } from \"./components/inputs/button\";\nexport type { ButtonProps } from \"./components/inputs/button\";\nexport { ButtonGroup } from \"./components/inputs/buttonGroups\";\nexport type { ButtonGroupProps } from \"./components/inputs/buttonGroups\";\nexport { Checkbox } from \"./components/inputs/checkbox\";\nexport type {\n CheckboxProps,\n SelectionControlSize,\n SelectionControlColor,\n SelectionChangeEvent,\n} from \"./components/inputs/checkbox\";\nexport { Composer } from \"./components/inputs/composer\";\nexport type { ComposerProps, ComposerSendKey, ComposerLayout } from \"./components/inputs/composer\";\nexport { RadioButton } from \"./components/inputs/radioButton\";\nexport type { RadioButtonProps } from \"./components/inputs/radioButton\";\nexport { Toggle } from \"./components/inputs/toggle\";\nexport type { ToggleProps } from \"./components/inputs/toggle\";\nexport { Rating } from \"./components/inputs/rating\";\nexport type { RatingProps, RatingColor } from \"./components/inputs/rating\";\nexport { Slider } from \"./components/inputs/slider\";\nexport type { SliderProps, SliderValue, SliderMark } from \"./components/inputs/slider\";\nexport { ValueSlider } from \"./components/inputs/valueSlider\";\nexport type { ValueSliderProps } from \"./components/inputs/valueSlider\";\nexport { FileInput } from \"./components/inputs/fileInput\";\nexport type { FileInputProps } from \"./components/inputs/fileInput\";\nexport { FileDrop, PreviewWrapper, Preview, CountPreview, isImageFile } from \"./components/inputs/fileDrop\";\nexport type {\n FileUploadProps,\n PreviewWrapperProps,\n PreviewProps,\n CountPreviewProps,\n} from \"./components/inputs/fileDrop\";\nexport { SelectField, DropdownMenu } from \"./components/inputs/selectField\";\nexport type {\n SelectFieldProps,\n OnSelectChange,\n DropdownItem,\n DropdownItemProps,\n} from \"./components/inputs/selectField\";\nexport {\n DatePicker,\n OpenView,\n DataPickerDays,\n DataPickerHeader,\n DataPickerInput,\n DatePickerActionLabel,\n DatePickerDay,\n DatePickerIconButton,\n DatePickerList,\n createDateInput,\n} from \"./components/inputs/datePicker\";\nexport type {\n DatePickerProps,\n DataPickerDaysProps,\n DataPickerHeaderProps,\n DataPickerInputProps,\n ActionLabelProps,\n DatePickerDayProps,\n DataPickerIconButtonProps,\n DatePickerListProps,\n CreateDateInputProps,\n DateInputState,\n} from \"./components/inputs/datePicker\";\nexport {\n TimePicker,\n TimePickerInput,\n TimePickerColumns,\n createTimeInput,\n DEFAULT_TIME_FORMAT,\n} from \"./components/inputs/timePicker\";\nexport type { TimePickerProps, TimePickerInputProps, TimePickerColumnsProps } from \"./components/inputs/timePicker\";\nexport {\n DateTimePicker,\n DateTimePickerInput,\n createDateTimeInput,\n getCurrentDateTimeFormat,\n getDisplayDateTime,\n formatDateTimeByPattern,\n isDateTimePatternMatch,\n parseDateTimeByPattern,\n} from \"./components/inputs/dateTimePicker\";\nexport type {\n DateTimePickerProps,\n DateTimePickerInputProps,\n CreateDateTimeInputProps,\n DateTimeInputState,\n} from \"./components/inputs/dateTimePicker\";\nexport { FloatingButton } from \"./components/inputs/floatingButton\";\nexport type { FloatingButtonProps, FloatingButtonColor } from \"./components/inputs/floatingButton\";\nexport { TextField, TextFieldWrapper, TextFieldAdornment } from \"./components/inputs/textField\";\nexport type {\n TextFieldProps,\n TextFieldWrapperProps,\n TextFieldAdornmentProps,\n TextFieldVariant,\n} from \"./components/inputs/textField\";\n"],
|
|
5
|
-
"mappings": "AAIA,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB;AACzB,SAAS,+BAA+B;AAExC,SAAS,aAAa,aAAa;AACnC,SAAS,sBAAsB;AAE/B,SAAS,uBAAuB;AAEhC,SAAS,2BAA2B;AAMpC,SAAS,sBAAsB;AAE/B,SAAS,yBAAyB;AAElC,SAAS,yBAAyB;AAElC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAEpC,SAAS,4BAA4B;AAErC,SAAS,0BAA0B;AAQnC,SAAS,8BAA8B;AAIvC,SAAS,kBAAkB,yBAAyB,kBAAkB;AAEtE,SAAS,+BAA+B;AAGxC,SAAS,MAAM,cAAc,aAAa,eAAe,yBAAyB;AAIlF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,gBAAgB,eAAe,uBAAuB;AAE/D,SAAS,gBAAgB,sBAAsB;AAE/C,SAAS,cAAc;AAEvB,SAAS,qBAAqB;AAI9B,SAAS,kBAAkB;AAE3B,SAAS,aAAa;AAEtB,SAAS,YAAY;AAErB,SAAS,MAAM,iBAAiB;AAEhC,SAAS,YAAY;AAErB,SAAS,iBAAiB;AAE1B,SAAS,iBAAiB;AAE1B,SAAS,OAAO,YAAY,gCAAgC;
|
|
4
|
+
"sourcesContent": ["// Public entry point for @smwb/ui-solid.\n// Exports are added as components are ported (see src/components/**).\n\n// primitives\nexport { mergeRefs } from \"./primitives/mergeRefs\";\nexport type { Ref, RefCallback } from \"./primitives/mergeRefs\";\nexport { createId } from \"./primitives/createId\";\nexport { createControllableState } from \"./primitives/createControllableState\";\nexport type { CreateControllableStateParams } from \"./primitives/createControllableState\";\nexport { createTheme, Theme } from \"./primitives/createTheme\";\nexport { createFloating } from \"./primitives/createFloating\";\nexport type { CreateFloatingOptions, FloatingState } from \"./primitives/createFloating\";\nexport { createFocusTrap } from \"./primitives/createFocusTrap\";\nexport type { CreateFocusTrapOptions } from \"./primitives/createFocusTrap\";\nexport { createCssTransition } from \"./primitives/createCssTransition\";\nexport type {\n CreateCssTransitionOptions,\n CssTransitionState,\n CssTransitionClassNames,\n} from \"./primitives/createCssTransition\";\nexport { createDropzone } from \"./primitives/createDropzone\";\nexport type { DropzoneOptions, DropzoneState } from \"./primitives/createDropzone\";\nexport { createVirtualList } from \"./primitives/createVirtualList\";\nexport type { CreateVirtualListParams, VirtualListResult } from \"./primitives/createVirtualList\";\nexport { createMaskedInput } from \"./primitives/createMaskedInput\";\nexport type { CreateMaskedInputOptions, MaskedInputState } from \"./primitives/createMaskedInput\";\nexport { createMediaQuery } from \"./primitives/createMediaQuery\";\nexport { createPersistedJson } from \"./primitives/createPersistedJson\";\nexport type { PersistedJson } from \"./primitives/createPersistedJson\";\nexport { createRovingTabIndex } from \"./primitives/createRovingTabIndex\";\nexport type { CreateRovingTabIndexOptions } from \"./primitives/createRovingTabIndex\";\nexport { createHoverPopover } from \"./primitives/createHoverPopover\";\nexport type {\n CreateHoverPopoverOptions,\n HoverPopoverState,\n HoverPopoverPoint,\n HoverPopoverReferenceProps,\n HoverPopoverFloatingProps,\n} from \"./primitives/createHoverPopover\";\nexport { createKeyboardShortcut } from \"./primitives/createKeyboardShortcut\";\nexport type { CreateKeyboardShortcutOptions } from \"./primitives/createKeyboardShortcut\";\n\n// utils\nexport { resolvePlacement, buildFloatingMiddleware, placements } from \"./utils/floating\";\nexport type { Placement, ResolvedPlacement } from \"./utils/floating\";\nexport { matchesKeyboardShortcut } from \"./utils/keyboardShortcut\";\n\n// base\nexport { Icon, IconProvider, IconContext, useIconSource, createIconVersion } from \"./components/base/icon\";\nexport type { IconProps, IconColor, IconProviderProps, IconContextValue } from \"./components/base/icon\";\n// Icon registry API. The icons themselves live behind \"@smwb/ui-solid/icons\" so\n// an app bundles only the ones it registers.\nexport {\n registerIcons,\n unregisterIcons,\n clearIcons,\n getIcon,\n hasIcon,\n listIcons,\n normalizeIconName,\n} from \"./icons/registry\";\nexport type { IconInput } from \"./icons/registry\";\nexport { configureIcons, getIconConfig, resetIconConfig } from \"./icons/config\";\nexport type { IconConfig } from \"./icons/config\";\nexport { subscribeIcons, getIconVersion } from \"./icons/store\";\nexport type { IconDefinition, IconSource } from \"./icons/types\";\nexport { Ripple } from \"./components/base/ripple\";\nexport type { RippleProps, RippleActionsRef, RippleClasses } from \"./components/base/ripple\";\nexport { AnimateHeight } from \"./components/base/animateHeight\";\nexport type { AnimateHeightProps, Height } from \"./components/base/animateHeight\";\n\n// dataDisplay\nexport { Typography } from \"./components/dataDisplay/typography\";\nexport type { TypographyProps, TypographyVariant, TypographyColor } from \"./components/dataDisplay/typography\";\nexport { Badge } from \"./components/dataDisplay/badge\";\nexport type { BadgeProps } from \"./components/dataDisplay/badge\";\nexport { Card } from \"./components/dataDisplay/card\";\nexport type { CardProps } from \"./components/dataDisplay/card\";\nexport { Stat, StatGroup } from \"./components/dataDisplay/stat\";\nexport type { StatProps, StatGroupProps, StatTone } from \"./components/dataDisplay/stat\";\nexport { Chip } from \"./components/dataDisplay/chip\";\nexport type { ChipProps, ChipColor } from \"./components/dataDisplay/chip\";\nexport { LazyImage } from \"./components/dataDisplay/lazyImage\";\nexport type { LazyImageProps } from \"./components/dataDisplay/lazyImage\";\nexport { ChipGroup } from \"./components/dataDisplay/chipGroup\";\nexport type { ChipGroupProps, ChipGroupOption } from \"./components/dataDisplay/chipGroup\";\nexport { Meter, meterColor, DEFAULT_METER_THRESHOLDS } from \"./components/dataDisplay/meter\";\nexport type {\n MeterProps,\n MeterColor,\n MeterThreshold,\n MeterTextPosition,\n MeterSize,\n} from \"./components/dataDisplay/meter\";\nexport { Kbd, detectKbdPlatform, kbdKeyLabel } from \"./components/dataDisplay/kbd\";\nexport type { KbdProps, KbdPlatform, KbdKeyLabel } from \"./components/dataDisplay/kbd\";\nexport {\n DiffStat,\n diffStatCells,\n diffStatCount,\n groupDiffStatCount,\n DEFAULT_DIFF_STAT_FORMAT,\n DIFF_STAT_CELLS,\n} from \"./components/dataDisplay/diffStat\";\nexport type { DiffStatProps, DiffStatCell, DiffStatFormat } from \"./components/dataDisplay/diffStat\";\nexport { StatusDot } from \"./components/dataDisplay/statusDot\";\nexport type {\n StatusDotProps,\n StatusDotStatus,\n StatusDotColor,\n StatusDotSize,\n StatusDotShape,\n} from \"./components/dataDisplay/statusDot\";\nexport { QrCode } from \"./components/dataDisplay/qrCode\";\nexport type { QrCodeProps, QrCodeErrorCorrection } from \"./components/dataDisplay/qrCode\";\nexport { ThumbCard } from \"./components/dataDisplay/thumbCard\";\nexport type { ThumbCardProps } from \"./components/dataDisplay/thumbCard\";\nexport { AssetGrid } from \"./components/dataDisplay/assetGrid\";\nexport type { AssetGridProps } from \"./components/dataDisplay/assetGrid\";\nexport { Avatar, AvatarGroup } from \"./components/dataDisplay/avatar\";\nexport type { AvatarProps, AvatarGroupProps, AvatarSize } from \"./components/dataDisplay/avatar\";\nexport { PersonChip, initialsOf, avatarColor } from \"./components/dataDisplay/personChip\";\nexport type { PersonChipProps } from \"./components/dataDisplay/personChip\";\nexport { List, ListItem } from \"./components/dataDisplay/list\";\nexport type { ListProps, ListItemProps } from \"./components/dataDisplay/list\";\nexport { DescriptionList, DescriptionItem } from \"./components/dataDisplay/descriptionList\";\nexport type {\n DescriptionListProps,\n DescriptionItemProps,\n DescriptionListEntry,\n DescriptionListLayout,\n} from \"./components/dataDisplay/descriptionList\";\nexport { Accordion } from \"./components/dataDisplay/accordion\";\nexport type { AccordionProps } from \"./components/dataDisplay/accordion\";\nexport { ExpansionPanel } from \"./components/dataDisplay/expansionPanel\";\nexport type {\n ExpansionPanelProps,\n ExpansionPanelLabels,\n ExpansionPanelRenderContext,\n ExpansionPanelControlsContext,\n ExpansionMode,\n} from \"./components/dataDisplay/expansionPanel\";\nexport {\n Table,\n TableHead,\n TableBody,\n TableRow,\n TableCell,\n TableHeadCell,\n TablePagination,\n} from \"./components/dataDisplay/table\";\nexport type {\n TableProps,\n TableHeadProps,\n TableBodyProps,\n TableRowProps,\n TableCellProps,\n TableHeadCellProps,\n TablePaginationProps,\n SortDirection,\n} from \"./components/dataDisplay/table\";\nexport { TreeView } from \"./components/dataDisplay/treeView\";\nexport type { TreeViewProps, ITreeNodeItem } from \"./components/dataDisplay/treeView\";\nexport { Timeline, TimelineGroup, TimelineItem } from \"./components/dataDisplay/timeline\";\nexport type {\n TimelineProps,\n TimelineGroupProps,\n TimelineItemProps,\n TimelineTone,\n} from \"./components/dataDisplay/timeline\";\nexport { Carousel } from \"./components/dataDisplay/carousel\";\nexport type { CarouselProps } from \"./components/dataDisplay/carousel\";\nexport { ImagesList, ImagesListItem, ImagesListItemModal } from \"./components/dataDisplay/imagesList\";\nexport type {\n ImagesListProps,\n ImagesListItemProps,\n ImagesListItemModalProps,\n ImageItem,\n} from \"./components/dataDisplay/imagesList\";\nexport { Kanban, KanbanColumn, KanbanCard } from \"./components/dataDisplay/kanban\";\nexport type { KanbanProps, KanbanColumnProps, KanbanCardProps } from \"./components/dataDisplay/kanban\";\nexport { DagView, dagLayout } from \"./components/dataDisplay/dagView\";\nexport type {\n DagViewProps,\n DagViewNode,\n DagViewEdge,\n DagViewStatus,\n DagViewNodeVariant,\n DagViewViewport,\n DagViewApi,\n DagViewNodeState,\n DagViewLabels,\n DagLayoutInput,\n DagLayoutResult,\n} from \"./components/dataDisplay/dagView\";\nexport {\n Swimlanes,\n SWIMLANES_DEFAULT_ROW_HEIGHT,\n SWIMLANES_DEFAULT_HEIGHT,\n SWIMLANES_DEFAULT_OVERSCAN,\n} from \"./components/dataDisplay/swimlanes\";\nexport type { SwimlanesProps, SwimlanesLane } from \"./components/dataDisplay/swimlanes\";\nexport {\n Chat,\n ChatLayout,\n ChatOverlayLayout,\n ChatShell,\n ChatHeader,\n ChatMessages,\n ChatMessageItem,\n ChatMessageIncoming,\n ChatMessageOutgoing,\n ChatMessageSystem,\n ChatMessageBubble,\n ChatMessageSkeleton,\n ChatMessageStatus,\n ChatMessageAvatar,\n ChatAttachments,\n ChatAttachmentImage,\n ChatIconButton,\n ChatComposer,\n createChatInfiniteScroll,\n createChatFileUpload,\n resolveChatFileUploadMaxFiles,\n createChatStickToBottom,\n isScrolledToBottom,\n scrollChatToBottom,\n CHAT_EXPAND_LAYOUTS,\n CHAT_DEFAULT_FILE_UPLOAD_MAX_FILES,\n CHAT_MESSAGE_DELIVERY_STATUSES,\n CHAT_MESSAGE_STATUS_ICONS,\n CHAT_MESSAGE_STATUS_LABELS,\n isImageAttachment,\n formatChatTimestamp,\n resolveAllowedLayouts,\n isChatMessageDeliveryStatus,\n resolveChatMessageStatusIcon,\n resolveChatMessageStatusLabel,\n shouldComposerNewlineOnEnter,\n getChatLayoutActions,\n shouldShowChatCloseButton,\n} from \"./components/dataDisplay/chat\";\nexport type {\n ChatProps,\n ChatFooterComposerProps,\n ChatLayoutProps,\n ChatLayoutChatProps,\n ChatOverlayLayoutProps,\n ChatOverlayLayoutChatProps,\n ChatShellProps,\n ChatHeaderProps,\n ChatMessagesProps,\n ChatMessageItemProps,\n ChatMessageIncomingProps,\n ChatMessageOutgoingProps,\n ChatMessageSystemProps,\n ChatMessageBubbleProps,\n ChatMessageSkeletonProps,\n ChatMessageStatusProps,\n ChatMessageAvatarProps,\n ChatAttachmentsProps,\n ChatAttachmentImageProps,\n ChatIconButtonProps,\n ChatComposerProps,\n CreateChatInfiniteScrollParams,\n CreateChatFileUploadOptions,\n ChatFileUploadState,\n CreateChatStickToBottomParams,\n ChatMessage,\n ChatAttachment,\n ChatAuthor,\n ChatMessageVariant,\n ChatLayoutMode,\n ChatAnchor,\n ChatThemeMode,\n ChatMessageRenderContext,\n ChatLayoutSide,\n ChatMessageDeliveryStatus,\n ChatMessageStatusValue,\n ChatMessageStatusIcons,\n ChatMessageStatusRenderContext,\n ChatComposerNewlineOptions,\n} from \"./components/dataDisplay/chat\";\n\n// feedBack\nexport { Skeleton } from \"./components/feedBack/skeleton\";\nexport type { SkeletonProps } from \"./components/feedBack/skeleton\";\nexport { Message, MessageContainer } from \"./components/feedBack/message\";\nexport type { MessageProps, MessageSeverity } from \"./components/feedBack/message\";\nexport { ProgressIndicator, CircularProgress } from \"./components/feedBack/progressIndicator\";\nexport type {\n ProgressIndicatorProps,\n ProgressColor,\n CircularProgressProps,\n} from \"./components/feedBack/progressIndicator\";\nexport { Tooltip } from \"./components/feedBack/tooltip\";\nexport type { TooltipProps, TooltipTrigger } from \"./components/feedBack/tooltip\";\nexport { Modal } from \"./components/feedBack/modal\";\nexport type { ModalProps, ModalSlotProps } from \"./components/feedBack/modal\";\nexport { SaveAssetDialog } from \"./components/feedBack/saveAssetDialog\";\nexport type { SaveAssetDialogProps } from \"./components/feedBack/saveAssetDialog\";\nexport { ConfirmDialog } from \"./components/feedBack/confirmDialog\";\nexport type { ConfirmDialogProps } from \"./components/feedBack/confirmDialog\";\nexport { EmptyState } from \"./components/feedBack/emptyState\";\nexport type { EmptyStateProps } from \"./components/feedBack/emptyState\";\nexport { SnackbarProvider, Snackbar, useSnackbar } from \"./components/feedBack/snackbar\";\nexport type {\n SnackbarsProviderProps,\n SnackbarProps,\n SnackbarOptions,\n AddSnackbar,\n AddSnackbarOptions,\n Variants as SnackbarVariant,\n Position as SnackbarPosition,\n} from \"./components/feedBack/snackbar\";\n\n// utility\nexport { ClickAwayListener } from \"./components/clickAwayListener\";\nexport type { ClickAwayListenerProps } from \"./components/clickAwayListener\";\n\n// layout\nexport { Divider } from \"./components/layout/divider\";\nexport type { DividerProps, DividerColor } from \"./components/layout/divider\";\nexport { Stack } from \"./components/layout/stack\";\nexport type { StackProps, StackSpacing } from \"./components/layout/stack\";\nexport { Page } from \"./components/layout/page\";\nexport type { PageProps, PageMaxWidth } from \"./components/layout/page\";\nexport { PageHeader } from \"./components/layout/pageHeader\";\nexport type { PageHeaderProps } from \"./components/layout/pageHeader\";\nexport { SectionHeader } from \"./components/layout/sectionHeader\";\nexport type { SectionHeaderProps } from \"./components/layout/sectionHeader\";\nexport { Grid, Row, Column, Container } from \"./components/layout/grid\";\nexport type {\n RowProps,\n ColumnProps,\n ContainerProps,\n BreakpointType,\n ColumnSpan,\n OffsetType,\n Breakpoint,\n ResponsiveBool,\n ContainerMaxWidth,\n} from \"./components/layout/grid\";\nexport { AppLayout } from \"./components/layout/appLayout\";\nexport type { AppLayoutProps } from \"./components/layout/appLayout\";\nexport { ScreenDivider } from \"./components/layout/screenDivider\";\nexport type { ScreenDividerProps } from \"./components/layout/screenDivider\";\nexport { Sheet } from \"./components/layout/sheet\";\nexport type { SheetProps } from \"./components/layout/sheet\";\nexport { FloatingWindow } from \"./components/layout/floatingWindow\";\nexport type {\n FloatingWindowProps,\n FloatingWindowPosition,\n FloatingWindowSize,\n FloatingWindowResizeDir,\n} from \"./components/layout/floatingWindow\";\nexport { TabGroups, tabGroupsLayout } from \"./components/layout/tabGroups\";\nexport type {\n TabGroupsProps,\n TabGroupsStripGroup,\n TabGroupsTab,\n TabGroupsLabels,\n TabGroupsLayout,\n TabGroupsNode,\n TabGroupsGroup,\n TabGroupsSplit,\n TabGroupsChange,\n TabGroupsEdge,\n TabGroupsDropZone,\n TabGroupsMoveTarget,\n} from \"./components/layout/tabGroups\";\n\n// navigation\nexport { AppBar } from \"./components/navigation/appBar\";\nexport type { AppBarProps, AppBarColor } from \"./components/navigation/appBar\";\nexport { Breadcrumbs } from \"./components/navigation/breadcrumbs\";\nexport type { BreadcrumbsProps } from \"./components/navigation/breadcrumbs\";\nexport { CommandPalette } from \"./components/navigation/commandPalette\";\nexport { commandPaletteFilter, normalizeSearchText } from \"./components/navigation/commandPalette\";\nexport type { CommandPaletteProps } from \"./components/navigation/commandPalette\";\nexport type {\n CommandPaletteFilter,\n CommandPaletteGroup,\n CommandPaletteItem,\n CommandPaletteSource,\n} from \"./components/navigation/commandPalette\";\nexport { Pagination } from \"./components/navigation/pagination\";\nexport type { PaginationProps, PaginationColor } from \"./components/navigation/pagination\";\nexport { Stepper } from \"./components/navigation/stepper\";\nexport type { StepperProps, StepItem } from \"./components/navigation/stepper\";\nexport { Sidebar } from \"./components/navigation/sidebar\";\nexport type { SidebarProps, SidebarMenuItemProps, SidebarVariant } from \"./components/navigation/sidebar\";\nexport { Tabs, Tab, TabPanel, TabsContext, useTabsContext } from \"./components/navigation/tabs\";\nexport type {\n TabsProps,\n TabProps,\n TabActionsApi,\n TabCloseReason,\n TabPanelProps,\n TabsContextValue,\n} from \"./components/navigation/tabs\";\nexport { BottomBar } from \"./components/navigation/bottomBar\";\nexport type { BottomBarProps, BottomBarMenuItemProps } from \"./components/navigation/bottomBar\";\nexport {\n Menu,\n MenuFloating,\n MenuList,\n MenuItem,\n MenuItemIcon,\n MenuItemText,\n MenuDivider,\n MenuSubmenu,\n MenuContext,\n useMenuContext,\n buildMenuFloatingMiddleware,\n} from \"./components/navigation/menu\";\nexport type {\n MenuProps,\n MenuFloatingProps,\n MenuListProps,\n MenuItemProps,\n MenuItemIconProps,\n MenuItemTextProps,\n MenuDividerProps,\n MenuSubmenuProps,\n MenuContextValue,\n} from \"./components/navigation/menu\";\nexport { OverflowMenu } from \"./components/navigation/overflowMenu\";\nexport type { OverflowMenuProps, OverflowMenuItem } from \"./components/navigation/overflowMenu\";\n\n// inputs\nexport { Button } from \"./components/inputs/button\";\nexport type { ButtonProps } from \"./components/inputs/button\";\nexport { ButtonGroup } from \"./components/inputs/buttonGroups\";\nexport type { ButtonGroupProps } from \"./components/inputs/buttonGroups\";\nexport { Checkbox } from \"./components/inputs/checkbox\";\nexport type {\n CheckboxProps,\n SelectionControlSize,\n SelectionControlColor,\n SelectionChangeEvent,\n} from \"./components/inputs/checkbox\";\nexport { Composer } from \"./components/inputs/composer\";\nexport type { ComposerProps, ComposerSendKey, ComposerLayout } from \"./components/inputs/composer\";\nexport { RadioButton } from \"./components/inputs/radioButton\";\nexport type { RadioButtonProps } from \"./components/inputs/radioButton\";\nexport { Toggle } from \"./components/inputs/toggle\";\nexport type { ToggleProps } from \"./components/inputs/toggle\";\nexport { Rating } from \"./components/inputs/rating\";\nexport type { RatingProps, RatingColor } from \"./components/inputs/rating\";\nexport { Slider } from \"./components/inputs/slider\";\nexport type { SliderProps, SliderValue, SliderMark } from \"./components/inputs/slider\";\nexport { ValueSlider } from \"./components/inputs/valueSlider\";\nexport type { ValueSliderProps } from \"./components/inputs/valueSlider\";\nexport { FileInput } from \"./components/inputs/fileInput\";\nexport type { FileInputProps } from \"./components/inputs/fileInput\";\nexport { FileDrop, PreviewWrapper, Preview, CountPreview, isImageFile } from \"./components/inputs/fileDrop\";\nexport type {\n FileUploadProps,\n PreviewWrapperProps,\n PreviewProps,\n CountPreviewProps,\n} from \"./components/inputs/fileDrop\";\nexport { SelectField, DropdownMenu } from \"./components/inputs/selectField\";\nexport type {\n SelectFieldProps,\n OnSelectChange,\n DropdownItem,\n DropdownItemProps,\n} from \"./components/inputs/selectField\";\nexport {\n DatePicker,\n OpenView,\n DataPickerDays,\n DataPickerHeader,\n DataPickerInput,\n DatePickerActionLabel,\n DatePickerDay,\n DatePickerIconButton,\n DatePickerList,\n createDateInput,\n} from \"./components/inputs/datePicker\";\nexport type {\n DatePickerProps,\n DataPickerDaysProps,\n DataPickerHeaderProps,\n DataPickerInputProps,\n ActionLabelProps,\n DatePickerDayProps,\n DataPickerIconButtonProps,\n DatePickerListProps,\n CreateDateInputProps,\n DateInputState,\n} from \"./components/inputs/datePicker\";\nexport {\n TimePicker,\n TimePickerInput,\n TimePickerColumns,\n createTimeInput,\n DEFAULT_TIME_FORMAT,\n} from \"./components/inputs/timePicker\";\nexport type { TimePickerProps, TimePickerInputProps, TimePickerColumnsProps } from \"./components/inputs/timePicker\";\nexport {\n DateTimePicker,\n DateTimePickerInput,\n createDateTimeInput,\n getCurrentDateTimeFormat,\n getDisplayDateTime,\n formatDateTimeByPattern,\n isDateTimePatternMatch,\n parseDateTimeByPattern,\n} from \"./components/inputs/dateTimePicker\";\nexport type {\n DateTimePickerProps,\n DateTimePickerInputProps,\n CreateDateTimeInputProps,\n DateTimeInputState,\n} from \"./components/inputs/dateTimePicker\";\nexport { FloatingButton } from \"./components/inputs/floatingButton\";\nexport type { FloatingButtonProps, FloatingButtonColor } from \"./components/inputs/floatingButton\";\nexport { TextField, TextFieldWrapper, TextFieldAdornment } from \"./components/inputs/textField\";\nexport type {\n TextFieldProps,\n TextFieldWrapperProps,\n TextFieldAdornmentProps,\n TextFieldVariant,\n} from \"./components/inputs/textField\";\n"],
|
|
5
|
+
"mappings": "AAIA,SAAS,iBAAiB;AAE1B,SAAS,gBAAgB;AACzB,SAAS,+BAA+B;AAExC,SAAS,aAAa,aAAa;AACnC,SAAS,sBAAsB;AAE/B,SAAS,uBAAuB;AAEhC,SAAS,2BAA2B;AAMpC,SAAS,sBAAsB;AAE/B,SAAS,yBAAyB;AAElC,SAAS,yBAAyB;AAElC,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AAEpC,SAAS,4BAA4B;AAErC,SAAS,0BAA0B;AAQnC,SAAS,8BAA8B;AAIvC,SAAS,kBAAkB,yBAAyB,kBAAkB;AAEtE,SAAS,+BAA+B;AAGxC,SAAS,MAAM,cAAc,aAAa,eAAe,yBAAyB;AAIlF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,gBAAgB,eAAe,uBAAuB;AAE/D,SAAS,gBAAgB,sBAAsB;AAE/C,SAAS,cAAc;AAEvB,SAAS,qBAAqB;AAI9B,SAAS,kBAAkB;AAE3B,SAAS,aAAa;AAEtB,SAAS,YAAY;AAErB,SAAS,MAAM,iBAAiB;AAEhC,SAAS,YAAY;AAErB,SAAS,iBAAiB;AAE1B,SAAS,iBAAiB;AAE1B,SAAS,OAAO,YAAY,gCAAgC;AAQ5D,SAAS,KAAK,mBAAmB,mBAAmB;AAEpD;AAAA,EACE;AAAA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AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOP,SAAS,sBAAsB;AAE/B,SAAS,WAAW,kBAAkB,0BAA0B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const OFFSET_VAR = "--smui-sheet-offset-top";
|
|
2
|
+
const published = [];
|
|
3
|
+
const apply = () => {
|
|
4
|
+
const root = document.documentElement;
|
|
5
|
+
const top = published[published.length - 1];
|
|
6
|
+
if (top) {
|
|
7
|
+
root.style.setProperty(OFFSET_VAR, top.height);
|
|
8
|
+
} else {
|
|
9
|
+
root.style.removeProperty(OFFSET_VAR);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const publishHeaderOffset = (header) => {
|
|
13
|
+
const entry = { height: "" };
|
|
14
|
+
const measure = () => {
|
|
15
|
+
entry.height = `${header.getBoundingClientRect().height}px`;
|
|
16
|
+
apply();
|
|
17
|
+
};
|
|
18
|
+
published.push(entry);
|
|
19
|
+
measure();
|
|
20
|
+
const observer = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(measure);
|
|
21
|
+
observer?.observe(header);
|
|
22
|
+
return () => {
|
|
23
|
+
observer?.disconnect();
|
|
24
|
+
const index = published.indexOf(entry);
|
|
25
|
+
if (index !== -1) {
|
|
26
|
+
published.splice(index, 1);
|
|
27
|
+
}
|
|
28
|
+
apply();
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
publishHeaderOffset
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=publishHeaderOffset.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/primitives/publishHeaderOffset.ts"],
|
|
4
|
+
"sourcesContent": ["/** The page-level variable a `Sheet` reads for the gap above its panel and its scrim. */\nconst OFFSET_VAR = \"--smui-sheet-offset-top\";\n\ninterface PublishedHeader {\n height: string;\n}\n\n/** The headers publishing right now, oldest first: the newest one owns the variable. */\nconst published: PublishedHeader[] = [];\n\nconst apply = (): void => {\n const root = document.documentElement;\n const top = published[published.length - 1];\n if (top) {\n root.style.setProperty(OFFSET_VAR, top.height);\n } else {\n root.style.removeProperty(OFFSET_VAR);\n }\n};\n\n/**\n * Publishes the height of a pinned header as `--smui-sheet-offset-top` on the document element, where a `Sheet`\n * (drawn in a portal on `body`, outside the layout) inherits it, and keeps it current as the header resizes.\n * With several headers at once the most recent one wins, and when it goes the one before it takes over again.\n * Returns a function that withdraws this header; the variable is removed once none is left.\n */\nexport const publishHeaderOffset = (header: HTMLElement): (() => void) => {\n const entry: PublishedHeader = { height: \"\" };\n const measure = (): void => {\n entry.height = `${header.getBoundingClientRect().height}px`;\n apply();\n };\n published.push(entry);\n measure();\n const observer = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(measure);\n observer?.observe(header);\n return () => {\n observer?.disconnect();\n const index = published.indexOf(entry);\n if (index !== -1) {\n published.splice(index, 1);\n }\n apply();\n };\n};\n"],
|
|
5
|
+
"mappings": "AACA,MAAM,aAAa;AAOnB,MAAM,YAA+B,CAAC;AAEtC,MAAM,QAAQ,MAAY;AACxB,QAAM,OAAO,SAAS;AACtB,QAAM,MAAM,UAAU,UAAU,SAAS,CAAC;AAC1C,MAAI,KAAK;AACP,SAAK,MAAM,YAAY,YAAY,IAAI,MAAM;AAAA,EAC/C,OAAO;AACL,SAAK,MAAM,eAAe,UAAU;AAAA,EACtC;AACF;AAQO,MAAM,sBAAsB,CAAC,WAAsC;AACxE,QAAM,QAAyB,EAAE,QAAQ,GAAG;AAC5C,QAAM,UAAU,MAAY;AAC1B,UAAM,SAAS,GAAG,OAAO,sBAAsB,EAAE,MAAM;AACvD,UAAM;AAAA,EACR;AACA,YAAU,KAAK,KAAK;AACpB,UAAQ;AACR,QAAM,WAAW,OAAO,mBAAmB,cAAc,SAAY,IAAI,eAAe,OAAO;AAC/F,YAAU,QAAQ,MAAM;AACxB,SAAO,MAAM;AACX,cAAU,WAAW;AACrB,UAAM,QAAQ,UAAU,QAAQ,KAAK;AACrC,QAAI,UAAU,IAAI;AAChB,gBAAU,OAAO,OAAO,CAAC;AAAA,IAC3B;AACA,UAAM;AAAA,EACR;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -55,13 +55,13 @@ export type { LazyImageProps } from "./components/dataDisplay/lazyImage";
|
|
|
55
55
|
export { ChipGroup } from "./components/dataDisplay/chipGroup";
|
|
56
56
|
export type { ChipGroupProps, ChipGroupOption } from "./components/dataDisplay/chipGroup";
|
|
57
57
|
export { Meter, meterColor, DEFAULT_METER_THRESHOLDS } from "./components/dataDisplay/meter";
|
|
58
|
-
export type { MeterProps, MeterColor, MeterThreshold } from "./components/dataDisplay/meter";
|
|
58
|
+
export type { MeterProps, MeterColor, MeterThreshold, MeterTextPosition, MeterSize, } from "./components/dataDisplay/meter";
|
|
59
59
|
export { Kbd, detectKbdPlatform, kbdKeyLabel } from "./components/dataDisplay/kbd";
|
|
60
60
|
export type { KbdProps, KbdPlatform, KbdKeyLabel } from "./components/dataDisplay/kbd";
|
|
61
|
-
export { DiffStat, diffStatCells, diffStatCount, groupDiffStatCount, DEFAULT_DIFF_STAT_FORMAT, DIFF_STAT_CELLS } from "./components/dataDisplay/diffStat";
|
|
61
|
+
export { DiffStat, diffStatCells, diffStatCount, groupDiffStatCount, DEFAULT_DIFF_STAT_FORMAT, DIFF_STAT_CELLS, } from "./components/dataDisplay/diffStat";
|
|
62
62
|
export type { DiffStatProps, DiffStatCell, DiffStatFormat } from "./components/dataDisplay/diffStat";
|
|
63
63
|
export { StatusDot } from "./components/dataDisplay/statusDot";
|
|
64
|
-
export type { StatusDotProps, StatusDotStatus, StatusDotColor, StatusDotSize, } from "./components/dataDisplay/statusDot";
|
|
64
|
+
export type { StatusDotProps, StatusDotStatus, StatusDotColor, StatusDotSize, StatusDotShape, } from "./components/dataDisplay/statusDot";
|
|
65
65
|
export { QrCode } from "./components/dataDisplay/qrCode";
|
|
66
66
|
export type { QrCodeProps, QrCodeErrorCorrection } from "./components/dataDisplay/qrCode";
|
|
67
67
|
export { ThumbCard } from "./components/dataDisplay/thumbCard";
|
|
@@ -93,7 +93,7 @@ export type { ImagesListProps, ImagesListItemProps, ImagesListItemModalProps, Im
|
|
|
93
93
|
export { Kanban, KanbanColumn, KanbanCard } from "./components/dataDisplay/kanban";
|
|
94
94
|
export type { KanbanProps, KanbanColumnProps, KanbanCardProps } from "./components/dataDisplay/kanban";
|
|
95
95
|
export { DagView, dagLayout } from "./components/dataDisplay/dagView";
|
|
96
|
-
export type { DagViewProps, DagViewNode, DagViewEdge, DagViewStatus, DagViewViewport, DagViewApi, DagViewNodeState, DagViewLabels, DagLayoutInput, DagLayoutResult, } from "./components/dataDisplay/dagView";
|
|
96
|
+
export type { DagViewProps, DagViewNode, DagViewEdge, DagViewStatus, DagViewNodeVariant, DagViewViewport, DagViewApi, DagViewNodeState, DagViewLabels, DagLayoutInput, DagLayoutResult, } from "./components/dataDisplay/dagView";
|
|
97
97
|
export { Swimlanes, SWIMLANES_DEFAULT_ROW_HEIGHT, SWIMLANES_DEFAULT_HEIGHT, SWIMLANES_DEFAULT_OVERSCAN, } from "./components/dataDisplay/swimlanes";
|
|
98
98
|
export type { SwimlanesProps, SwimlanesLane } from "./components/dataDisplay/swimlanes";
|
|
99
99
|
export { Chat, ChatLayout, ChatOverlayLayout, ChatShell, ChatHeader, ChatMessages, ChatMessageItem, ChatMessageIncoming, ChatMessageOutgoing, ChatMessageSystem, ChatMessageBubble, ChatMessageSkeleton, ChatMessageStatus, ChatMessageAvatar, ChatAttachments, ChatAttachmentImage, ChatIconButton, ChatComposer, createChatInfiniteScroll, createChatFileUpload, resolveChatFileUploadMaxFiles, createChatStickToBottom, isScrolledToBottom, scrollChatToBottom, CHAT_EXPAND_LAYOUTS, CHAT_DEFAULT_FILE_UPLOAD_MAX_FILES, CHAT_MESSAGE_DELIVERY_STATUSES, CHAT_MESSAGE_STATUS_ICONS, CHAT_MESSAGE_STATUS_LABELS, isImageAttachment, formatChatTimestamp, resolveAllowedLayouts, isChatMessageDeliveryStatus, resolveChatMessageStatusIcon, resolveChatMessageStatusLabel, shouldComposerNewlineOnEnter, getChatLayoutActions, shouldShowChatCloseButton, } from "./components/dataDisplay/chat";
|
|
@@ -139,7 +139,7 @@ export type { SheetProps } from "./components/layout/sheet";
|
|
|
139
139
|
export { FloatingWindow } from "./components/layout/floatingWindow";
|
|
140
140
|
export type { FloatingWindowProps, FloatingWindowPosition, FloatingWindowSize, FloatingWindowResizeDir, } from "./components/layout/floatingWindow";
|
|
141
141
|
export { TabGroups, tabGroupsLayout } from "./components/layout/tabGroups";
|
|
142
|
-
export type { TabGroupsProps, TabGroupsTab, TabGroupsLabels, TabGroupsLayout, TabGroupsNode, TabGroupsGroup, TabGroupsSplit, TabGroupsChange, TabGroupsEdge, TabGroupsDropZone, TabGroupsMoveTarget, } from "./components/layout/tabGroups";
|
|
142
|
+
export type { TabGroupsProps, TabGroupsStripGroup, TabGroupsTab, TabGroupsLabels, TabGroupsLayout, TabGroupsNode, TabGroupsGroup, TabGroupsSplit, TabGroupsChange, TabGroupsEdge, TabGroupsDropZone, TabGroupsMoveTarget, } from "./components/layout/tabGroups";
|
|
143
143
|
export { AppBar } from "./components/navigation/appBar";
|
|
144
144
|
export type { AppBarProps, AppBarColor } from "./components/navigation/appBar";
|
|
145
145
|
export { Breadcrumbs } from "./components/navigation/breadcrumbs";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Publishes the height of a pinned header as `--smui-sheet-offset-top` on the document element, where a `Sheet`
|
|
3
|
+
* (drawn in a portal on `body`, outside the layout) inherits it, and keeps it current as the header resizes.
|
|
4
|
+
* With several headers at once the most recent one wins, and when it goes the one before it takes over again.
|
|
5
|
+
* Returns a function that withdraws this header; the variable is removed once none is left.
|
|
6
|
+
*/
|
|
7
|
+
export declare const publishHeaderOffset: (header: HTMLElement) => (() => void);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const r = "--smui-sheet-offset-top", s = [], c = () => {
|
|
2
|
+
const t = document.documentElement, e = s[s.length - 1];
|
|
3
|
+
e ? t.style.setProperty(r, e.height) : t.style.removeProperty(r);
|
|
4
|
+
}, p = (t) => {
|
|
5
|
+
const e = { height: "" }, o = () => {
|
|
6
|
+
e.height = `${t.getBoundingClientRect().height}px`, c();
|
|
7
|
+
};
|
|
8
|
+
s.push(e), o();
|
|
9
|
+
const n = typeof ResizeObserver > "u" ? void 0 : new ResizeObserver(o);
|
|
10
|
+
return n?.observe(t), () => {
|
|
11
|
+
n?.disconnect();
|
|
12
|
+
const i = s.indexOf(e);
|
|
13
|
+
i !== -1 && s.splice(i, 1), c();
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
p as publishHeaderOffset
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=publishHeaderOffset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishHeaderOffset.js","sources":["../../src/primitives/publishHeaderOffset.ts"],"sourcesContent":["/** The page-level variable a `Sheet` reads for the gap above its panel and its scrim. */\nconst OFFSET_VAR = \"--smui-sheet-offset-top\";\n\ninterface PublishedHeader {\n height: string;\n}\n\n/** The headers publishing right now, oldest first: the newest one owns the variable. */\nconst published: PublishedHeader[] = [];\n\nconst apply = (): void => {\n const root = document.documentElement;\n const top = published[published.length - 1];\n if (top) {\n root.style.setProperty(OFFSET_VAR, top.height);\n } else {\n root.style.removeProperty(OFFSET_VAR);\n }\n};\n\n/**\n * Publishes the height of a pinned header as `--smui-sheet-offset-top` on the document element, where a `Sheet`\n * (drawn in a portal on `body`, outside the layout) inherits it, and keeps it current as the header resizes.\n * With several headers at once the most recent one wins, and when it goes the one before it takes over again.\n * Returns a function that withdraws this header; the variable is removed once none is left.\n */\nexport const publishHeaderOffset = (header: HTMLElement): (() => void) => {\n const entry: PublishedHeader = { height: \"\" };\n const measure = (): void => {\n entry.height = `${header.getBoundingClientRect().height}px`;\n apply();\n };\n published.push(entry);\n measure();\n const observer = typeof ResizeObserver === \"undefined\" ? undefined : new ResizeObserver(measure);\n observer?.observe(header);\n return () => {\n observer?.disconnect();\n const index = published.indexOf(entry);\n if (index !== -1) {\n published.splice(index, 1);\n }\n apply();\n };\n};\n"],"names":["OFFSET_VAR","published","apply","root","top","publishHeaderOffset","header","entry","measure","observer","index"],"mappings":"AACA,MAAMA,IAAa,2BAObC,IAA+B,CAAA,GAE/BC,IAAQ,MAAY;AACxB,QAAMC,IAAO,SAAS,iBAChBC,IAAMH,EAAUA,EAAU,SAAS,CAAC;AAC1C,EAAIG,IACFD,EAAK,MAAM,YAAYH,GAAYI,EAAI,MAAM,IAE7CD,EAAK,MAAM,eAAeH,CAAU;AAExC,GAQaK,IAAsB,CAACC,MAAsC;AACxE,QAAMC,IAAyB,EAAE,QAAQ,GAAA,GACnCC,IAAU,MAAY;AAC1B,IAAAD,EAAM,SAAS,GAAGD,EAAO,sBAAA,EAAwB,MAAM,MACvDJ,EAAA;AAAA,EACF;AACA,EAAAD,EAAU,KAAKM,CAAK,GACpBC,EAAA;AACA,QAAMC,IAAW,OAAO,iBAAmB,MAAc,SAAY,IAAI,eAAeD,CAAO;AAC/F,SAAAC,GAAU,QAAQH,CAAM,GACjB,MAAM;AACX,IAAAG,GAAU,WAAA;AACV,UAAMC,IAAQT,EAAU,QAAQM,CAAK;AACrC,IAAIG,MAAU,MACZT,EAAU,OAAOS,GAAO,CAAC,GAE3BR,EAAA;AAAA,EACF;AACF;"}
|