@silverpoint/react 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-grid.js +3 -2
- package/dist/area-chart.js +3 -2
- package/dist/bar-chart.js +3 -2
- package/dist/base-C6zY78Va.d.ts +8 -0
- package/dist/bubble-chart.js +3 -2
- package/dist/bullet-chart.js +3 -2
- package/dist/candlestick-chart.js +3 -2
- package/dist/chord-ring.js +3 -2
- package/dist/chunk-2JWLXUY5.js +16 -0
- package/dist/chunk-2JWLXUY5.js.map +1 -0
- package/dist/{chunk-74ONV2GE.js → chunk-3BREGZ7C.js} +2 -2
- package/dist/{chunk-J5OOZDFF.js → chunk-3U3Z5U6H.js} +2 -2
- package/dist/chunk-3WUPWJP2.js +17 -0
- package/dist/chunk-3WUPWJP2.js.map +1 -0
- package/dist/chunk-43AIURD6.js +21 -0
- package/dist/chunk-43AIURD6.js.map +1 -0
- package/dist/chunk-5FKONGCL.js +16 -0
- package/dist/chunk-5FKONGCL.js.map +1 -0
- package/dist/chunk-67FND3TB.js +26 -0
- package/dist/chunk-67FND3TB.js.map +1 -0
- package/dist/{chunk-X2ACXB2U.js → chunk-6EFRIK7Q.js} +2 -2
- package/dist/{chunk-6KPX5HYV.js → chunk-6M4REUJE.js} +2 -2
- package/dist/chunk-6NXL245Z.js +16 -0
- package/dist/chunk-6NXL245Z.js.map +1 -0
- package/dist/{chunk-WOKDS6AK.js → chunk-6S6VKQ3E.js} +2 -2
- package/dist/{chunk-DTBEXYYC.js → chunk-AEU6UHVG.js} +2 -2
- package/dist/chunk-ART7CMBL.js +16 -0
- package/dist/chunk-ART7CMBL.js.map +1 -0
- package/dist/{chunk-A42AKCPS.js → chunk-C3NHZ4N5.js} +2 -2
- package/dist/chunk-CWFUPKSS.js +20 -0
- package/dist/chunk-CWFUPKSS.js.map +1 -0
- package/dist/chunk-DO4VUIUU.js +61 -0
- package/dist/chunk-DO4VUIUU.js.map +1 -0
- package/dist/{chunk-2NQ4DXLT.js → chunk-ESFN6FJY.js} +2 -2
- package/dist/{chunk-WNX4XCL6.js → chunk-FBJLA3P7.js} +11 -45
- package/dist/chunk-FBJLA3P7.js.map +1 -0
- package/dist/{chunk-NW2SQ6QW.js → chunk-FHX2HWN3.js} +2 -2
- package/dist/{chunk-KDQHOND7.js → chunk-FZ46YSJA.js} +2 -2
- package/dist/chunk-G7C4CH54.js +17 -0
- package/dist/chunk-G7C4CH54.js.map +1 -0
- package/dist/{chunk-GYUTG5R2.js → chunk-GSJYA76X.js} +2 -2
- package/dist/{chunk-TKQ2PQDW.js → chunk-GUKXFITX.js} +2 -2
- package/dist/{chunk-TAQOBBF7.js → chunk-I72JGA6Q.js} +2 -2
- package/dist/{chunk-H4NCK6RE.js → chunk-J3E6IUUQ.js} +2 -2
- package/dist/{chunk-4LS7B7CK.js → chunk-JPTK2AAT.js} +2 -2
- package/dist/{chunk-WHZ4ALRI.js → chunk-JWCVL7VE.js} +2 -2
- package/dist/{chunk-XWSCKTPG.js → chunk-KVOBNPDN.js} +2 -2
- package/dist/chunk-LSA5XU52.js +18 -0
- package/dist/chunk-LSA5XU52.js.map +1 -0
- package/dist/chunk-M56MDRNT.js +17 -0
- package/dist/chunk-M56MDRNT.js.map +1 -0
- package/dist/{chunk-FZMY6NWJ.js → chunk-MC7N4KQA.js} +2 -2
- package/dist/{chunk-UXVYCPFL.js → chunk-MYKZWY2E.js} +2 -2
- package/dist/{chunk-GBTH55AM.js → chunk-NA6K372D.js} +2 -2
- package/dist/{chunk-E5LIZKJT.js → chunk-NWK6VBCJ.js} +2 -2
- package/dist/{chunk-WICFKWEZ.js → chunk-NWRCFNYB.js} +2 -2
- package/dist/{chunk-CERHTEML.js → chunk-OAH7AEGE.js} +2 -2
- package/dist/chunk-OP2WE7MA.js +31 -0
- package/dist/chunk-OP2WE7MA.js.map +1 -0
- package/dist/{chunk-OFDVE64G.js → chunk-PRVJKYEQ.js} +2 -2
- package/dist/chunk-QRYI7BEO.js +21 -0
- package/dist/chunk-QRYI7BEO.js.map +1 -0
- package/dist/{chunk-P53KSCPE.js → chunk-RAATAHXZ.js} +2 -2
- package/dist/{chunk-FQHAHZBR.js → chunk-RIGQTEKW.js} +2 -2
- package/dist/{chunk-NHUVAE4Z.js → chunk-RMIIFPXA.js} +2 -2
- package/dist/chunk-SQ6GWXDK.js +48 -0
- package/dist/chunk-SQ6GWXDK.js.map +1 -0
- package/dist/chunk-TH6Q4E7C.js +21 -0
- package/dist/chunk-TH6Q4E7C.js.map +1 -0
- package/dist/{chunk-H3UH7F5S.js → chunk-TSQWTDBK.js} +2 -2
- package/dist/{chunk-7KED5KUU.js → chunk-U3LT444G.js} +2 -2
- package/dist/{chunk-JRAHTS5O.js → chunk-UOOHQAJU.js} +2 -2
- package/dist/{chunk-VISNFHPM.js → chunk-VKNGQ4NW.js} +2 -2
- package/dist/{chunk-ZKLVP4JE.js → chunk-WFO6BICV.js} +2 -2
- package/dist/chunk-WMU6O6KZ.js +21 -0
- package/dist/chunk-WMU6O6KZ.js.map +1 -0
- package/dist/chunk-WZZA2IGN.js +44 -0
- package/dist/chunk-WZZA2IGN.js.map +1 -0
- package/dist/{chunk-PWFDYIXV.js → chunk-X2F56RYM.js} +2 -2
- package/dist/chunk-ZBSCLF56.js +33 -0
- package/dist/chunk-ZBSCLF56.js.map +1 -0
- package/dist/chunk-ZOB6BH7H.js +21 -0
- package/dist/chunk-ZOB6BH7H.js.map +1 -0
- package/dist/composed-chart.js +3 -2
- package/dist/coxcomb-chart.js +3 -2
- package/dist/donut-chart.js +3 -2
- package/dist/funnel-chart.js +3 -2
- package/dist/gauge-arc.js +3 -2
- package/dist/heatmap-chart.js +3 -2
- package/dist/index.js +36 -35
- package/dist/index.js.map +1 -1
- package/dist/kpi-card.js +3 -2
- package/dist/line-chart.js +3 -2
- package/dist/meter-chart.js +3 -2
- package/dist/orbit-chart.js +3 -2
- package/dist/polar-bar-chart.js +3 -2
- package/dist/pyramid-chart.js +3 -2
- package/dist/radar-chart.js +3 -2
- package/dist/radial-arc-group.js +3 -2
- package/dist/radial-rings.js +3 -2
- package/dist/range-band-chart.js +3 -2
- package/dist/sankey-chart.js +3 -2
- package/dist/scatter-chart.js +3 -2
- package/dist/server/ui/alert.d.ts +17 -0
- package/dist/server/ui/alert.js +13 -0
- package/dist/server/ui/alert.js.map +1 -0
- package/dist/server/ui/badge.d.ts +15 -0
- package/dist/server/ui/badge.js +14 -0
- package/dist/server/ui/badge.js.map +1 -0
- package/dist/server/ui/card.d.ts +18 -0
- package/dist/server/ui/card.js +14 -0
- package/dist/server/ui/card.js.map +1 -0
- package/dist/server/ui/divider.d.ts +12 -0
- package/dist/server/ui/divider.js +13 -0
- package/dist/server/ui/divider.js.map +1 -0
- package/dist/server/ui/progress.d.ts +14 -0
- package/dist/server/ui/progress.js +13 -0
- package/dist/server/ui/progress.js.map +1 -0
- package/dist/server/ui/skeleton.d.ts +14 -0
- package/dist/server/ui/skeleton.js +13 -0
- package/dist/server/ui/skeleton.js.map +1 -0
- package/dist/server/ui/steps.d.ts +14 -0
- package/dist/server/ui/steps.js +13 -0
- package/dist/server/ui/steps.js.map +1 -0
- package/dist/server/ui/tag.d.ts +17 -0
- package/dist/server/ui/tag.js +14 -0
- package/dist/server/ui/tag.js.map +1 -0
- package/dist/sparkline-rows.js +3 -2
- package/dist/stacked-bar-chart.js +3 -2
- package/dist/step-chart.js +3 -2
- package/dist/stream-chart.js +3 -2
- package/dist/treemap-chart.js +3 -2
- package/dist/ui/alert.d.ts +14 -0
- package/dist/ui/alert.js +10 -0
- package/dist/ui/alert.js.map +1 -0
- package/dist/ui/badge.d.ts +12 -0
- package/dist/ui/badge.js +10 -0
- package/dist/ui/badge.js.map +1 -0
- package/dist/ui/button.d.ts +14 -0
- package/dist/ui/button.js +10 -0
- package/dist/ui/button.js.map +1 -0
- package/dist/ui/card.d.ts +14 -0
- package/dist/ui/card.js +10 -0
- package/dist/ui/card.js.map +1 -0
- package/dist/ui/checkbox.d.ts +14 -0
- package/dist/ui/checkbox.js +10 -0
- package/dist/ui/checkbox.js.map +1 -0
- package/dist/ui/divider.d.ts +11 -0
- package/dist/ui/divider.js +10 -0
- package/dist/ui/divider.js.map +1 -0
- package/dist/ui/input.d.ts +19 -0
- package/dist/ui/input.js +10 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/progress.d.ts +11 -0
- package/dist/ui/progress.js +10 -0
- package/dist/ui/progress.js.map +1 -0
- package/dist/ui/radio-group.d.ts +16 -0
- package/dist/ui/radio-group.js +10 -0
- package/dist/ui/radio-group.js.map +1 -0
- package/dist/ui/rate.d.ts +15 -0
- package/dist/ui/rate.js +10 -0
- package/dist/ui/rate.js.map +1 -0
- package/dist/ui/segmented.d.ts +16 -0
- package/dist/ui/segmented.js +10 -0
- package/dist/ui/segmented.js.map +1 -0
- package/dist/ui/skeleton.d.ts +11 -0
- package/dist/ui/skeleton.js +10 -0
- package/dist/ui/skeleton.js.map +1 -0
- package/dist/ui/slider.d.ts +15 -0
- package/dist/ui/slider.js +10 -0
- package/dist/ui/slider.js.map +1 -0
- package/dist/ui/steps.d.ts +11 -0
- package/dist/ui/steps.js +10 -0
- package/dist/ui/steps.js.map +1 -0
- package/dist/ui/switch.d.ts +14 -0
- package/dist/ui/switch.js +10 -0
- package/dist/ui/switch.js.map +1 -0
- package/dist/ui/tabs.d.ts +25 -0
- package/dist/ui/tabs.js +12 -0
- package/dist/ui/tabs.js.map +1 -0
- package/dist/ui/tag.d.ts +14 -0
- package/dist/ui/tag.js +10 -0
- package/dist/ui/tag.js.map +1 -0
- package/dist/ui.d.ts +21 -0
- package/dist/ui.js +76 -0
- package/dist/ui.js.map +1 -0
- package/dist/volvelle-chart.js +3 -2
- package/dist/waterfall-chart.js +3 -2
- package/dist/wind-rose.js +3 -2
- package/package.json +159 -3
- package/dist/chunk-WNX4XCL6.js.map +0 -1
- /package/dist/{chunk-74ONV2GE.js.map → chunk-3BREGZ7C.js.map} +0 -0
- /package/dist/{chunk-J5OOZDFF.js.map → chunk-3U3Z5U6H.js.map} +0 -0
- /package/dist/{chunk-X2ACXB2U.js.map → chunk-6EFRIK7Q.js.map} +0 -0
- /package/dist/{chunk-6KPX5HYV.js.map → chunk-6M4REUJE.js.map} +0 -0
- /package/dist/{chunk-WOKDS6AK.js.map → chunk-6S6VKQ3E.js.map} +0 -0
- /package/dist/{chunk-DTBEXYYC.js.map → chunk-AEU6UHVG.js.map} +0 -0
- /package/dist/{chunk-A42AKCPS.js.map → chunk-C3NHZ4N5.js.map} +0 -0
- /package/dist/{chunk-2NQ4DXLT.js.map → chunk-ESFN6FJY.js.map} +0 -0
- /package/dist/{chunk-NW2SQ6QW.js.map → chunk-FHX2HWN3.js.map} +0 -0
- /package/dist/{chunk-KDQHOND7.js.map → chunk-FZ46YSJA.js.map} +0 -0
- /package/dist/{chunk-GYUTG5R2.js.map → chunk-GSJYA76X.js.map} +0 -0
- /package/dist/{chunk-TKQ2PQDW.js.map → chunk-GUKXFITX.js.map} +0 -0
- /package/dist/{chunk-TAQOBBF7.js.map → chunk-I72JGA6Q.js.map} +0 -0
- /package/dist/{chunk-H4NCK6RE.js.map → chunk-J3E6IUUQ.js.map} +0 -0
- /package/dist/{chunk-4LS7B7CK.js.map → chunk-JPTK2AAT.js.map} +0 -0
- /package/dist/{chunk-WHZ4ALRI.js.map → chunk-JWCVL7VE.js.map} +0 -0
- /package/dist/{chunk-XWSCKTPG.js.map → chunk-KVOBNPDN.js.map} +0 -0
- /package/dist/{chunk-FZMY6NWJ.js.map → chunk-MC7N4KQA.js.map} +0 -0
- /package/dist/{chunk-UXVYCPFL.js.map → chunk-MYKZWY2E.js.map} +0 -0
- /package/dist/{chunk-GBTH55AM.js.map → chunk-NA6K372D.js.map} +0 -0
- /package/dist/{chunk-E5LIZKJT.js.map → chunk-NWK6VBCJ.js.map} +0 -0
- /package/dist/{chunk-WICFKWEZ.js.map → chunk-NWRCFNYB.js.map} +0 -0
- /package/dist/{chunk-CERHTEML.js.map → chunk-OAH7AEGE.js.map} +0 -0
- /package/dist/{chunk-OFDVE64G.js.map → chunk-PRVJKYEQ.js.map} +0 -0
- /package/dist/{chunk-P53KSCPE.js.map → chunk-RAATAHXZ.js.map} +0 -0
- /package/dist/{chunk-FQHAHZBR.js.map → chunk-RIGQTEKW.js.map} +0 -0
- /package/dist/{chunk-NHUVAE4Z.js.map → chunk-RMIIFPXA.js.map} +0 -0
- /package/dist/{chunk-H3UH7F5S.js.map → chunk-TSQWTDBK.js.map} +0 -0
- /package/dist/{chunk-7KED5KUU.js.map → chunk-U3LT444G.js.map} +0 -0
- /package/dist/{chunk-JRAHTS5O.js.map → chunk-UOOHQAJU.js.map} +0 -0
- /package/dist/{chunk-VISNFHPM.js.map → chunk-VKNGQ4NW.js.map} +0 -0
- /package/dist/{chunk-ZKLVP4JE.js.map → chunk-WFO6BICV.js.map} +0 -0
- /package/dist/{chunk-PWFDYIXV.js.map → chunk-X2F56RYM.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/create-chart.tsx","../src/chart-svg.tsx","../src/chart-frame.tsx","../src/overlay.tsx"],"sourcesContent":["import {\n inCell,\n instanceId,\n linkFrom,\n reduceInteraction,\n type ActiveItem,\n type ChartHandle,\n type ChartRecipe,\n type CommonChartProps,\n type InteractionEvent,\n type PointerKind,\n} from '@silverpoint/core';\nimport { renderChart, toSVGString } from '@silverpoint/grounds';\nimport {\n forwardRef,\n useContext,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type ForwardRefExoticComponent,\n type KeyboardEvent,\n type PointerEvent,\n type RefAttributes,\n} from 'react';\nimport { ChartFrame } from './chart-frame';\nimport type { CellChartProps } from './dashboard-markup';\nimport { DashboardLinkContext } from './link-context';\nimport { SilverpointContext } from './context';\nimport { useForcedPrecision, useMeasuredWidth, useTypefaceCheck } from './environment';\nimport { Overlay, type TooltipRenderer } from './overlay';\n\nexport type { ChartHandle };\n\n/** Interaction props of the client components (API Spec §9). */\nexport interface InteractionProps {\n /** The active item changed, or `null` when it cleared (REQ-141, REQ-143). */\n onActiveChange?: (item: ActiveItem | null) => void;\n /** An item was chosen by click, Enter or Space. */\n onSelect?: (item: ActiveItem) => void;\n /** Replaces the built-in readout (REQ-142). */\n tooltip?: TooltipRenderer;\n}\n\nexport type ClientChart<P> = ForwardRefExoticComponent<P & InteractionProps & RefAttributes<ChartHandle>>;\n\n/**\n * The client component of a recipe: it measures, renders through the core pipeline and forwards\n * interaction events to the core's reducer. Every client chart is this function applied to its\n * recipe, so the charts differ only in the recipe (Art. 2).\n */\nexport function createClientChart<P extends CommonChartProps>(recipe: ChartRecipe<P>): ClientChart<P> {\n const Chart = forwardRef<ChartHandle, P & InteractionProps & CellChartProps>(function Chart(allProps, ref) {\n const { onActiveChange, onSelect, tooltip } = allProps;\n const provider = useContext(SilverpointContext);\n const link = useContext(DashboardLinkContext);\n const generated = useId();\n const rootRef = useRef<HTMLDivElement>(null);\n const forcedPrecision = useForcedPrecision();\n useTypefaceCheck(recipe.name);\n const measured = useMeasuredWidth(rootRef, allProps.width === undefined);\n\n const rendered = useMemo(() => {\n // Inside a dashboard cell: its id, height and config, and its nominal width until measured\n // (REQ-206, REQ-207, REQ-209, REQ-212); the chart's own props win.\n const { dashboardCell, ...own } = allProps;\n const fitted = inCell(own as unknown as P, dashboardCell, recipe);\n return renderChart(recipe, fitted.props, {\n id: instanceId(recipe.name, generated),\n width: measured ?? fitted.width,\n provider,\n forcedPrecision,\n });\n // Keyed on the props object React hands in, which is stable across this component's own\n // state changes, so moving the pointer never re-inks the chart.\n }, [allProps, generated, measured, provider, forcedPrecision]);\n\n const [active, setActive] = useState<ActiveItem | null>(null);\n const dispatch = (event: InteractionEvent): boolean => {\n const result = reduceInteraction(rendered.geometry, active, event);\n if (result.changed) {\n setActive(result.active);\n onActiveChange?.(result.active);\n // In a linked dashboard this chart becomes the source, or clears the link (REQ-216, REQ-218).\n link?.set(linkFrom(link.key, rendered.id, result.active));\n }\n if (result.selected) onSelect?.(result.selected);\n return result.handled;\n };\n // WCAG 1.4.13: a readout shown by the pointer is dismissible with Escape wherever focus is.\n const latest = useRef(dispatch);\n latest.current = dispatch;\n const showing = active !== null;\n useEffect(() => {\n if (!showing) return undefined;\n const onKey = (event: globalThis.KeyboardEvent) => {\n if (event.key === 'Escape' && !rootRef.current?.contains(event.target as Node)) latest.current({ type: 'key', key: 'Escape' });\n };\n document.addEventListener('keydown', onKey);\n return () => document.removeEventListener('keydown', onKey);\n }, [showing]);\n const pointer = (type: 'pointer' | 'click') => (event: PointerEvent<HTMLDivElement>) => {\n const svg = rootRef.current?.querySelector('svg.sp-chart');\n if (!svg) return;\n const box = svg.getBoundingClientRect();\n dispatch({\n type,\n client: { x: event.clientX, y: event.clientY },\n box: { left: box.left, top: box.top, width: box.width, height: box.height },\n kind: (event.pointerType || 'mouse') as PointerKind,\n });\n };\n const rootProps = {\n tabIndex: 0,\n role: 'group',\n 'aria-label': rendered.name,\n onPointerMove: pointer('pointer'),\n onPointerDown: pointer('pointer'),\n onClick: pointer('click'),\n onPointerLeave: () => dispatch({ type: 'leave' }),\n onFocus: () => dispatch({ type: 'focus' }),\n onBlur: () => dispatch({ type: 'blur' }),\n onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => {\n if (dispatch({ type: 'key', key: event.key })) event.preventDefault();\n },\n };\n\n useImperativeHandle(\n ref,\n () => ({\n getGeometry: () => rendered.geometry,\n toSVGString: () => toSVGString(rendered),\n }),\n [rendered],\n );\n\n return (\n <ChartFrame\n rendered={rendered}\n className={allProps.className}\n rootRef={rootRef}\n rootProps={rootProps}\n overlay={<Overlay rendered={rendered} active={active} tooltip={tooltip} />}\n />\n );\n });\n Chart.displayName = recipe.name;\n return Chart as ClientChart<P>;\n}\n","import type { PathView, SvgView } from '@silverpoint/core';\n\nfunction Path({ path }: { readonly path: PathView }) {\n return (\n <path\n d={path.d}\n part={path.part}\n data-role={path.role}\n data-paint={path.paint}\n data-dash={path.dash ?? undefined}\n data-weight={path.weight ?? undefined}\n fill={path.fill ?? undefined}\n />\n );\n}\n\n/** Writes the core's SVG view one field to one attribute; computes nothing (Art. 2). */\nexport function ChartSvg({ view }: { readonly view: SvgView }) {\n const { svg } = view;\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox={svg.viewBox}\n width={svg.width}\n height={svg.height}\n className={svg.class}\n data-substrate={svg.substrate}\n data-mode={svg.mode}\n role={svg.role}\n aria-labelledby={svg.labelledby}\n >\n <title id={view.title.id}>{view.title.text}</title>\n <desc id={view.desc.id}>{view.desc.text}</desc>\n {view.patterns.length > 0 && (\n <defs>\n {view.patterns.map((pattern) => (\n <pattern\n key={pattern.id}\n id={pattern.id}\n width={pattern.width}\n height={pattern.height}\n patternUnits=\"userSpaceOnUse\"\n patternTransform={pattern.transform}\n >\n {pattern.paths.map((path, index) => (\n <Path key={index} path={path} />\n ))}\n </pattern>\n ))}\n </defs>\n )}\n {view.paths.map((path, index) => (\n <Path key={index} path={path} />\n ))}\n {view.texts.map((text, index) => (\n <text key={index} x={text.x} y={text.y} part={text.part} data-kind={text.kind} textAnchor={text.anchor}>\n {text.text}\n </text>\n ))}\n </svg>\n );\n}\n","import type { DataTable } from '@silverpoint/core';\nimport type { RenderedChart } from '@silverpoint/grounds';\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { ChartSvg } from './chart-svg';\n\nfunction Table({ table, id, visibility }: { readonly table: DataTable; readonly id: string; readonly visibility: string }) {\n return (\n <div className=\"sp-table-box\" data-visibility={visibility}>\n <table className=\"sp-table\" id={id} data-visibility={visibility}>\n <caption>{table.caption}</caption>\n <thead>\n <tr>\n {table.columns.map((column, index) => (\n <th key={index} scope=\"col\">\n {column}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {table.rows.map((row, index) => (\n <tr key={index}>\n {row.map((cell, column) =>\n column === 0 ? (\n <th key={column} scope=\"row\">\n {cell}\n </th>\n ) : (\n <td key={column}>{cell}</td>\n ),\n )}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport interface ChartFrameProps {\n readonly rendered: RenderedChart;\n readonly className?: string;\n /** Interaction handlers and focus attributes, supplied by the client component only. */\n readonly rootProps?: HTMLAttributes<HTMLDivElement>;\n readonly rootRef?: Ref<HTMLDivElement>;\n /** Readout and marker, drawn over the chart by the client component. */\n readonly overlay?: ReactNode;\n}\n\n/** The chart's DOM: root, SVG, overlay and tabular alternative (API Spec §10). */\nexport function ChartFrame({ rendered, className, rootProps, rootRef, overlay }: ChartFrameProps) {\n const classes = ['sp-root', `sp-ground-${rendered.ground}`, className].filter(Boolean).join(' ');\n return (\n <div\n className={classes}\n data-substrate={rendered.substrate}\n data-chrome={rendered.chrome}\n data-status={rendered.status}\n ref={rootRef}\n {...rootProps}\n >\n <ChartSvg view={rendered.view} />\n {overlay}\n {rendered.dataTable !== 'none' && (\n <Table table={rendered.table} id={rendered.ids.table} visibility={rendered.dataTable} />\n )}\n </div>\n );\n}\n","import { linkedMarks, readout, type ActiveItem, type Readout } from '@silverpoint/core';\nimport type { RenderedChart } from '@silverpoint/grounds';\nimport { useContext, type ReactNode } from 'react';\nimport { DashboardLinkContext } from './link-context';\n\n/** A consumer-supplied readout renderer (REQ-142). */\nexport type TooltipRenderer = (active: ActiveItem, readout: Readout) => ReactNode;\n\n/**\n * Marker, readout and live region of the active item (REQ-141, REQ-122). Every number comes from\n * the core's `readout`; this component only places it.\n */\nexport function Overlay({\n rendered,\n active,\n tooltip,\n}: {\n readonly rendered: RenderedChart;\n readonly active: ActiveItem | null;\n readonly tooltip?: TooltipRenderer;\n}) {\n const current = active ? readout(rendered, active) : null;\n // Another chart's linked item, marked here and hidden from assistive technology (REQ-216, REQ-218).\n const linked = linkedMarks(rendered, useContext(DashboardLinkContext)?.state);\n return (\n <>\n {linked.length > 0 && (\n <svg className=\"sp-marker\" part=\"linked\" viewBox={rendered.view.svg.viewBox} aria-hidden=\"true\" focusable=\"false\">\n {linked.map((d, index) => (\n <path key={index} d={d} />\n ))}\n </svg>\n )}\n {current && active && (\n <>\n <svg className=\"sp-marker\" viewBox={rendered.view.svg.viewBox} aria-hidden=\"true\" focusable=\"false\">\n <path d={current.marker.d} />\n </svg>\n <div className=\"sp-readout\" style={{ left: current.left, top: current.top }} aria-hidden=\"true\">\n {tooltip ? (\n tooltip(active, current)\n ) : (\n <>\n <span className=\"sp-readout-heading\">{current.heading}</span>\n {current.text}\n </>\n )}\n </div>\n </>\n )}\n <div className=\"sp-live\" aria-live=\"polite\">\n {current ? current.announcement : ''}\n </div>\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAOK;AACP,SAAS,aAAa,mBAAmB;AACzC;AAAA,EACE;AAAA,EACA,cAAAA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAKK;;;ACtBH,cAgBA,YAhBA;AAFJ,SAAS,KAAK,EAAE,KAAK,GAAgC;AACnD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,GAAG,KAAK;AAAA,MACR,MAAM,KAAK;AAAA,MACX,aAAW,KAAK;AAAA,MAChB,cAAY,KAAK;AAAA,MACjB,aAAW,KAAK,QAAQ;AAAA,MACxB,eAAa,KAAK,UAAU;AAAA,MAC5B,MAAM,KAAK,QAAQ;AAAA;AAAA,EACrB;AAEJ;AAGO,SAAS,SAAS,EAAE,KAAK,GAA+B;AAC7D,QAAM,EAAE,IAAI,IAAI;AAChB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,OAAM;AAAA,MACN,SAAS,IAAI;AAAA,MACb,OAAO,IAAI;AAAA,MACX,QAAQ,IAAI;AAAA,MACZ,WAAW,IAAI;AAAA,MACf,kBAAgB,IAAI;AAAA,MACpB,aAAW,IAAI;AAAA,MACf,MAAM,IAAI;AAAA,MACV,mBAAiB,IAAI;AAAA,MAErB;AAAA,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AAA,MACV,MAAM;AAAA,MACN,cAAc,SAAS;AAAA,MACvB,eAAe,QAAQ,SAAS;AAAA,MAChC,eAAe,QAAQ,SAAS;AAAA,MAChC,SAAS,QAAQ,OAAO;AAAA,MACxB,gBAAgB,MAAM,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,MAChD,SAAS,MAAM,SAAS,EAAE,MAAM,QAAQ,CAAC;AAAA,MACzC,QAAQ,MAAM,SAAS,EAAE,MAAM,OAAO,CAAC;AAAA,MACvC,WAAW,CAAC,UAAyC;AACnD,YAAI,SAAS,EAAE,MAAM,OAAO,KAAK,MAAM,IAAI,CAAC,EAAG,OAAM,eAAe;AAAA,MACtE;AAAA,IACF;AAEA;AAAA,MACE;AAAA,MACA,OAAO;AAAA,QACL,aAAa,MAAM,SAAS;AAAA,QAC5B,aAAa,MAAM,YAAY,QAAQ;AAAA,MACzC;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AAEA,WACE,gBAAAF;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,SAAS;AAAA,QACpB;AAAA,QACA;AAAA,QACA,SAAS,gBAAAA,KAAC,WAAQ,UAAoB,QAAgB,SAAkB;AAAA;AAAA,IAC1E;AAAA,EAEJ,CAAC;AACD,QAAM,cAAc,OAAO;AAC3B,SAAO;AACT;","names":["useContext","jsx","jsxs","jsx","jsxs","jsx","Chart","useContext"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/waterfall-chart.tsx
|
|
7
7
|
import { waterfallChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var WaterfallChart = createClientChart(waterfallChart);
|
|
|
10
10
|
export {
|
|
11
11
|
WaterfallChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-FHX2HWN3.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/pyramid-chart.tsx
|
|
7
7
|
import { pyramidChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var PyramidChart = createClientChart(pyramidChart);
|
|
|
10
10
|
export {
|
|
11
11
|
PyramidChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-FZ46YSJA.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
renderUi,
|
|
4
|
+
textOf,
|
|
5
|
+
useUi
|
|
6
|
+
} from "./chunk-DO4VUIUU.js";
|
|
7
|
+
|
|
8
|
+
// src/ui/badge.tsx
|
|
9
|
+
import { uiBadgeView } from "@silverpoint/core/ui";
|
|
10
|
+
function SpBadge({ children, dashboardCell, ...props }) {
|
|
11
|
+
return renderUi(uiBadgeView(props, useUi(props, dashboardCell), { text: textOf(children) }), { slots: { content: children } });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
SpBadge
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-G7C4CH54.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/badge.tsx"],"sourcesContent":["import { uiBadgeView, type SpBadgeProps as CoreProps } from '@silverpoint/core/ui';\nimport type { ReactElement, ReactNode } from 'react';\nimport { textOf, useUi, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpBadgeProps extends CoreProps, UiCellProps {\n readonly children?: ReactNode;\n}\n\n/** `SpBadge`: its count is text, in the accessible name (REQ-318). */\nexport function SpBadge({ children, dashboardCell, ...props }: SpBadgeProps) {\n return renderUi(uiBadgeView(props, useUi(props, dashboardCell), { text: textOf(children) }), { slots: { content: children } }) as ReactElement;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,mBAAmD;AAUrD,SAAS,QAAQ,EAAE,UAAU,eAAe,GAAG,MAAM,GAAiB;AAC3E,SAAO,SAAS,YAAY,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,MAAM,OAAO,QAAQ,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;AAC/H;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/heatmap-chart.tsx
|
|
7
7
|
import { heatmapChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var HeatmapChart = createClientChart(heatmapChart);
|
|
|
10
10
|
export {
|
|
11
11
|
HeatmapChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-GSJYA76X.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/scatter-chart.tsx
|
|
7
7
|
import { scatterChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var ScatterChart = createClientChart(scatterChart);
|
|
|
10
10
|
export {
|
|
11
11
|
ScatterChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-GUKXFITX.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/volvelle-chart.tsx
|
|
7
7
|
import { volvelleChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var VolvelleChart = createClientChart(volvelleChart);
|
|
|
10
10
|
export {
|
|
11
11
|
VolvelleChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-I72JGA6Q.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/gauge-arc.tsx
|
|
7
7
|
import { gaugeArc } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var GaugeArc = createClientChart(gaugeArc);
|
|
|
10
10
|
export {
|
|
11
11
|
GaugeArc
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-J3E6IUUQ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/bar-chart.tsx
|
|
7
7
|
import { barChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var BarChart = createClientChart(barChart);
|
|
|
10
10
|
export {
|
|
11
11
|
BarChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-JPTK2AAT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/donut-chart.tsx
|
|
7
7
|
import { donutChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var DonutChart = createClientChart(donutChart);
|
|
|
10
10
|
export {
|
|
11
11
|
DonutChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-JWCVL7VE.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/candlestick-chart.tsx
|
|
7
7
|
import { candlestickChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var CandlestickChart = createClientChart(candlestickChart);
|
|
|
10
10
|
export {
|
|
11
11
|
CandlestickChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-KVOBNPDN.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
renderUi,
|
|
4
|
+
textOf,
|
|
5
|
+
useUi
|
|
6
|
+
} from "./chunk-DO4VUIUU.js";
|
|
7
|
+
|
|
8
|
+
// src/ui/tag.tsx
|
|
9
|
+
import { uiTagView } from "@silverpoint/core/ui";
|
|
10
|
+
function SpTag({ children, onClose, dashboardCell, ...props }) {
|
|
11
|
+
const view = uiTagView(props, useUi(props, dashboardCell), { text: textOf(children) });
|
|
12
|
+
return renderUi(view, { close: { onClick: onClose }, slots: { content: children } });
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
SpTag
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-LSA5XU52.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/tag.tsx"],"sourcesContent":["import { uiTagView, type SpTagProps as CoreProps } from '@silverpoint/core/ui';\nimport type { MouseEvent, ReactElement, ReactNode } from 'react';\nimport { textOf, useUi, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpTagProps extends CoreProps, UiCellProps {\n readonly children?: ReactNode;\n /** From the close button of a closable tag. */\n readonly onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\n/** `SpTag`: framed and toned; closable, a native close button (REQ-308). */\nexport function SpTag({ children, onClose, dashboardCell, ...props }: SpTagProps) {\n const view = uiTagView(props, useUi(props, dashboardCell), { text: textOf(children) });\n return renderUi(view, { close: { onClick: onClose }, slots: { content: children } }) as ReactElement;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,iBAA+C;AAYjD,SAAS,MAAM,EAAE,UAAU,SAAS,eAAe,GAAG,MAAM,GAAe;AAChF,QAAM,OAAO,UAAU,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,MAAM,OAAO,QAAQ,EAAE,CAAC;AACrF,SAAO,SAAS,MAAM,EAAE,OAAO,EAAE,SAAS,QAAQ,GAAG,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;AACrF;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
renderUi,
|
|
4
|
+
useUi
|
|
5
|
+
} from "./chunk-DO4VUIUU.js";
|
|
6
|
+
|
|
7
|
+
// src/ui/alert.tsx
|
|
8
|
+
import { uiAlertView } from "@silverpoint/core/ui";
|
|
9
|
+
function SpAlert({ children, onClose, dashboardCell, ...props }) {
|
|
10
|
+
const view = uiAlertView(props, useUi(props, dashboardCell), { closable: props.closable === true });
|
|
11
|
+
return renderUi(view, { close: { onClick: onClose }, slots: { content: children } });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export {
|
|
15
|
+
SpAlert
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=chunk-M56MDRNT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/alert.tsx"],"sourcesContent":["import { uiAlertView, type SpAlertProps as CoreProps } from '@silverpoint/core/ui';\nimport type { MouseEvent, ReactElement, ReactNode } from 'react';\nimport { useUi, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpAlertProps extends CoreProps, UiCellProps {\n readonly children?: ReactNode;\n /** From the close button of a closable alert. */\n readonly onClose?: (event: MouseEvent<HTMLButtonElement>) => void;\n}\n\n/** `SpAlert`: `alert` or `status` by kind (REQ-318); closable, a native close button. */\nexport function SpAlert({ children, onClose, dashboardCell, ...props }: SpAlertProps) {\n const view = uiAlertView(props, useUi(props, dashboardCell), { closable: props.closable === true });\n return renderUi(view, { close: { onClick: onClose }, slots: { content: children } }) as ReactElement;\n}\n"],"mappings":";;;;;;;AAAA,SAAS,mBAAmD;AAYrD,SAAS,QAAQ,EAAE,UAAU,SAAS,eAAe,GAAG,MAAM,GAAiB;AACpF,QAAM,OAAO,YAAY,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,UAAU,MAAM,aAAa,KAAK,CAAC;AAClG,SAAO,SAAS,MAAM,EAAE,OAAO,EAAE,SAAS,QAAQ,GAAG,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;AACrF;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/treemap-chart.tsx
|
|
7
7
|
import { treemapChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var TreemapChart = createClientChart(treemapChart);
|
|
|
10
10
|
export {
|
|
11
11
|
TreemapChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-MC7N4KQA.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/wind-rose.tsx
|
|
7
7
|
import { windRose } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var WindRose = createClientChart(windRose);
|
|
|
10
10
|
export {
|
|
11
11
|
WindRose
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-MYKZWY2E.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/polar-bar-chart.tsx
|
|
7
7
|
import { polarBarChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var PolarBarChart = createClientChart(polarBarChart);
|
|
|
10
10
|
export {
|
|
11
11
|
PolarBarChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-NA6K372D.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/sparkline-rows.tsx
|
|
7
7
|
import { sparklineRows } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var SparklineRows = createClientChart(sparklineRows);
|
|
|
10
10
|
export {
|
|
11
11
|
SparklineRows
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-NWK6VBCJ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/range-band-chart.tsx
|
|
7
7
|
import { rangeBandChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var RangeBandChart = createClientChart(rangeBandChart);
|
|
|
10
10
|
export {
|
|
11
11
|
RangeBandChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-NWRCFNYB.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/radial-arc-group.tsx
|
|
7
7
|
import { radialArcGroup } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var RadialArcGroup = createClientChart(radialArcGroup);
|
|
|
10
10
|
export {
|
|
11
11
|
RadialArcGroup
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-OAH7AEGE.js.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
renderUi,
|
|
4
|
+
useUi,
|
|
5
|
+
useValue
|
|
6
|
+
} from "./chunk-DO4VUIUU.js";
|
|
7
|
+
|
|
8
|
+
// src/ui/tabs.tsx
|
|
9
|
+
import { uiItems, uiRovingFocus, uiSelectedKey, uiTabPanelView, uiTabsView } from "@silverpoint/core/ui";
|
|
10
|
+
import { createContext, useContext } from "react";
|
|
11
|
+
import { jsx } from "react/jsx-runtime";
|
|
12
|
+
var TabsContext = createContext({ value: null });
|
|
13
|
+
function SpTabs({ value, defaultValue, onChange, children, dashboardCell, ...props }) {
|
|
14
|
+
const [current, set] = useValue(value, defaultValue, onChange);
|
|
15
|
+
const view = uiTabsView(props, useUi(props, dashboardCell), { value: current ?? null });
|
|
16
|
+
const selected = uiSelectedKey(uiItems(props.items, "SpTabs"), current, "first");
|
|
17
|
+
const native = { onClick: (event) => set(String(event.currentTarget.dataset.key)) };
|
|
18
|
+
const orientation = props.orientation ?? "horizontal";
|
|
19
|
+
const onKeyDown = (event) => uiRovingFocus(event, event.currentTarget, '[role="tab"]', orientation, props.activation !== "manual");
|
|
20
|
+
const content = /* @__PURE__ */ jsx(TabsContext.Provider, { value: { id: props.id, value: selected }, children });
|
|
21
|
+
return renderUi(view, { root: { onKeyDown }, native, slots: { content } });
|
|
22
|
+
}
|
|
23
|
+
function SpTabPanel({ value, children }) {
|
|
24
|
+
return renderUi(uiTabPanelView({ value }, useContext(TabsContext)), { slots: { content: children } });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
SpTabs,
|
|
29
|
+
SpTabPanel
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=chunk-OP2WE7MA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/tabs.tsx"],"sourcesContent":["import { uiItems, uiRovingFocus, uiSelectedKey, uiTabPanelView, uiTabsView, type SpTabsProps as CoreProps } from '@silverpoint/core/ui';\nimport { createContext, useContext, type KeyboardEvent, type MouseEvent, type ReactElement, type ReactNode } from 'react';\nimport { useUi, useValue, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpTabsProps extends CoreProps, UiCellProps {\n /** Controlled key; an unknown one shows the first enabled tab. */\n readonly value?: string;\n readonly defaultValue?: string;\n /** The key selected, not the DOM event (REQ-322). */\n readonly onChange?: (value: string) => void;\n /** `SpTabPanel` elements. */\n readonly children?: ReactNode;\n}\n\n/** What a panel reads from its tabs: their id, for the ids that relate them, and the selected key. */\nconst TabsContext = createContext<{ readonly id?: string; readonly value: string | null }>({ value: null });\n\n/** `SpTabs`: a tablist of native buttons, one tab stop; arrows through the core, `activation` as APG (REQ-315). */\nexport function SpTabs({ value, defaultValue, onChange, children, dashboardCell, ...props }: SpTabsProps) {\n const [current, set] = useValue<string | undefined>(value, defaultValue, onChange as (next: string | undefined) => void);\n const view = uiTabsView(props, useUi(props, dashboardCell), { value: current ?? null });\n const selected = uiSelectedKey(uiItems(props.items, 'SpTabs'), current, 'first');\n const native = { onClick: (event: MouseEvent<HTMLButtonElement>) => set(String(event.currentTarget.dataset.key)) };\n const orientation = props.orientation ?? 'horizontal';\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) =>\n uiRovingFocus(event, event.currentTarget, '[role=\"tab\"]', orientation, props.activation !== 'manual');\n const content = <TabsContext.Provider value={{ id: props.id, value: selected }}>{children}</TabsContext.Provider>;\n return renderUi(view, { root: { onKeyDown }, native, slots: { content } }) as ReactElement;\n}\n\nexport interface SpTabPanelProps {\n /** The key of the tab that shows this panel. */\n readonly value: string;\n readonly children?: ReactNode;\n}\n\n/** `SpTabPanel`: a `tabpanel` labelled by its tab, hidden unless its tab is selected. */\nexport function SpTabPanel({ value, children }: SpTabPanelProps) {\n return renderUi(uiTabPanelView({ value }, useContext(TabsContext)), { slots: { content: children } }) as ReactElement;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,SAAS,eAAe,eAAe,gBAAgB,kBAAiD;AACjH,SAAS,eAAe,kBAA0F;AA0BhG;AAXlB,IAAM,cAAc,cAAuE,EAAE,OAAO,KAAK,CAAC;AAGnG,SAAS,OAAO,EAAE,OAAO,cAAc,UAAU,UAAU,eAAe,GAAG,MAAM,GAAgB;AACxG,QAAM,CAAC,SAAS,GAAG,IAAI,SAA6B,OAAO,cAAc,QAA8C;AACvH,QAAM,OAAO,WAAW,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,OAAO,WAAW,KAAK,CAAC;AACtF,QAAM,WAAW,cAAc,QAAQ,MAAM,OAAO,QAAQ,GAAG,SAAS,OAAO;AAC/E,QAAM,SAAS,EAAE,SAAS,CAAC,UAAyC,IAAI,OAAO,MAAM,cAAc,QAAQ,GAAG,CAAC,EAAE;AACjH,QAAM,cAAc,MAAM,eAAe;AACzC,QAAM,YAAY,CAAC,UACjB,cAAc,OAAO,MAAM,eAAe,gBAAgB,aAAa,MAAM,eAAe,QAAQ;AACtG,QAAM,UAAU,oBAAC,YAAY,UAAZ,EAAqB,OAAO,EAAE,IAAI,MAAM,IAAI,OAAO,SAAS,GAAI,UAAS;AAC1F,SAAO,SAAS,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,QAAQ,OAAO,EAAE,QAAQ,EAAE,CAAC;AAC3E;AASO,SAAS,WAAW,EAAE,OAAO,SAAS,GAAoB;AAC/D,SAAO,SAAS,eAAe,EAAE,MAAM,GAAG,WAAW,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;AACtG;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/radar-chart.tsx
|
|
7
7
|
import { radarChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var RadarChart = createClientChart(radarChart);
|
|
|
10
10
|
export {
|
|
11
11
|
RadarChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-PRVJKYEQ.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
renderUi,
|
|
4
|
+
useUi,
|
|
5
|
+
useValue
|
|
6
|
+
} from "./chunk-DO4VUIUU.js";
|
|
7
|
+
|
|
8
|
+
// src/ui/input.tsx
|
|
9
|
+
import { uiInputView } from "@silverpoint/core/ui";
|
|
10
|
+
import { forwardRef } from "react";
|
|
11
|
+
var SpInput = forwardRef(function SpInput2({ value, defaultValue, onChange, prefix, suffix, dashboardCell, ...props }, ref) {
|
|
12
|
+
const [current, set] = useValue(value, defaultValue ?? "", onChange);
|
|
13
|
+
const view = uiInputView(props, useUi(props, dashboardCell), { value: current, prefix: prefix != null, suffix: suffix != null });
|
|
14
|
+
const native = { ref, value: current, onChange: (event) => set(event.target.value) };
|
|
15
|
+
return renderUi(view, { native, slots: { prefix, suffix } });
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
SpInput
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-QRYI7BEO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/input.tsx"],"sourcesContent":["import { uiInputView, type SpInputProps as CoreProps } from '@silverpoint/core/ui';\nimport { forwardRef, type ChangeEvent, type ReactNode, type ReactElement } from 'react';\nimport { useUi, useValue, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpInputProps extends CoreProps, UiCellProps {\n /** Controlled value. */\n readonly value?: string;\n readonly defaultValue?: string;\n /** The new value, not the DOM event (REQ-322). */\n readonly onChange?: (value: string) => void;\n readonly prefix?: ReactNode;\n readonly suffix?: ReactNode;\n}\n\n/** `SpInput`: a native `<input>` in a framed box; its ref is the input (REQ-314, REQ-334). */\nexport const SpInput = forwardRef<HTMLInputElement, SpInputProps>(function SpInput(\n { value, defaultValue, onChange, prefix, suffix, dashboardCell, ...props },\n ref,\n) {\n const [current, set] = useValue(value, defaultValue ?? '', onChange);\n const view = uiInputView(props, useUi(props, dashboardCell), { value: current, prefix: prefix != null, suffix: suffix != null });\n const native = { ref, value: current, onChange: (event: ChangeEvent<HTMLInputElement>) => set(event.target.value) };\n return renderUi(view, { native, slots: { prefix, suffix } }) as ReactElement;\n});\n"],"mappings":";;;;;;;;AAAA,SAAS,mBAAmD;AAC5D,SAAS,kBAAuE;AAezE,IAAM,UAAU,WAA2C,SAASA,SACzE,EAAE,OAAO,cAAc,UAAU,QAAQ,QAAQ,eAAe,GAAG,MAAM,GACzE,KACA;AACA,QAAM,CAAC,SAAS,GAAG,IAAI,SAAS,OAAO,gBAAgB,IAAI,QAAQ;AACnE,QAAM,OAAO,YAAY,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,OAAO,SAAS,QAAQ,UAAU,MAAM,QAAQ,UAAU,KAAK,CAAC;AAC/H,QAAM,SAAS,EAAE,KAAK,OAAO,SAAS,UAAU,CAAC,UAAyC,IAAI,MAAM,OAAO,KAAK,EAAE;AAClH,SAAO,SAAS,MAAM,EAAE,QAAQ,OAAO,EAAE,QAAQ,OAAO,EAAE,CAAC;AAC7D,CAAC;","names":["SpInput"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/sankey-chart.tsx
|
|
7
7
|
import { sankeyChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var SankeyChart = createClientChart(sankeyChart);
|
|
|
10
10
|
export {
|
|
11
11
|
SankeyChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-RAATAHXZ.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/funnel-chart.tsx
|
|
7
7
|
import { funnelChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var FunnelChart = createClientChart(funnelChart);
|
|
|
10
10
|
export {
|
|
11
11
|
FunnelChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-RIGQTEKW.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/coxcomb-chart.tsx
|
|
7
7
|
import { coxcombChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var CoxcombChart = createClientChart(coxcombChart);
|
|
|
10
10
|
export {
|
|
11
11
|
CoxcombChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-RMIIFPXA.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
// src/context.ts
|
|
4
|
+
import { createContext } from "react";
|
|
5
|
+
var SilverpointContext = createContext({});
|
|
6
|
+
|
|
7
|
+
// src/environment.ts
|
|
8
|
+
import { checkTypeface, FORCED_PRECISION_QUERY } from "@silverpoint/core";
|
|
9
|
+
import { useEffect, useState } from "react";
|
|
10
|
+
function useForcedPrecision() {
|
|
11
|
+
const [forced, setForced] = useState(false);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
if (typeof matchMedia !== "function") return;
|
|
14
|
+
const query = matchMedia(FORCED_PRECISION_QUERY);
|
|
15
|
+
const update = () => setForced(query.matches);
|
|
16
|
+
update();
|
|
17
|
+
query.addEventListener?.("change", update);
|
|
18
|
+
return () => query.removeEventListener?.("change", update);
|
|
19
|
+
}, []);
|
|
20
|
+
return forced;
|
|
21
|
+
}
|
|
22
|
+
function useMeasuredWidth(ref, enabled) {
|
|
23
|
+
const [width, setWidth] = useState(void 0);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const element = ref.current;
|
|
26
|
+
if (!enabled || !element || typeof ResizeObserver !== "function") return;
|
|
27
|
+
const observer = new ResizeObserver((entries) => {
|
|
28
|
+
const entry = entries[0];
|
|
29
|
+
if (entry) setWidth(entry.contentRect.width);
|
|
30
|
+
});
|
|
31
|
+
observer.observe(element);
|
|
32
|
+
return () => observer.disconnect();
|
|
33
|
+
}, [ref, enabled]);
|
|
34
|
+
return width;
|
|
35
|
+
}
|
|
36
|
+
function useTypefaceCheck(chart) {
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (typeof document !== "undefined" && document.fonts) void checkTypeface(document.fonts, chart);
|
|
39
|
+
}, [chart]);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
SilverpointContext,
|
|
44
|
+
useForcedPrecision,
|
|
45
|
+
useMeasuredWidth,
|
|
46
|
+
useTypefaceCheck
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=chunk-SQ6GWXDK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/context.ts","../src/environment.ts"],"sourcesContent":["import type { ProviderConfig } from '@silverpoint/core';\nimport { createContext } from 'react';\n\n/** Application-wide configuration (API Spec §8.1); a chart prop always wins over it. */\nexport const SilverpointContext = createContext<ProviderConfig>({});\n","import { checkTypeface, FORCED_PRECISION_QUERY } from '@silverpoint/core';\nimport { useEffect, useState, type RefObject } from 'react';\n\n/**\n * Whether the environment forces `precision` (REQ-123). Read after hydration, so the server\n * render and the first client render agree (REQ-103).\n */\nexport function useForcedPrecision(): boolean {\n const [forced, setForced] = useState(false);\n useEffect(() => {\n if (typeof matchMedia !== 'function') return;\n const query = matchMedia(FORCED_PRECISION_QUERY);\n const update = () => setForced(query.matches);\n update();\n query.addEventListener?.('change', update);\n return () => query.removeEventListener?.('change', update);\n }, []);\n return forced;\n}\n\n/** Width of the container, measured with ResizeObserver; `undefined` until measured (REQ-009). */\nexport function useMeasuredWidth(ref: RefObject<HTMLElement | null>, enabled: boolean): number | undefined {\n const [width, setWidth] = useState<number | undefined>(undefined);\n useEffect(() => {\n const element = ref.current;\n if (!enabled || !element || typeof ResizeObserver !== 'function') return;\n const observer = new ResizeObserver((entries) => {\n const entry = entries[0];\n if (entry) setWidth(entry.contentRect.width);\n });\n observer.observe(element);\n return () => observer.disconnect();\n }, [ref, enabled]);\n return width;\n}\n\n/** Reports SP013 when the display typeface fails to load; never blocks the render (REQ-032). */\nexport function useTypefaceCheck(chart: string): void {\n useEffect(() => {\n if (typeof document !== 'undefined' && document.fonts) void checkTypeface(document.fonts, chart);\n }, [chart]);\n}\n"],"mappings":";;;AACA,SAAS,qBAAqB;AAGvB,IAAM,qBAAqB,cAA8B,CAAC,CAAC;;;ACJlE,SAAS,eAAe,8BAA8B;AACtD,SAAS,WAAW,gBAAgC;AAM7C,SAAS,qBAA8B;AAC5C,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAS,KAAK;AAC1C,YAAU,MAAM;AACd,QAAI,OAAO,eAAe,WAAY;AACtC,UAAM,QAAQ,WAAW,sBAAsB;AAC/C,UAAM,SAAS,MAAM,UAAU,MAAM,OAAO;AAC5C,WAAO;AACP,UAAM,mBAAmB,UAAU,MAAM;AACzC,WAAO,MAAM,MAAM,sBAAsB,UAAU,MAAM;AAAA,EAC3D,GAAG,CAAC,CAAC;AACL,SAAO;AACT;AAGO,SAAS,iBAAiB,KAAoC,SAAsC;AACzG,QAAM,CAAC,OAAO,QAAQ,IAAI,SAA6B,MAAS;AAChE,YAAU,MAAM;AACd,UAAM,UAAU,IAAI;AACpB,QAAI,CAAC,WAAW,CAAC,WAAW,OAAO,mBAAmB,WAAY;AAClE,UAAM,WAAW,IAAI,eAAe,CAAC,YAAY;AAC/C,YAAM,QAAQ,QAAQ,CAAC;AACvB,UAAI,MAAO,UAAS,MAAM,YAAY,KAAK;AAAA,IAC7C,CAAC;AACD,aAAS,QAAQ,OAAO;AACxB,WAAO,MAAM,SAAS,WAAW;AAAA,EACnC,GAAG,CAAC,KAAK,OAAO,CAAC;AACjB,SAAO;AACT;AAGO,SAAS,iBAAiB,OAAqB;AACpD,YAAU,MAAM;AACd,QAAI,OAAO,aAAa,eAAe,SAAS,MAAO,MAAK,cAAc,SAAS,OAAO,KAAK;AAAA,EACjG,GAAG,CAAC,KAAK,CAAC;AACZ;","names":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import {
|
|
3
|
+
renderUi,
|
|
4
|
+
useUi,
|
|
5
|
+
useValue
|
|
6
|
+
} from "./chunk-DO4VUIUU.js";
|
|
7
|
+
|
|
8
|
+
// src/ui/segmented.tsx
|
|
9
|
+
import { uiRovingFocus, uiSegmentedView } from "@silverpoint/core/ui";
|
|
10
|
+
function SpSegmented({ value, defaultValue, onChange, dashboardCell, ...props }) {
|
|
11
|
+
const [current, set] = useValue(value, defaultValue, onChange);
|
|
12
|
+
const view = uiSegmentedView(props, useUi(props, dashboardCell), { value: current ?? null });
|
|
13
|
+
const native = (node) => ({ checked: node.attrs.checked === true, onChange: (event) => set(event.target.value) });
|
|
14
|
+
const onKeyDown = (event) => uiRovingFocus(event, event.currentTarget, "input.sp-ui-native", "both", true);
|
|
15
|
+
return renderUi(view, { root: { onKeyDown }, native });
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export {
|
|
19
|
+
SpSegmented
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=chunk-TH6Q4E7C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/segmented.tsx"],"sourcesContent":["import { uiRovingFocus, uiSegmentedView, type SpSegmentedProps as CoreProps, type UiElement } from '@silverpoint/core/ui';\nimport type { ChangeEvent, KeyboardEvent, ReactElement } from 'react';\nimport { useUi, useValue, type UiCellProps } from './base';\nimport { renderUi } from './render';\n\nexport interface SpSegmentedProps extends CoreProps, UiCellProps {\n /** Controlled key; an unknown one shows the first enabled segment. */\n readonly value?: string;\n readonly defaultValue?: string;\n /** The key selected, not the DOM event (REQ-322). */\n readonly onChange?: (value: string) => void;\n}\n\n/** `SpSegmented`: native radios in one frame; arrows move and select through the core (REQ-315). */\nexport function SpSegmented({ value, defaultValue, onChange, dashboardCell, ...props }: SpSegmentedProps) {\n const [current, set] = useValue<string | undefined>(value, defaultValue, onChange as (next: string | undefined) => void);\n const view = uiSegmentedView(props, useUi(props, dashboardCell), { value: current ?? null });\n const native = (node: UiElement) => ({ checked: node.attrs.checked === true, onChange: (event: ChangeEvent<HTMLInputElement>) => set(event.target.value) });\n const onKeyDown = (event: KeyboardEvent<HTMLElement>) => uiRovingFocus(event, event.currentTarget, 'input.sp-ui-native', 'both', true);\n return renderUi(view, { root: { onKeyDown }, native }) as ReactElement;\n}\n"],"mappings":";;;;;;;;AAAA,SAAS,eAAe,uBAA2E;AAc5F,SAAS,YAAY,EAAE,OAAO,cAAc,UAAU,eAAe,GAAG,MAAM,GAAqB;AACxG,QAAM,CAAC,SAAS,GAAG,IAAI,SAA6B,OAAO,cAAc,QAA8C;AACvH,QAAM,OAAO,gBAAgB,OAAO,MAAM,OAAO,aAAa,GAAG,EAAE,OAAO,WAAW,KAAK,CAAC;AAC3F,QAAM,SAAS,CAAC,UAAqB,EAAE,SAAS,KAAK,MAAM,YAAY,MAAM,UAAU,CAAC,UAAyC,IAAI,MAAM,OAAO,KAAK,EAAE;AACzJ,QAAM,YAAY,CAAC,UAAsC,cAAc,OAAO,MAAM,eAAe,sBAAsB,QAAQ,IAAI;AACrI,SAAO,SAAS,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC;AACvD;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/orbit-chart.tsx
|
|
7
7
|
import { orbitChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var OrbitChart = createClientChart(orbitChart);
|
|
|
10
10
|
export {
|
|
11
11
|
OrbitChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-TSQWTDBK.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/area-chart.tsx
|
|
7
7
|
import { areaChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var AreaChart = createClientChart(areaChart);
|
|
|
10
10
|
export {
|
|
11
11
|
AreaChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-U3LT444G.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/stream-chart.tsx
|
|
7
7
|
import { streamChart } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var StreamChart = createClientChart(streamChart);
|
|
|
10
10
|
export {
|
|
11
11
|
StreamChart
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-UOOHQAJU.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
3
|
createClientChart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FBJLA3P7.js";
|
|
5
5
|
|
|
6
6
|
// src/kpi-card.tsx
|
|
7
7
|
import { kpiCard } from "@silverpoint/core";
|
|
@@ -10,4 +10,4 @@ var KpiCard = createClientChart(kpiCard);
|
|
|
10
10
|
export {
|
|
11
11
|
KpiCard
|
|
12
12
|
};
|
|
13
|
-
//# sourceMappingURL=chunk-
|
|
13
|
+
//# sourceMappingURL=chunk-VKNGQ4NW.js.map
|