@ankhorage/zora 21.0.21 → 21.0.23
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/CHANGELOG.md +15 -0
- package/README.md +36 -184
- package/dist/features/button/adapters/inbound/Button.d.ts +0 -4
- package/dist/features/button/adapters/inbound/Button.d.ts.map +1 -1
- package/dist/features/button/adapters/inbound/Button.js +0 -4
- package/dist/features/button/adapters/inbound/Button.js.map +1 -1
- package/dist/features/card/adapters/inbound/Card.d.ts +0 -4
- package/dist/features/card/adapters/inbound/Card.d.ts.map +1 -1
- package/dist/features/card/adapters/inbound/Card.js +0 -4
- package/dist/features/card/adapters/inbound/Card.js.map +1 -1
- package/dist/features/empty-state/adapters/inbound/EmptyState.d.ts +0 -4
- package/dist/features/empty-state/adapters/inbound/EmptyState.d.ts.map +1 -1
- package/dist/features/empty-state/adapters/inbound/EmptyState.js +0 -4
- package/dist/features/empty-state/adapters/inbound/EmptyState.js.map +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts +0 -4
- package/dist/features/form/text-input/adapters/inbound/TextInput.d.ts.map +1 -1
- package/dist/features/form/text-input/adapters/inbound/TextInput.js +0 -4
- package/dist/features/form/text-input/adapters/inbound/TextInput.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.d.ts +5 -5
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.js +5 -5
- package/dist/features/graph-view/adapters/inbound/web-artifact/GraphView.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphController.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js +7 -7
- package/dist/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.d.ts +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.js +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.d.ts +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.js +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.d.ts +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.js +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.js.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.d.ts +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.d.ts.map +1 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.js +0 -1
- package/dist/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.js.map +1 -1
- package/dist/features/tree-view/adapters/inbound/TreeView.d.ts +1 -1
- package/dist/features/tree-view/adapters/inbound/TreeView.js +1 -1
- package/dist/features/tree-view/adapters/inbound/TreeView.js.map +1 -1
- package/dist/features/tree-view/adapters/inbound/web-artifact/TreeView.d.ts +1 -1
- package/dist/features/tree-view/adapters/inbound/web-artifact/TreeView.js +1 -1
- package/dist/features/tree-view/adapters/inbound/web-artifact/TreeView.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.d.ts +0 -4
- package/dist/features/typography/adapters/inbound/Heading.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Heading.js +0 -4
- package/dist/features/typography/adapters/inbound/Heading.js.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.d.ts +0 -4
- package/dist/features/typography/adapters/inbound/Text.d.ts.map +1 -1
- package/dist/features/typography/adapters/inbound/Text.js +0 -4
- package/dist/features/typography/adapters/inbound/Text.js.map +1 -1
- package/package.json +5 -8
- package/src/features/button/adapters/inbound/Button.tsx +0 -4
- package/src/features/card/adapters/inbound/Card.tsx +0 -4
- package/src/features/empty-state/adapters/inbound/EmptyState.tsx +0 -4
- package/src/features/form/text-input/adapters/inbound/TextInput.tsx +0 -4
- package/src/features/graph-view/adapters/inbound/web-artifact/GraphView.tsx +5 -5
- package/src/features/graph-view/adapters/inbound/web-artifact/compactGraphSpacing.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphController.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphLoopSizer.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/createGraphRuntime.ts +7 -7
- package/src/features/graph-view/adapters/inbound/web-artifact/getGraphGeometryKey.ts +0 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/getGraphTopologyKey.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/hasGraphLayoutChanged.ts +0 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/runDetachedGraphLayout.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/sizeGraphNodesToLabels.ts +1 -1
- package/src/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.ts +0 -1
- package/src/features/tree-view/adapters/inbound/TreeView.tsx +1 -1
- package/src/features/tree-view/adapters/inbound/web-artifact/TreeView.tsx +1 -1
- package/src/features/typography/adapters/inbound/Heading.tsx +0 -4
- package/src/features/typography/adapters/inbound/Text.tsx +0 -4
- package/web-dist/components/graph-view/GraphView.d.ts +5 -5
- package/web-dist/components/tree-view/TreeView.d.ts +1 -1
|
@@ -2,7 +2,6 @@ import type { Core } from 'cytoscape';
|
|
|
2
2
|
import type { GraphViewEdge, GraphViewNode } from './GraphView';
|
|
3
3
|
/***
|
|
4
4
|
* Reconciles graph data in one batch while retaining positions, selection and element identity.
|
|
5
|
-
* @performance
|
|
6
5
|
* Do not replace this with remove-all/add-all: presentation updates must not discard interaction
|
|
7
6
|
* state or force the runtime to rebuild the graph. Use direct ID lookups for obsolete metadata;
|
|
8
7
|
* per-element selector scans would add avoidable work. Runtime tests cover hover/selection updates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncGraphElements.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"syncGraphElements.d.ts","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,IAAI,EACR,KAAK,EAAE,SAAS,aAAa,EAAE,EAC/B,KAAK,EAAE,SAAS,aAAa,EAAE,QAgBhC"}
|
|
@@ -2,7 +2,6 @@ import { isRecord } from '@ankhorage/utility/object';
|
|
|
2
2
|
import { createRenderableGraphElements } from './createRenderableGraphElements';
|
|
3
3
|
/***
|
|
4
4
|
* Reconciles graph data in one batch while retaining positions, selection and element identity.
|
|
5
|
-
* @performance
|
|
6
5
|
* Do not replace this with remove-all/add-all: presentation updates must not discard interaction
|
|
7
6
|
* state or force the runtime to rebuild the graph. Use direct ID lookups for obsolete metadata;
|
|
8
7
|
* per-element selector scans would add avoidable work. Runtime tests cover hover/selection updates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"syncGraphElements.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAGhF
|
|
1
|
+
{"version":3,"file":"syncGraphElements.js","sourceRoot":"","sources":["../../../../../../src/features/graph-view/adapters/inbound/web-artifact/syncGraphElements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAGhF;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,EAAQ,EACR,KAA+B,EAC/B,KAA+B;IAE/B,IAAI,EAAE,CAAC,SAAS,EAAE;QAAE,OAAO;IAE3B,MAAM,QAAQ,GAAG,6BAA6B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC7D,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE;QACZ,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,QAAQ,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1D,MAAM,IAAI,GAAY,QAAQ,CAAC,IAAI,EAAE,CAAC;YACtC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CACjE,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAC3C,CAAC;YACF,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC;gBAAE,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3E,CAAC;QACD,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { isRecord } from '@ankhorage/utility/object';\nimport type { Core } from 'cytoscape';\n\nimport { createRenderableGraphElements } from './createRenderableGraphElements';\nimport type { GraphViewEdge, GraphViewNode } from './GraphView';\n\n/***\n * Reconciles graph data in one batch while retaining positions, selection and element identity.\n * Do not replace this with remove-all/add-all: presentation updates must not discard interaction\n * state or force the runtime to rebuild the graph. Use direct ID lookups for obsolete metadata;\n * per-element selector scans would add avoidable work. Runtime tests cover hover/selection updates.\n */\nexport function syncGraphElements(\n cy: Core,\n nodes: readonly GraphViewNode[],\n edges: readonly GraphViewEdge[],\n) {\n if (cy.destroyed()) return;\n\n const elements = createRenderableGraphElements(nodes, edges);\n cy.batch(() => {\n for (const element of elements) {\n const existing = cy.getElementById(element.data.id ?? '');\n const data: unknown = existing.data();\n const obsoleteKeys = Object.keys(isRecord(data) ? data : {}).filter(\n (key) => !Object.hasOwn(element.data, key),\n );\n if (obsoleteKeys.length > 0) existing.removeData(obsoleteKeys.join(' '));\n }\n cy.json({ elements });\n });\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import type { TreeViewProps } from '../../../../types/tree-view';
|
|
3
3
|
/***
|
|
4
4
|
* Tree view pattern for hierarchical navigation and expandable lists.
|
|
5
|
-
*
|
|
5
|
+
* expansionIndicator Select `folder` (default) or `chevron` for leading expansion controls.
|
|
6
6
|
* Expansion controls are separate from row selection, including when rendering custom row content.
|
|
7
7
|
*/
|
|
8
8
|
export declare const TreeView: <TId extends string = string>(props: TreeViewProps<TId>) => React.ReactElement | null;
|
|
@@ -23,7 +23,7 @@ function TreeViewInner({ themeId: _themeId, mode: _mode, nodes, selectedId, expa
|
|
|
23
23
|
}
|
|
24
24
|
/***
|
|
25
25
|
* Tree view pattern for hierarchical navigation and expandable lists.
|
|
26
|
-
*
|
|
26
|
+
* expansionIndicator Select `folder` (default) or `chevron` for leading expansion controls.
|
|
27
27
|
* Expansion controls are separate from row selection, including when rendering custom row content.
|
|
28
28
|
*/
|
|
29
29
|
export const TreeView = withZoraThemeScope(TreeViewInner);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../../../src/features/tree-view/adapters/inbound/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,2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CAAC,CAAC,kBAAkB,CAAC,CACnC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,EACrC,CACH,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport type { TreeViewProps } from '../../../../types/tree-view';\nimport { View } from '../../../layout/public';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { toggleExpandedIds } from '../../utils/toggleExpandedIds';\nimport { TreeItem } from './TreeItem';\n\n/*** Render the themed TreeView while supporting controlled or internal expansion state. */\nfunction TreeViewInner<TId extends string = string>({\n themeId: _themeId,\n mode: _mode,\n nodes,\n selectedId,\n expandedIds: controlledExpandedIds,\n defaultExpandedIds,\n onSelect,\n onExpandedChange,\n renderItem,\n expansionIndicator = 'folder',\n testID,\n interactionPolicy,\n}: TreeViewProps<TId>) {\n const [internalExpandedIds, setInternalExpandedIds] = React.useState<readonly TId[]>(\n defaultExpandedIds ?? [],\n );\n\n const isControlled = controlledExpandedIds !== undefined;\n const expandedIds = isControlled ? controlledExpandedIds : internalExpandedIds;\n\n const handleToggleExpand = (id: TId) => {\n if (interactionPolicy === 'passive') return;\n const nextExpandedIds = toggleExpandedIds(expandedIds, id);\n\n if (!isControlled) {\n setInternalExpandedIds(nextExpandedIds);\n }\n onExpandedChange?.(nextExpandedIds);\n };\n\n return (\n <View gap=\"none\" testID={testID}>\n {nodes.map((node) => (\n <TreeItem\n key={node.id}\n depth={0}\n expandedIds={expandedIds}\n expansionIndicator={expansionIndicator}\n node={node}\n onSelect={onSelect}\n onToggleExpand={handleToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n interactionPolicy={interactionPolicy}\n />\n ))}\n </View>\n );\n}\n\n/***\n * Tree view pattern for hierarchical navigation and expandable lists.\n *
|
|
1
|
+
{"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../../../src/features/tree-view/adapters/inbound/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,2FAA2F;AAC3F,SAAS,aAAa,CAA8B,EAClD,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,KAAK,EACL,UAAU,EACV,WAAW,EAAE,qBAAqB,EAClC,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,kBAAkB,GAAG,QAAQ,EAC7B,MAAM,EACN,iBAAiB,GACE;IACnB,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAClE,kBAAkB,IAAI,EAAE,CACzB,CAAC;IAEF,MAAM,YAAY,GAAG,qBAAqB,KAAK,SAAS,CAAC;IACzD,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAE/E,MAAM,kBAAkB,GAAG,CAAC,EAAO,EAAE,EAAE;QACrC,IAAI,iBAAiB,KAAK,SAAS;YAAE,OAAO;QAC5C,MAAM,eAAe,GAAG,iBAAiB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAE3D,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,sBAAsB,CAAC,eAAe,CAAC,CAAC;QAC1C,CAAC;QACD,gBAAgB,EAAE,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC9B;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,CAAC,QAAQ,CACP,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACb,KAAK,CAAC,CAAC,CAAC,CAAC,CACT,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,cAAc,CAAC,CAAC,kBAAkB,CAAC,CACnC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,EACrC,CACH,CAAC,CACJ;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport type { TreeViewProps } from '../../../../types/tree-view';\nimport { View } from '../../../layout/public';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { toggleExpandedIds } from '../../utils/toggleExpandedIds';\nimport { TreeItem } from './TreeItem';\n\n/*** Render the themed TreeView while supporting controlled or internal expansion state. */\nfunction TreeViewInner<TId extends string = string>({\n themeId: _themeId,\n mode: _mode,\n nodes,\n selectedId,\n expandedIds: controlledExpandedIds,\n defaultExpandedIds,\n onSelect,\n onExpandedChange,\n renderItem,\n expansionIndicator = 'folder',\n testID,\n interactionPolicy,\n}: TreeViewProps<TId>) {\n const [internalExpandedIds, setInternalExpandedIds] = React.useState<readonly TId[]>(\n defaultExpandedIds ?? [],\n );\n\n const isControlled = controlledExpandedIds !== undefined;\n const expandedIds = isControlled ? controlledExpandedIds : internalExpandedIds;\n\n const handleToggleExpand = (id: TId) => {\n if (interactionPolicy === 'passive') return;\n const nextExpandedIds = toggleExpandedIds(expandedIds, id);\n\n if (!isControlled) {\n setInternalExpandedIds(nextExpandedIds);\n }\n onExpandedChange?.(nextExpandedIds);\n };\n\n return (\n <View gap=\"none\" testID={testID}>\n {nodes.map((node) => (\n <TreeItem\n key={node.id}\n depth={0}\n expandedIds={expandedIds}\n expansionIndicator={expansionIndicator}\n node={node}\n onSelect={onSelect}\n onToggleExpand={handleToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n interactionPolicy={interactionPolicy}\n />\n ))}\n </View>\n );\n}\n\n/***\n * Tree view pattern for hierarchical navigation and expandable lists.\n * expansionIndicator Select `folder` (default) or `chevron` for leading expansion controls.\n * Expansion controls are separate from row selection, including when rendering custom row content.\n */\nexport const TreeView = withZoraThemeScope(TreeViewInner);\n"]}
|
|
@@ -30,7 +30,7 @@ export interface TreeViewProps<TId extends string = string> {
|
|
|
30
30
|
}
|
|
31
31
|
/***
|
|
32
32
|
* Render the standalone browser TreeView artifact without React Native runtime dependencies.
|
|
33
|
-
*
|
|
33
|
+
* expansionIndicator Use `chevron` beside custom node icons, or `folder` (default) for
|
|
34
34
|
* built-in folder/file indicators. Expansion is leading and independent from row selection.
|
|
35
35
|
*/
|
|
36
36
|
export declare function TreeView<TId extends string = string>({ nodes, selectedId, expandedIds: controlledExpandedIds, defaultExpandedIds, onSelect, onExpandedChange, renderItem, expansionIndicator, className, style, ariaLabel, }: TreeViewProps<TId>): React.JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { toggleExpandedIds } from '../../../utils/toggleExpandedIds';
|
|
|
3
3
|
import { TreeItemRow } from './TreeItemRow';
|
|
4
4
|
/***
|
|
5
5
|
* Render the standalone browser TreeView artifact without React Native runtime dependencies.
|
|
6
|
-
*
|
|
6
|
+
* expansionIndicator Use `chevron` beside custom node icons, or `folder` (default) for
|
|
7
7
|
* built-in folder/file indicators. Expansion is leading and independent from row selection.
|
|
8
8
|
*/
|
|
9
9
|
export function TreeView({ nodes, selectedId, expandedIds: controlledExpandedIds, defaultExpandedIds, onSelect, onExpandedChange, renderItem, expansionIndicator = 'folder', className, style, ariaLabel = 'Tree', }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../../../../src/features/tree-view/adapters/inbound/web-artifact/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAkC5C;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAA8B,EACpD,KAAK,EACL,UAAU,EACV,WAAW,EAAE,qBAAqB,EAClC,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,kBAAkB,GAAG,QAAQ,EAC7B,SAAS,EACT,KAAK,EACL,SAAS,GAAG,MAAM,GACC;IACnB,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAClE,kBAAkB,IAAI,EAAE,CACzB,CAAC;IACF,MAAM,YAAY,GAAG,qBAAqB,KAAK,SAAS,CAAC;IACzD,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAC/E,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAC1C,CAAC,EAAO,EAAE,EAAE;QACV,MAAM,eAAe,GAAG,iBAAiB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,YAAY;YAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;QAC3D,gBAAgB,EAAE,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC,EACD,CAAC,WAAW,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAC9C,CAAC;IAEF,OAAO,CACL,CAAC,GAAG,CACF,UAAU,CAAC,CAAC,SAAS,CAAC,CACtB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,IAAI,CAAC,MAAM,CACX,KAAK,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,EAAE,CAAC,CAEnC;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,CAAC,WAAW,CACV,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACb,KAAK,CAAC,CAAC,CAAC,CAAC,CACT,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,cAAc,CAAC,CAAC,kBAAkB,CAAC,CACnC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC,CACJ;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,CAAC;CAC2B,CAAC","sourcesContent":["import React from 'react';\n\nimport { toggleExpandedIds } from '../../../utils/toggleExpandedIds';\nimport { TreeItemRow } from './TreeItemRow';\n\nexport interface TreeItemNode<TId extends string = string> {\n readonly id: TId;\n readonly label: React.ReactNode;\n readonly icon?: React.ReactNode;\n readonly children?: readonly TreeItemNode<TId>[];\n readonly disabled?: boolean;\n readonly meta?: React.ReactNode;\n readonly actions?: React.ReactNode;\n}\n\nexport interface TreeItemRenderProps<TId extends string = string> {\n readonly node: TreeItemNode<TId>;\n readonly depth: number;\n readonly selected: boolean;\n readonly expanded: boolean;\n readonly hasChildren: boolean;\n}\n\nexport interface TreeViewProps<TId extends string = string> {\n readonly nodes: readonly TreeItemNode<TId>[];\n readonly selectedId?: TId;\n readonly expandedIds?: readonly TId[];\n readonly defaultExpandedIds?: readonly TId[];\n readonly onSelect?: (id: TId) => void;\n readonly onExpandedChange?: (ids: readonly TId[]) => void;\n readonly renderItem?: (props: TreeItemRenderProps<TId>) => React.ReactNode;\n readonly expansionIndicator?: 'chevron' | 'folder';\n readonly className?: string;\n readonly style?: React.CSSProperties;\n readonly ariaLabel?: string;\n}\n\n/***\n * Render the standalone browser TreeView artifact without React Native runtime dependencies.\n *
|
|
1
|
+
{"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../../../../src/features/tree-view/adapters/inbound/web-artifact/TreeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAkC5C;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAA8B,EACpD,KAAK,EACL,UAAU,EACV,WAAW,EAAE,qBAAqB,EAClC,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,kBAAkB,GAAG,QAAQ,EAC7B,SAAS,EACT,KAAK,EACL,SAAS,GAAG,MAAM,GACC;IACnB,MAAM,CAAC,mBAAmB,EAAE,sBAAsB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAClE,kBAAkB,IAAI,EAAE,CACzB,CAAC;IACF,MAAM,YAAY,GAAG,qBAAqB,KAAK,SAAS,CAAC;IACzD,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAC/E,MAAM,kBAAkB,GAAG,KAAK,CAAC,WAAW,CAC1C,CAAC,EAAO,EAAE,EAAE;QACV,MAAM,eAAe,GAAG,iBAAiB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC3D,IAAI,CAAC,YAAY;YAAE,sBAAsB,CAAC,eAAe,CAAC,CAAC;QAC3D,gBAAgB,EAAE,CAAC,eAAe,CAAC,CAAC;IACtC,CAAC,EACD,CAAC,WAAW,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAC9C,CAAC;IAEF,OAAO,CACL,CAAC,GAAG,CACF,UAAU,CAAC,CAAC,SAAS,CAAC,CACtB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,IAAI,CAAC,MAAM,CACX,KAAK,CAAC,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,EAAE,CAAC,CAEnC;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,CAAC,WAAW,CACV,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACb,KAAK,CAAC,CAAC,CAAC,CAAC,CACT,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,cAAc,CAAC,CAAC,kBAAkB,CAAC,CACnC,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAC,CACJ;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,CAAC;CAC2B,CAAC","sourcesContent":["import React from 'react';\n\nimport { toggleExpandedIds } from '../../../utils/toggleExpandedIds';\nimport { TreeItemRow } from './TreeItemRow';\n\nexport interface TreeItemNode<TId extends string = string> {\n readonly id: TId;\n readonly label: React.ReactNode;\n readonly icon?: React.ReactNode;\n readonly children?: readonly TreeItemNode<TId>[];\n readonly disabled?: boolean;\n readonly meta?: React.ReactNode;\n readonly actions?: React.ReactNode;\n}\n\nexport interface TreeItemRenderProps<TId extends string = string> {\n readonly node: TreeItemNode<TId>;\n readonly depth: number;\n readonly selected: boolean;\n readonly expanded: boolean;\n readonly hasChildren: boolean;\n}\n\nexport interface TreeViewProps<TId extends string = string> {\n readonly nodes: readonly TreeItemNode<TId>[];\n readonly selectedId?: TId;\n readonly expandedIds?: readonly TId[];\n readonly defaultExpandedIds?: readonly TId[];\n readonly onSelect?: (id: TId) => void;\n readonly onExpandedChange?: (ids: readonly TId[]) => void;\n readonly renderItem?: (props: TreeItemRenderProps<TId>) => React.ReactNode;\n readonly expansionIndicator?: 'chevron' | 'folder';\n readonly className?: string;\n readonly style?: React.CSSProperties;\n readonly ariaLabel?: string;\n}\n\n/***\n * Render the standalone browser TreeView artifact without React Native runtime dependencies.\n * expansionIndicator Use `chevron` beside custom node icons, or `folder` (default) for\n * built-in folder/file indicators. Expansion is leading and independent from row selection.\n */\nexport function TreeView<TId extends string = string>({\n nodes,\n selectedId,\n expandedIds: controlledExpandedIds,\n defaultExpandedIds,\n onSelect,\n onExpandedChange,\n renderItem,\n expansionIndicator = 'folder',\n className,\n style,\n ariaLabel = 'Tree',\n}: TreeViewProps<TId>) {\n const [internalExpandedIds, setInternalExpandedIds] = React.useState<readonly TId[]>(\n defaultExpandedIds ?? [],\n );\n const isControlled = controlledExpandedIds !== undefined;\n const expandedIds = isControlled ? controlledExpandedIds : internalExpandedIds;\n const handleToggleExpand = React.useCallback(\n (id: TId) => {\n const nextExpandedIds = toggleExpandedIds(expandedIds, id);\n if (!isControlled) setInternalExpandedIds(nextExpandedIds);\n onExpandedChange?.(nextExpandedIds);\n },\n [expandedIds, isControlled, onExpandedChange],\n );\n\n return (\n <div\n aria-label={ariaLabel}\n className={className}\n role=\"tree\"\n style={{ ...TREE_STYLE, ...style }}\n >\n {nodes.map((node) => (\n <TreeItemRow\n key={node.id}\n depth={0}\n expandedIds={expandedIds}\n expansionIndicator={expansionIndicator}\n node={node}\n onSelect={onSelect}\n onToggleExpand={handleToggleExpand}\n renderItem={renderItem}\n selectedId={selectedId}\n />\n ))}\n </div>\n );\n}\n\nconst TREE_STYLE = {\n display: 'flex',\n flexDirection: 'column',\n minWidth: 0,\n} as const satisfies React.CSSProperties;\n"]}
|
|
@@ -6,10 +6,6 @@ import type { HeadingProps } from '../../../../types/heading';
|
|
|
6
6
|
* `Heading` gives consumers a ZORA-owned title API with semantic levels,
|
|
7
7
|
* responsive sizes, and theme-aware emphasis while preserving header semantics.
|
|
8
8
|
*
|
|
9
|
-
* @example Section title
|
|
10
|
-
* ```tsx
|
|
11
|
-
* <Heading level={2} size="xl">Account settings</Heading>
|
|
12
|
-
* ```
|
|
13
9
|
*/
|
|
14
10
|
export declare const Heading: (props: HeadingProps) => React.ReactElement | null;
|
|
15
11
|
//# sourceMappingURL=Heading.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../../../src/features/typography/adapters/inbound/Heading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAO9D
|
|
1
|
+
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../../../../src/features/typography/adapters/inbound/Heading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAO9D;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,oDAAmC,CAAC"}
|
|
@@ -13,10 +13,6 @@ import { resolveHeadingThemeRecipe } from '../../utils/resolveHeadingThemeRecipe
|
|
|
13
13
|
* `Heading` gives consumers a ZORA-owned title API with semantic levels,
|
|
14
14
|
* responsive sizes, and theme-aware emphasis while preserving header semantics.
|
|
15
15
|
*
|
|
16
|
-
* @example Section title
|
|
17
|
-
* ```tsx
|
|
18
|
-
* <Heading level={2} size="xl">Account settings</Heading>
|
|
19
|
-
* ```
|
|
20
16
|
*/
|
|
21
17
|
export const Heading = withZoraThemeScope(HeadingInner);
|
|
22
18
|
const headingLayoutStyle = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.js","sourceRoot":"","sources":["../../../../../src/features/typography/adapters/inbound/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,eAAe,EAAkB,MAAM,cAAc,CAAC;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF
|
|
1
|
+
{"version":3,"file":"Heading.js","sourceRoot":"","sources":["../../../../../src/features/typography/adapters/inbound/Heading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,eAAe,EAAkB,MAAM,cAAc,CAAC;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;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,KAAK,EAAE,aAAa;gBACpB,QAAQ,EAAE,gBAAgB;gBAC1B,MAAM,EAAE,cAAc;aACvB,CAAC;YACF,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';\nimport React from 'react';\nimport { Platform, Text as ReactNativeText, type TextStyle } from 'react-native';\n\nimport type { HeadingProps } from '../../../../types/heading';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../../../theme/composition/useZoraTheme';\nimport { useZoraThemeRecipe } from '../../../theme/composition/useZoraThemeRecipe';\nimport { resolveHeadingRecipe } from '../../utils/resolveHeadingRecipe';\nimport { resolveHeadingSizeFromLevel } from '../../utils/resolveHeadingSizeFromLevel';\nimport { resolveHeadingThemeRecipe } from '../../utils/resolveHeadingThemeRecipe';\n/***\n * Structured title primitive for accessible page, section, and card headings.\n *\n * `Heading` gives consumers a ZORA-owned title API with semantic levels,\n * responsive sizes, and theme-aware emphasis while preserving header semantics.\n *\n */\nexport const Heading = withZoraThemeScope(HeadingInner);\n\nconst headingLayoutStyle: TextStyle = {\n flexShrink: 1,\n maxWidth: '100%',\n minWidth: 0,\n ...(Platform.OS === 'web'\n ? {\n overflowWrap: 'break-word',\n whiteSpace: 'normal',\n wordBreak: 'normal',\n }\n : null),\n};\n\nfunction resolveHeadingContent({\n children,\n text,\n i18nKey,\n}: Pick<HeadingProps, 'children' | 'text' | 'i18nKey'>) {\n if (children !== undefined) return children;\n if (text !== undefined) return text;\n if (i18nKey === undefined || i18nKey === '') return null;\n return i18nKey;\n}\n\nfunction HeadingInner({\n themeId: _themeId,\n mode: _mode,\n children,\n text,\n i18nKey,\n level = 2,\n size,\n color,\n emphasis,\n align,\n weight,\n italic,\n numberOfLines,\n ellipsizeMode,\n selectable,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole,\n nativeID,\n testID,\n interactionPolicy: _interactionPolicy,\n}: HeadingProps) {\n const { theme } = useZoraTheme();\n const { breakpoint } = useResponsiveRuntime();\n const themeRecipe = resolveHeadingThemeRecipe(useZoraThemeRecipe('Heading'));\n const content = resolveHeadingContent({ children, text, i18nKey });\n const resolvedSize =\n resolveResponsive(size ?? themeRecipe.size, breakpoint) ?? resolveHeadingSizeFromLevel(level);\n const resolvedColor = resolveResponsive(color ?? themeRecipe.color, breakpoint);\n const resolvedEmphasis =\n resolveResponsive(emphasis ?? themeRecipe.emphasis, breakpoint) ?? 'default';\n const resolvedAlign = resolveResponsive(align ?? themeRecipe.align, breakpoint);\n const resolvedWeight = resolveResponsive(weight ?? themeRecipe.weight, breakpoint);\n\n if (content === null) return null;\n\n return (\n <ReactNativeText\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n accessibilityRole={accessibilityRole ?? 'header'}\n ellipsizeMode={ellipsizeMode}\n nativeID={nativeID}\n numberOfLines={numberOfLines}\n selectable={selectable}\n testID={testID}\n style={[\n headingLayoutStyle,\n resolveHeadingRecipe(theme, {\n align: resolvedAlign,\n italic: italic ?? themeRecipe.italic ?? false,\n level,\n size: resolvedSize,\n color: resolvedColor,\n emphasis: resolvedEmphasis,\n weight: resolvedWeight,\n }),\n style,\n ]}\n >\n {content}\n </ReactNativeText>\n );\n}\n"]}
|
|
@@ -6,10 +6,6 @@ import type { TextProps } from '../../../../types/text';
|
|
|
6
6
|
* `Text` owns normal body, caption, label, code, and supporting-copy variants so
|
|
7
7
|
* consumers do not need to import lower-level Surface typography directly.
|
|
8
8
|
*
|
|
9
|
-
* @example Muted supporting copy
|
|
10
|
-
* ```tsx
|
|
11
|
-
* <Text variant="bodySmall" emphasis="muted">Updated just now</Text>
|
|
12
|
-
* ```
|
|
13
9
|
*/
|
|
14
10
|
export declare const Text: (props: TextProps) => React.ReactElement | null;
|
|
15
11
|
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/features/typography/adapters/inbound/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMxD
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../../../../src/features/typography/adapters/inbound/Text.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAMxD;;;;;;GAMG;AACH,eAAO,MAAM,IAAI,iDAAgC,CAAC"}
|
|
@@ -12,10 +12,6 @@ import { resolveTextThemeRecipe } from '../../utils/resolveTextThemeRecipe';
|
|
|
12
12
|
* `Text` owns normal body, caption, label, code, and supporting-copy variants so
|
|
13
13
|
* consumers do not need to import lower-level Surface typography directly.
|
|
14
14
|
*
|
|
15
|
-
* @example Muted supporting copy
|
|
16
|
-
* ```tsx
|
|
17
|
-
* <Text variant="bodySmall" emphasis="muted">Updated just now</Text>
|
|
18
|
-
* ```
|
|
19
15
|
*/
|
|
20
16
|
export const Text = withZoraThemeScope(TextInner);
|
|
21
17
|
const textLayoutStyle = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../../../../src/features/typography/adapters/inbound/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,IAAI,IAAI,eAAe,EAAkB,MAAM,cAAc,CAAC;AAGjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,oDAAoD,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAA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AI,OAAO,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAE3D,OAAO,CACL,CAAC,eAAe,CACd,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,CACvC,uBAAuB,CAAC,CAAC,uBAAuB,CAAC,CACjD,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,aAAa,CAAC,CAAC,aAAa,CAAC,CAC7B,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,KAAK,CAAC,CAAC,CAAC,eAAe,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAE/C;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC","sourcesContent":["import { resolveResponsive, useResponsiveRuntime } from '@ankhorage/surface';\nimport React from 'react';\nimport { Platform, Text as ReactNativeText, type TextStyle } from 'react-native';\n\nimport type { TextProps } from '../../../../types/text';\nimport { withZoraThemeScope } from '../../../theme/adapters/inbound/withZoraThemeScope';\nimport { useZoraTheme } from '../../../theme/composition/useZoraTheme';\nimport { useZoraThemeRecipe } from '../../../theme/composition/useZoraThemeRecipe';\nimport { resolveTextStyle } from '../../utils/resolveTextStyle';\nimport { resolveTextThemeRecipe } from '../../utils/resolveTextThemeRecipe';\n/***\n * Structured copy primitive for theme-aware app text.\n *\n * `Text` owns normal body, caption, label, code, and supporting-copy variants so\n * consumers do not need to import lower-level Surface typography directly.\n *\n */\nexport const Text = withZoraThemeScope(TextInner);\n\nconst textLayoutStyle: TextStyle = {\n flexShrink: 1,\n maxWidth: '100%',\n minWidth: 0,\n ...(Platform.OS === 'web'\n ? {\n overflowWrap: 'break-word',\n whiteSpace: 'normal',\n wordBreak: 'normal',\n }\n : null),\n};\n\nfunction resolveTextContent({\n children,\n text,\n i18nKey,\n}: {\n children: TextProps['children'];\n text: TextProps['text'];\n i18nKey: TextProps['i18nKey'];\n}): React.ReactNode {\n if (children !== undefined) return children;\n if (text !== undefined) return text;\n if (i18nKey === undefined || i18nKey === '') return null;\n return i18nKey;\n}\n\nfunction TextInner({\n themeId: _themeId,\n mode: _mode,\n children,\n text,\n i18nKey,\n variant,\n color,\n emphasis,\n align,\n weight,\n italic,\n numberOfLines,\n ellipsizeMode,\n selectable,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole,\n accessibilityLiveRegion,\n nativeID,\n testID,\n interactionPolicy: _interactionPolicy,\n}: TextProps) {\n const { theme } = useZoraTheme();\n const { breakpoint } = useResponsiveRuntime();\n const themeRecipe = resolveTextThemeRecipe(useZoraThemeRecipe('Text'));\n const content = resolveTextContent({ children, text, i18nKey });\n const resolvedVariant = resolveResponsive(variant ?? themeRecipe.variant, breakpoint) ?? 'body';\n const resolvedStyle = resolveTextStyle({\n theme,\n breakpoint,\n variant: resolvedVariant,\n color: color ?? themeRecipe.color,\n emphasis: emphasis ?? themeRecipe.emphasis,\n align: align ?? themeRecipe.align,\n weight: weight ?? themeRecipe.weight,\n italic: italic ?? themeRecipe.italic ?? false,\n });\n\n if (content === null || content === undefined) return null;\n\n return (\n <ReactNativeText\n accessibilityHint={accessibilityHint}\n accessibilityLabel={accessibilityLabel}\n accessibilityLiveRegion={accessibilityLiveRegion}\n accessibilityRole={accessibilityRole}\n ellipsizeMode={ellipsizeMode}\n nativeID={nativeID}\n numberOfLines={numberOfLines}\n selectable={selectable}\n testID={testID}\n style={[textLayoutStyle, resolvedStyle, style]}\n >\n {content}\n </ReactNativeText>\n );\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "21.0.
|
|
4
|
+
"version": "21.0.23",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@ankhorage/color-theory": "^0.3.1",
|
|
44
44
|
"@ankhorage/contracts": "^22.8.2",
|
|
45
|
-
"@ankhorage/surface": "^9.1.
|
|
46
|
-
"@ankhorage/utility": "^1.8.
|
|
45
|
+
"@ankhorage/surface": "^9.1.7",
|
|
46
|
+
"@ankhorage/utility": "^1.8.1",
|
|
47
47
|
"expo-document-picker": "~57.0.1",
|
|
48
48
|
"expo-image-picker": "~57.0.16"
|
|
49
49
|
},
|
|
@@ -117,13 +117,12 @@
|
|
|
117
117
|
"format:check": "ankhorage-prettier --check .",
|
|
118
118
|
"prepack": "bun run build",
|
|
119
119
|
"test": "bun run build && bun test src",
|
|
120
|
-
"test:next-materialization": "bun scripts/web-artifacts/verifyNextWebMaterialization.ts",
|
|
121
120
|
"typecheck": "bun x tsc --noEmit -p tsconfig.json && bun x tsc --noEmit -p tsconfig.scripts.json",
|
|
122
121
|
"version-packages": "ankhorage-changeset version"
|
|
123
122
|
},
|
|
124
123
|
"devDependencies": {
|
|
125
|
-
"@ankhorage/devtools": "^
|
|
126
|
-
"@ankhorage/paradox": "^0.
|
|
124
|
+
"@ankhorage/devtools": "^2.0.0",
|
|
125
|
+
"@ankhorage/paradox": "^0.2.6",
|
|
127
126
|
"@react-native-vector-icons/fontawesome": "^13.1.3",
|
|
128
127
|
"@react-native-vector-icons/fontawesome5": "^13.1.3",
|
|
129
128
|
"@react-native-vector-icons/fontawesome6": "^13.1.3",
|
|
@@ -136,8 +135,6 @@
|
|
|
136
135
|
"cytoscape": "^3.34.3",
|
|
137
136
|
"cytoscape-elk": "^2.3.0",
|
|
138
137
|
"happy-dom": "^20.11.6",
|
|
139
|
-
"next": "16.3.5",
|
|
140
|
-
"playwright-core": "^1.58.2",
|
|
141
138
|
"react": "19.2.3",
|
|
142
139
|
"react-dom": "19.2.3",
|
|
143
140
|
"react-native": "0.86.3",
|
|
@@ -11,10 +11,6 @@ import { resolveButtonThemeRecipe } from '../../utils/resolveButtonThemeRecipe';
|
|
|
11
11
|
* Use `Button` for explicit user actions that should follow ZORA's semantic color,
|
|
12
12
|
* variant, and size recipes across React Native and React Native Web.
|
|
13
13
|
*
|
|
14
|
-
* @example Basic action
|
|
15
|
-
* ```tsx
|
|
16
|
-
* <Button color="primary" variant="solid" onPress={save}>Save</Button>
|
|
17
|
-
* ```
|
|
18
14
|
*/
|
|
19
15
|
export const Button = withZoraThemeScope(ButtonInner);
|
|
20
16
|
|
|
@@ -15,10 +15,6 @@ import { resolveCardVariant } from '../../utils/resolveCardVariant';
|
|
|
15
15
|
* Use `Card` for reusable content blocks that should inherit ZORA spacing,
|
|
16
16
|
* radius, tone, and responsive header layout without hand-assembling primitives.
|
|
17
17
|
*
|
|
18
|
-
* @example Content card
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <Card title="Project" description="Latest activity">...</Card>
|
|
21
|
-
* ```
|
|
22
18
|
*/
|
|
23
19
|
export const Card = withZoraThemeScope(CardInner);
|
|
24
20
|
|
|
@@ -66,9 +66,5 @@ function EmptyStateInner({
|
|
|
66
66
|
* so apps can guide users without custom card and button wiring.
|
|
67
67
|
*
|
|
68
68
|
|
|
69
|
-
* @example Empty project list
|
|
70
|
-
* ```tsx
|
|
71
|
-
* <EmptyState title="No projects yet" primaryAction={{ label: 'Create project', onPress }} />
|
|
72
|
-
* ```
|
|
73
69
|
*/
|
|
74
70
|
export const EmptyState = withZoraThemeScope(EmptyStateInner);
|
|
@@ -58,9 +58,5 @@ function TextInputInner({
|
|
|
58
58
|
*
|
|
59
59
|
* Use `TextInput` for single-line, multiline, and password form controls with ZORA styling.
|
|
60
60
|
*
|
|
61
|
-
* @example Search input
|
|
62
|
-
* ```tsx
|
|
63
|
-
* <TextInput placeholder="Search" leadingIcon={{ name: 'search-outline' }} />
|
|
64
|
-
* ```
|
|
65
61
|
*/
|
|
66
62
|
export const TextInput = withZoraThemeScope(TextInputInner);
|
|
@@ -124,13 +124,13 @@ type GraphContainer = NonNullable<CytoscapeOptions['container']>;
|
|
|
124
124
|
|
|
125
125
|
/***
|
|
126
126
|
* Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal.
|
|
127
|
-
*
|
|
127
|
+
* zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative
|
|
128
128
|
* to the visible-node fit (1 = fit). The default `absolute` keeps engine-space zoom units.
|
|
129
|
-
*
|
|
129
|
+
* sizeNodesToLabels Opt in to renderer-measured plain labels, including bold and Unicode
|
|
130
130
|
* text. Keep padding in styleRules. Compound and rich-node dimensions retain their existing owners.
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
131
|
+
* minReadableLabelSize Expand the manual zoom ceiling until plain labels reach this CSS-pixel size.
|
|
132
|
+
* maxFitLabelSize Cap automatic fitting at this plain-label CSS-pixel size, leaving whitespace for tiny graphs.
|
|
133
|
+
* onSpacingFactorChange Receive the spacing accepted by explicit fit({ optimizeSpacing: true }).
|
|
134
134
|
* Ordinary zoom never adjusts spacing or relayouts. Explicit optimization preserves layout ordering
|
|
135
135
|
* and uses bounded collision checks including labels and compound siblings; it can recover uniformly
|
|
136
136
|
* cramped layouts but cannot repair non-uniform overlaps.
|
|
@@ -10,7 +10,7 @@ const SEARCH_ITERATIONS = 8;
|
|
|
10
10
|
/***
|
|
11
11
|
* Optimize settled layout spacing around readable label bounds instead of full node clearance.
|
|
12
12
|
* Compound containment stays intentional while sibling groups retain non-overlapping boundaries.
|
|
13
|
-
*
|
|
13
|
+
* Cytoscape geometry is measured once, then bounded pure numeric trials reuse the
|
|
14
14
|
* immutable snapshot. No layout reruns, zoom work, or intermediate frames are painted.
|
|
15
15
|
*/
|
|
16
16
|
export function compactGraphSpacing(cy: Core, spacingFactor: number): number {
|
|
@@ -112,7 +112,7 @@ function positiveSize(value: number | undefined, fallback: number): number {
|
|
|
112
112
|
|
|
113
113
|
/***
|
|
114
114
|
* Recompute the fit reference only after layout or resize, never on every pan/zoom event.
|
|
115
|
-
*
|
|
115
|
+
* Cache the geometry-derived scale in the viewport owner; labels are included, edges excluded.
|
|
116
116
|
*/
|
|
117
117
|
function getNodeFitZoom(cy: Core, padding: number): number {
|
|
118
118
|
if (cy.nodes().empty()) return 1;
|
|
@@ -2,7 +2,7 @@ import type { Core } from 'cytoscape';
|
|
|
2
2
|
|
|
3
3
|
/***
|
|
4
4
|
* Keeps self-loop control points outside the rendered node, independent of label size and direction.
|
|
5
|
-
*
|
|
5
|
+
* Reconcile loop geometry only after size/style/layout changes, never on pan or zoom.
|
|
6
6
|
* Preserve valid dependencies and configured larger loops; do not hide edges or silence warnings.
|
|
7
7
|
*/
|
|
8
8
|
export function createGraphLoopSizer(cy: Core) {
|
|
@@ -150,7 +150,7 @@ function createRuntimeState(
|
|
|
150
150
|
|
|
151
151
|
/***
|
|
152
152
|
* Reconcile presentation in place and relayout only when graph geometry or layout policy changes.
|
|
153
|
-
*
|
|
153
|
+
* Batch reconciliation and skip layout for presentation-only updates.
|
|
154
154
|
*/
|
|
155
155
|
function updateRuntime(state: GraphRuntimeState, input: GraphRuntimeUpdate) {
|
|
156
156
|
if (state.cy.destroyed()) return;
|
|
@@ -227,7 +227,7 @@ function startCurrentLayout(state: GraphRuntimeState, input: GraphRuntimeUpdate)
|
|
|
227
227
|
|
|
228
228
|
/***
|
|
229
229
|
* Settle only the latest layout generation and fit once from node bounds.
|
|
230
|
-
*
|
|
230
|
+
* Discard stale completions and avoid repeated automatic fits.
|
|
231
231
|
*/
|
|
232
232
|
function completeCurrentLayout(state: GraphRuntimeState, generation: number) {
|
|
233
233
|
scheduleGraphFrame(() => {
|
|
@@ -265,7 +265,7 @@ function completeCurrentLayout(state: GraphRuntimeState, generation: number) {
|
|
|
265
265
|
|
|
266
266
|
/***
|
|
267
267
|
* Handle explicit readable-fit intent in the runtime owner, never from zoom or React effects.
|
|
268
|
-
*
|
|
268
|
+
* Bounded spacing optimization preserves the settled algorithm instead of repeatedly running it.
|
|
269
269
|
*/
|
|
270
270
|
function requestOptimizedFit(state: GraphRuntimeState, options: GraphViewFitOptions) {
|
|
271
271
|
if (state.cy.destroyed()) return;
|
|
@@ -319,7 +319,7 @@ function applyGraphStyles(
|
|
|
319
319
|
|
|
320
320
|
/***
|
|
321
321
|
* Synchronize controlled selection without rerunning layout.
|
|
322
|
-
*
|
|
322
|
+
* Selection updates must not trigger graph reconstruction or layout.
|
|
323
323
|
*/
|
|
324
324
|
function setSelectedNodeIds(state: GraphRuntimeState, nodeIds: readonly string[] | undefined) {
|
|
325
325
|
if (state.cy.destroyed() || nodeIds === undefined) return;
|
|
@@ -333,7 +333,7 @@ function setSelectedNodeIds(state: GraphRuntimeState, nodeIds: readonly string[]
|
|
|
333
333
|
|
|
334
334
|
/***
|
|
335
335
|
* Persist one rich-node size and schedule at most one relayout for changed geometry.
|
|
336
|
-
*
|
|
336
|
+
* Ignore unchanged measurements before scheduling layout work.
|
|
337
337
|
*/
|
|
338
338
|
function setNodeSize(state: GraphRuntimeState, id: string, size: GraphViewSize) {
|
|
339
339
|
const previous = state.nodeSizes.get(id);
|
|
@@ -357,7 +357,7 @@ function applyNodeSize(cy: Core, id: string, size: GraphViewSize) {
|
|
|
357
357
|
|
|
358
358
|
/***
|
|
359
359
|
* Coalesce DOM measurements into one follow-up layout generation.
|
|
360
|
-
*
|
|
360
|
+
* Keep one scheduled layout per frame instead of one per measured node.
|
|
361
361
|
*/
|
|
362
362
|
function scheduleMeasuredNodeRelayout(state: GraphRuntimeState) {
|
|
363
363
|
if (state.relayoutScheduledRef.current) return;
|
|
@@ -382,7 +382,7 @@ function subscribeRenderedNodes(state: GraphRuntimeState, listener: RenderedNode
|
|
|
382
382
|
|
|
383
383
|
/***
|
|
384
384
|
* Publish current rendered node positions only to active rich-node subscribers.
|
|
385
|
-
*
|
|
385
|
+
* Skip snapshot preparation when no overlay is subscribed.
|
|
386
386
|
*/
|
|
387
387
|
function emitRenderedNodes(
|
|
388
388
|
state: Pick<GraphRuntimeState, 'cy' | 'hoveredNodeIds' | 'renderedNodeListeners'>,
|
|
@@ -2,7 +2,6 @@ import type { Core } from 'cytoscape';
|
|
|
2
2
|
|
|
3
3
|
/***
|
|
4
4
|
* Identifies layout-relevant leaf dimensions without including positions or presentation colors.
|
|
5
|
-
* @performance
|
|
6
5
|
* Adding viewport, color or arbitrary data to this key turns interaction updates into relayouts.
|
|
7
6
|
* Measure after style reconciliation; actual size changes still require layout. Compound bounds
|
|
8
7
|
* follow child positions, so keying their measured bounds would feed layout output back into input.
|
|
@@ -2,7 +2,7 @@ import type { GraphViewEdge, GraphViewNode } from './GraphView';
|
|
|
2
2
|
|
|
3
3
|
/***
|
|
4
4
|
* Identify visible graph membership and hierarchy independently of presentation metadata.
|
|
5
|
-
*
|
|
5
|
+
* Keep presentation-only changes out of the relayout decision.
|
|
6
6
|
*/
|
|
7
7
|
export function getGraphTopologyKey(
|
|
8
8
|
nodes: readonly GraphViewNode[],
|
|
@@ -3,7 +3,6 @@ import { getGraphTopologyKey } from './getGraphTopologyKey';
|
|
|
3
3
|
|
|
4
4
|
/***
|
|
5
5
|
* Detects topology and explicit layout-policy changes independently of highlight metadata.
|
|
6
|
-
* @performance
|
|
7
6
|
* New node/edge array identities alone are not a layout request: consumers may update classes
|
|
8
7
|
* and colors on hover or selection. Keep structural identity separate from presentation and
|
|
9
8
|
* combine this decision with measured geometry in the single runtime owner, not consumer effects.
|
|
@@ -3,7 +3,7 @@ import cytoscape, { type Core, type LayoutOptions } from 'cytoscape';
|
|
|
3
3
|
|
|
4
4
|
/***
|
|
5
5
|
* Isolate an uncancellable layout from the displayed core and discard stopped generations.
|
|
6
|
-
*
|
|
6
|
+
* Apply current positions in one batch without rebuilding the displayed graph.
|
|
7
7
|
* A stopped ELK computation still runs to completion; this guard does not cancel its CPU work.
|
|
8
8
|
*/
|
|
9
9
|
export function runDetachedGraphLayout(cy: Core, options: LayoutOptions, onComplete: () => void) {
|
|
@@ -2,7 +2,7 @@ import type { Core } from 'cytoscape';
|
|
|
2
2
|
|
|
3
3
|
/***
|
|
4
4
|
* Size plain leaf nodes from the renderer's styled label bounds, keeping padding in the stylesheet.
|
|
5
|
-
*
|
|
5
|
+
* Reuse Cytoscape's cached text measurements during reconciliation, never a per-element
|
|
6
6
|
* style callback or a pan/zoom listener. Only write changed dimensions; bold and Unicode labels must
|
|
7
7
|
* not regress to character-count estimates. Compound dimensions remain owned by child bounds.
|
|
8
8
|
*/
|
|
@@ -6,7 +6,6 @@ import type { GraphViewEdge, GraphViewNode } from './GraphView';
|
|
|
6
6
|
|
|
7
7
|
/***
|
|
8
8
|
* Reconciles graph data in one batch while retaining positions, selection and element identity.
|
|
9
|
-
* @performance
|
|
10
9
|
* Do not replace this with remove-all/add-all: presentation updates must not discard interaction
|
|
11
10
|
* state or force the runtime to rebuild the graph. Use direct ID lookups for obsolete metadata;
|
|
12
11
|
* per-element selector scans would add avoidable work. Runtime tests cover hover/selection updates.
|
|
@@ -60,7 +60,7 @@ function TreeViewInner<TId extends string = string>({
|
|
|
60
60
|
|
|
61
61
|
/***
|
|
62
62
|
* Tree view pattern for hierarchical navigation and expandable lists.
|
|
63
|
-
*
|
|
63
|
+
* expansionIndicator Select `folder` (default) or `chevron` for leading expansion controls.
|
|
64
64
|
* Expansion controls are separate from row selection, including when rendering custom row content.
|
|
65
65
|
*/
|
|
66
66
|
export const TreeView = withZoraThemeScope(TreeViewInner);
|
|
@@ -37,7 +37,7 @@ export interface TreeViewProps<TId extends string = string> {
|
|
|
37
37
|
|
|
38
38
|
/***
|
|
39
39
|
* Render the standalone browser TreeView artifact without React Native runtime dependencies.
|
|
40
|
-
*
|
|
40
|
+
* expansionIndicator Use `chevron` beside custom node icons, or `folder` (default) for
|
|
41
41
|
* built-in folder/file indicators. Expansion is leading and independent from row selection.
|
|
42
42
|
*/
|
|
43
43
|
export function TreeView<TId extends string = string>({
|
|
@@ -15,10 +15,6 @@ import { resolveHeadingThemeRecipe } from '../../utils/resolveHeadingThemeRecipe
|
|
|
15
15
|
* `Heading` gives consumers a ZORA-owned title API with semantic levels,
|
|
16
16
|
* responsive sizes, and theme-aware emphasis while preserving header semantics.
|
|
17
17
|
*
|
|
18
|
-
* @example Section title
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <Heading level={2} size="xl">Account settings</Heading>
|
|
21
|
-
* ```
|
|
22
18
|
*/
|
|
23
19
|
export const Heading = withZoraThemeScope(HeadingInner);
|
|
24
20
|
|
|
@@ -14,10 +14,6 @@ import { resolveTextThemeRecipe } from '../../utils/resolveTextThemeRecipe';
|
|
|
14
14
|
* `Text` owns normal body, caption, label, code, and supporting-copy variants so
|
|
15
15
|
* consumers do not need to import lower-level Surface typography directly.
|
|
16
16
|
*
|
|
17
|
-
* @example Muted supporting copy
|
|
18
|
-
* ```tsx
|
|
19
|
-
* <Text variant="bodySmall" emphasis="muted">Updated just now</Text>
|
|
20
|
-
* ```
|
|
21
17
|
*/
|
|
22
18
|
export const Text = withZoraThemeScope(TextInner);
|
|
23
19
|
|
|
@@ -97,13 +97,13 @@ export interface GraphViewProps {
|
|
|
97
97
|
export type GraphViewCallbacks = Pick<GraphViewProps, 'onEdgeEvent' | 'onLayoutComplete' | 'onNodeEvent' | 'onReady' | 'onViewportChange' | 'onSpacingFactorChange'>;
|
|
98
98
|
/***
|
|
99
99
|
* Render a browser graph while one runtime owns Cytoscape layout, viewport, and disposal.
|
|
100
|
-
*
|
|
100
|
+
* zoomMode Use `fit-relative` to make controller zoom, events and min/max limits relative
|
|
101
101
|
* to the visible-node fit (1 = fit). The default `absolute` keeps engine-space zoom units.
|
|
102
|
-
*
|
|
102
|
+
* sizeNodesToLabels Opt in to renderer-measured plain labels, including bold and Unicode
|
|
103
103
|
* text. Keep padding in styleRules. Compound and rich-node dimensions retain their existing owners.
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
104
|
+
* minReadableLabelSize Expand the manual zoom ceiling until plain labels reach this CSS-pixel size.
|
|
105
|
+
* maxFitLabelSize Cap automatic fitting at this plain-label CSS-pixel size, leaving whitespace for tiny graphs.
|
|
106
|
+
* onSpacingFactorChange Receive the spacing accepted by explicit fit({ optimizeSpacing: true }).
|
|
107
107
|
* Ordinary zoom never adjusts spacing or relayouts. Explicit optimization preserves layout ordering
|
|
108
108
|
* and uses bounded collision checks including labels and compound siblings; it can recover uniformly
|
|
109
109
|
* cramped layouts but cannot repair non-uniform overlaps.
|
|
@@ -30,7 +30,7 @@ export interface TreeViewProps<TId extends string = string> {
|
|
|
30
30
|
}
|
|
31
31
|
/***
|
|
32
32
|
* Render the standalone browser TreeView artifact without React Native runtime dependencies.
|
|
33
|
-
*
|
|
33
|
+
* expansionIndicator Use `chevron` beside custom node icons, or `folder` (default) for
|
|
34
34
|
* built-in folder/file indicators. Expansion is leading and independent from row selection.
|
|
35
35
|
*/
|
|
36
36
|
export declare function TreeView<TId extends string = string>({ nodes, selectedId, expandedIds: controlledExpandedIds, defaultExpandedIds, onSelect, onExpandedChange, renderItem, expansionIndicator, className, style, ariaLabel, }: TreeViewProps<TId>): React.JSX.Element;
|