@multiplatform.one/components 7.7.6 → 7.8.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/cjs/Button.native.js.map +1 -1
- package/dist/cjs/Card.cjs +7 -1
- package/dist/cjs/Card.native.js +11 -1
- package/dist/cjs/Card.native.js.map +1 -1
- package/dist/cjs/CardFooter.cjs +1 -0
- package/dist/cjs/CardFooter.native.js +1 -0
- package/dist/cjs/CardFooter.native.js.map +1 -1
- package/dist/cjs/CopyField/index.cjs +6 -1
- package/dist/cjs/CopyField/index.native.js +6 -1
- package/dist/cjs/CopyField/index.native.js.map +1 -1
- package/dist/cjs/DropdownMenu/index.cjs +31 -1
- package/dist/cjs/DropdownMenu/index.native.js +31 -1
- package/dist/cjs/DropdownMenu/index.native.js.map +1 -1
- package/dist/cjs/Meter/index.cjs +12 -5
- package/dist/cjs/Meter/index.native.js +12 -5
- package/dist/cjs/Meter/index.native.js.map +1 -1
- package/dist/cjs/Tabs/index.cjs +7 -6
- package/dist/cjs/Tabs/index.native.js +8 -7
- package/dist/cjs/Tabs/index.native.js.map +1 -1
- package/dist/cjs/Toast/index.cjs +53 -2
- package/dist/cjs/Toast/index.native.js +55 -2
- package/dist/cjs/Toast/index.native.js.map +1 -1
- package/dist/cjs/actions/DestructiveAction.cjs +7 -13
- package/dist/cjs/actions/DestructiveAction.native.js +7 -15
- package/dist/cjs/actions/DestructiveAction.native.js.map +1 -1
- package/dist/cjs/charts/Axis.cjs +5 -0
- package/dist/cjs/charts/Axis.native.js +5 -0
- package/dist/cjs/charts/Axis.native.js.map +1 -1
- package/dist/cjs/charts/BarChart.cjs +71 -57
- package/dist/cjs/charts/BarChart.native.js +81 -67
- package/dist/cjs/charts/BarChart.native.js.map +1 -1
- package/dist/cjs/charts/ChartDataView.cjs +212 -0
- package/dist/cjs/charts/ChartDataView.native.js +224 -0
- package/dist/cjs/charts/ChartDataView.native.js.map +1 -0
- package/dist/cjs/charts/ChartSurface.cjs +5 -1
- package/dist/cjs/charts/ChartSurface.native.js +5 -1
- package/dist/cjs/charts/ChartSurface.native.js.map +1 -1
- package/dist/cjs/charts/LineChart.cjs +81 -67
- package/dist/cjs/charts/LineChart.native.js +94 -80
- package/dist/cjs/charts/LineChart.native.js.map +1 -1
- package/dist/cjs/charts/PieChart.cjs +98 -73
- package/dist/cjs/charts/PieChart.native.js +109 -84
- package/dist/cjs/charts/PieChart.native.js.map +1 -1
- package/dist/cjs/charts/Sparkline.cjs +10 -1
- package/dist/cjs/charts/Sparkline.native.js +10 -1
- package/dist/cjs/charts/Sparkline.native.js.map +1 -1
- package/dist/cjs/charts/accessibility.cjs +4 -0
- package/dist/cjs/charts/accessibility.native.js +7 -0
- package/dist/cjs/charts/accessibility.native.js.map +1 -1
- package/dist/cjs/charts/index.cjs +3 -1
- package/dist/cjs/charts/index.native.js +2 -0
- package/dist/cjs/charts/index.native.js.map +1 -1
- package/dist/cjs/charts/math.cjs +16 -0
- package/dist/cjs/charts/math.native.js +18 -0
- package/dist/cjs/charts/math.native.js.map +1 -1
- package/dist/cjs/charts/series.cjs +49 -7
- package/dist/cjs/charts/series.native.js +53 -11
- package/dist/cjs/charts/series.native.js.map +1 -1
- package/dist/cjs/charts/svg.cjs +46 -3
- package/dist/cjs/charts/svg.native.js +46 -3
- package/dist/cjs/charts/svg.native.js.map +1 -1
- package/dist/cjs/code/CodeBlock/index.cjs +6 -1
- package/dist/cjs/code/CodeBlock/index.native.js +6 -1
- package/dist/cjs/code/CodeBlock/index.native.js.map +1 -1
- package/dist/cjs/feedback/ConfirmDialog.cjs +7 -21
- package/dist/cjs/feedback/ConfirmDialog.native.js +7 -22
- package/dist/cjs/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/cjs/feedback/NotifyHost.cjs +2 -1
- package/dist/cjs/feedback/NotifyHost.native.js +3 -2
- package/dist/cjs/feedback/NotifyHost.native.js.map +1 -1
- package/dist/cjs/feedback/copy.cjs +36 -4
- package/dist/cjs/feedback/copy.native.js +38 -4
- package/dist/cjs/feedback/copy.native.js.map +1 -1
- package/dist/cjs/feedback/index.cjs +1 -0
- package/dist/cjs/feedback/index.native.js +1 -0
- package/dist/cjs/feedback/index.native.js.map +1 -1
- package/dist/cjs/feedback/notify.cjs +1 -0
- package/dist/cjs/feedback/notify.native.js +1 -0
- package/dist/cjs/feedback/notify.native.js.map +1 -1
- package/dist/cjs/feedback/route.cjs +3 -0
- package/dist/cjs/feedback/route.native.js +3 -0
- package/dist/cjs/feedback/route.native.js.map +1 -1
- package/dist/cjs/feedback/store.cjs +6 -0
- package/dist/cjs/feedback/store.native.js +8 -0
- package/dist/cjs/feedback/store.native.js.map +1 -1
- package/dist/cjs/icons/lucide.cjs +2 -1
- package/dist/cjs/icons/lucide.native.js +2 -1
- package/dist/cjs/icons/lucide.native.js.map +1 -1
- package/dist/cjs/layouts/PaneScaffold.cjs +96 -41
- package/dist/cjs/layouts/PaneScaffold.native.js +97 -41
- package/dist/cjs/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/cjs/layouts/index.cjs +2 -0
- package/dist/cjs/layouts/index.native.js +2 -0
- package/dist/cjs/layouts/index.native.js.map +1 -1
- package/dist/cjs/layouts/page.cjs +48 -7
- package/dist/cjs/layouts/page.native.js +50 -7
- package/dist/cjs/layouts/page.native.js.map +1 -1
- package/dist/cjs/shared/useKeyboardInset.cjs +1 -19
- package/dist/cjs/shared/useKeyboardInset.native.js +3 -3
- package/dist/cjs/shared/useKeyboardInset.native.js.map +1 -1
- package/dist/cjs/views/Dashboard.cjs +110 -17
- package/dist/cjs/views/Dashboard.native.js +151 -45
- package/dist/cjs/views/Dashboard.native.js.map +1 -1
- package/dist/cjs/views/Gantt.cjs +374 -91
- package/dist/cjs/views/Gantt.native.js +443 -94
- package/dist/cjs/views/Gantt.native.js.map +1 -1
- package/dist/cjs/views/ganttMath.cjs +91 -2
- package/dist/cjs/views/ganttMath.native.js +113 -3
- package/dist/cjs/views/ganttMath.native.js.map +1 -1
- package/dist/cjs/views/index.cjs +20 -1
- package/dist/cjs/views/index.native.js +20 -1
- package/dist/cjs/views/index.native.js.map +1 -1
- package/dist/esm/Button.mjs.map +1 -1
- package/dist/esm/Button.native.js.map +1 -1
- package/dist/esm/Card.mjs +8 -2
- package/dist/esm/Card.mjs.map +1 -1
- package/dist/esm/Card.native.js +12 -2
- package/dist/esm/Card.native.js.map +1 -1
- package/dist/esm/CardFooter.mjs +1 -0
- package/dist/esm/CardFooter.mjs.map +1 -1
- package/dist/esm/CardFooter.native.js +1 -0
- package/dist/esm/CardFooter.native.js.map +1 -1
- package/dist/esm/CopyField/index.mjs +7 -2
- package/dist/esm/CopyField/index.mjs.map +1 -1
- package/dist/esm/CopyField/index.native.js +7 -2
- package/dist/esm/CopyField/index.native.js.map +1 -1
- package/dist/esm/DropdownMenu/index.mjs +32 -2
- package/dist/esm/DropdownMenu/index.mjs.map +1 -1
- package/dist/esm/DropdownMenu/index.native.js +32 -2
- package/dist/esm/DropdownMenu/index.native.js.map +1 -1
- package/dist/esm/Meter/index.mjs +12 -5
- package/dist/esm/Meter/index.mjs.map +1 -1
- package/dist/esm/Meter/index.native.js +12 -5
- package/dist/esm/Meter/index.native.js.map +1 -1
- package/dist/esm/Tabs/index.mjs +7 -6
- package/dist/esm/Tabs/index.mjs.map +1 -1
- package/dist/esm/Tabs/index.native.js +8 -7
- package/dist/esm/Tabs/index.native.js.map +1 -1
- package/dist/esm/Toast/index.mjs +52 -3
- package/dist/esm/Toast/index.mjs.map +1 -1
- package/dist/esm/Toast/index.native.js +54 -3
- package/dist/esm/Toast/index.native.js.map +1 -1
- package/dist/esm/actions/DestructiveAction.mjs +8 -14
- package/dist/esm/actions/DestructiveAction.mjs.map +1 -1
- package/dist/esm/actions/DestructiveAction.native.js +8 -16
- package/dist/esm/actions/DestructiveAction.native.js.map +1 -1
- package/dist/esm/charts/Axis.mjs +6 -1
- package/dist/esm/charts/Axis.mjs.map +1 -1
- package/dist/esm/charts/Axis.native.js +6 -1
- package/dist/esm/charts/Axis.native.js.map +1 -1
- package/dist/esm/charts/BarChart.mjs +72 -58
- package/dist/esm/charts/BarChart.mjs.map +1 -1
- package/dist/esm/charts/BarChart.native.js +82 -68
- package/dist/esm/charts/BarChart.native.js.map +1 -1
- package/dist/esm/charts/ChartDataView.mjs +185 -0
- package/dist/esm/charts/ChartDataView.mjs.map +1 -0
- package/dist/esm/charts/ChartDataView.native.js +194 -0
- package/dist/esm/charts/ChartDataView.native.js.map +1 -0
- package/dist/esm/charts/ChartSurface.mjs +5 -1
- package/dist/esm/charts/ChartSurface.mjs.map +1 -1
- package/dist/esm/charts/ChartSurface.native.js +5 -1
- package/dist/esm/charts/ChartSurface.native.js.map +1 -1
- package/dist/esm/charts/LineChart.mjs +82 -68
- package/dist/esm/charts/LineChart.mjs.map +1 -1
- package/dist/esm/charts/LineChart.native.js +95 -81
- package/dist/esm/charts/LineChart.native.js.map +1 -1
- package/dist/esm/charts/PieChart.mjs +100 -75
- package/dist/esm/charts/PieChart.mjs.map +1 -1
- package/dist/esm/charts/PieChart.native.js +111 -86
- package/dist/esm/charts/PieChart.native.js.map +1 -1
- package/dist/esm/charts/Sparkline.mjs +11 -2
- package/dist/esm/charts/Sparkline.mjs.map +1 -1
- package/dist/esm/charts/Sparkline.native.js +11 -2
- package/dist/esm/charts/Sparkline.native.js.map +1 -1
- package/dist/esm/charts/accessibility.mjs +4 -1
- package/dist/esm/charts/accessibility.mjs.map +1 -1
- package/dist/esm/charts/accessibility.native.js +7 -1
- package/dist/esm/charts/accessibility.native.js.map +1 -1
- package/dist/esm/charts/index.mjs +2 -1
- package/dist/esm/charts/index.mjs.map +1 -1
- package/dist/esm/charts/index.native.js +2 -1
- package/dist/esm/charts/index.native.js.map +1 -1
- package/dist/esm/charts/math.mjs +16 -1
- package/dist/esm/charts/math.mjs.map +1 -1
- package/dist/esm/charts/math.native.js +18 -1
- package/dist/esm/charts/math.native.js.map +1 -1
- package/dist/esm/charts/series.mjs +51 -9
- package/dist/esm/charts/series.mjs.map +1 -1
- package/dist/esm/charts/series.native.js +55 -13
- package/dist/esm/charts/series.native.js.map +1 -1
- package/dist/esm/charts/svg.mjs +40 -4
- package/dist/esm/charts/svg.mjs.map +1 -1
- package/dist/esm/charts/svg.native.js +40 -4
- package/dist/esm/charts/svg.native.js.map +1 -1
- package/dist/esm/code/CodeBlock/index.mjs +7 -2
- package/dist/esm/code/CodeBlock/index.mjs.map +1 -1
- package/dist/esm/code/CodeBlock/index.native.js +7 -2
- package/dist/esm/code/CodeBlock/index.native.js.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.mjs +8 -22
- package/dist/esm/feedback/ConfirmDialog.mjs.map +1 -1
- package/dist/esm/feedback/ConfirmDialog.native.js +8 -23
- package/dist/esm/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/esm/feedback/NotifyHost.mjs +2 -1
- package/dist/esm/feedback/NotifyHost.mjs.map +1 -1
- package/dist/esm/feedback/NotifyHost.native.js +3 -2
- package/dist/esm/feedback/NotifyHost.native.js.map +1 -1
- package/dist/esm/feedback/copy.mjs +35 -4
- package/dist/esm/feedback/copy.mjs.map +1 -1
- package/dist/esm/feedback/copy.native.js +37 -4
- package/dist/esm/feedback/copy.native.js.map +1 -1
- package/dist/esm/feedback/index.mjs +2 -2
- package/dist/esm/feedback/index.mjs.map +1 -1
- package/dist/esm/feedback/index.native.js +2 -2
- package/dist/esm/feedback/index.native.js.map +1 -1
- package/dist/esm/feedback/notify.mjs +1 -0
- package/dist/esm/feedback/notify.mjs.map +1 -1
- package/dist/esm/feedback/notify.native.js +1 -0
- package/dist/esm/feedback/notify.native.js.map +1 -1
- package/dist/esm/feedback/route.mjs +3 -0
- package/dist/esm/feedback/route.mjs.map +1 -1
- package/dist/esm/feedback/route.native.js +3 -0
- package/dist/esm/feedback/route.native.js.map +1 -1
- package/dist/esm/feedback/store.mjs +6 -1
- package/dist/esm/feedback/store.mjs.map +1 -1
- package/dist/esm/feedback/store.native.js +8 -1
- package/dist/esm/feedback/store.native.js.map +1 -1
- package/dist/esm/icons/lucide.mjs +2 -2
- package/dist/esm/icons/lucide.mjs.map +1 -1
- package/dist/esm/icons/lucide.native.js +2 -2
- package/dist/esm/icons/lucide.native.js.map +1 -1
- package/dist/esm/layouts/PaneScaffold.mjs +97 -42
- package/dist/esm/layouts/PaneScaffold.mjs.map +1 -1
- package/dist/esm/layouts/PaneScaffold.native.js +98 -42
- package/dist/esm/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/esm/layouts/index.mjs +2 -1
- package/dist/esm/layouts/index.mjs.map +1 -1
- package/dist/esm/layouts/index.native.js +2 -1
- package/dist/esm/layouts/index.native.js.map +1 -1
- package/dist/esm/layouts/page.mjs +49 -8
- package/dist/esm/layouts/page.mjs.map +1 -1
- package/dist/esm/layouts/page.native.js +51 -8
- package/dist/esm/layouts/page.native.js.map +1 -1
- package/dist/esm/shared/useKeyboardInset.mjs +1 -19
- package/dist/esm/shared/useKeyboardInset.mjs.map +1 -1
- package/dist/esm/shared/useKeyboardInset.native.js.map +1 -1
- package/dist/esm/views/Dashboard.mjs +112 -19
- package/dist/esm/views/Dashboard.mjs.map +1 -1
- package/dist/esm/views/Dashboard.native.js +153 -47
- package/dist/esm/views/Dashboard.native.js.map +1 -1
- package/dist/esm/views/Gantt.mjs +376 -93
- package/dist/esm/views/Gantt.mjs.map +1 -1
- package/dist/esm/views/Gantt.native.js +445 -96
- package/dist/esm/views/Gantt.native.js.map +1 -1
- package/dist/esm/views/ganttMath.mjs +84 -3
- package/dist/esm/views/ganttMath.mjs.map +1 -1
- package/dist/esm/views/ganttMath.native.js +106 -4
- package/dist/esm/views/ganttMath.native.js.map +1 -1
- package/dist/esm/views/index.mjs +2 -2
- package/dist/esm/views/index.mjs.map +1 -1
- package/dist/esm/views/index.native.js +2 -2
- package/dist/esm/views/index.native.js.map +1 -1
- package/dist/jsx/Button.mjs.map +1 -1
- package/dist/jsx/Button.native.js.map +1 -1
- package/dist/jsx/Card.mjs +8 -2
- package/dist/jsx/Card.mjs.map +1 -1
- package/dist/jsx/Card.native.js +11 -1
- package/dist/jsx/Card.native.js.map +1 -1
- package/dist/jsx/CardFooter.mjs +1 -0
- package/dist/jsx/CardFooter.mjs.map +1 -1
- package/dist/jsx/CardFooter.native.js +1 -0
- package/dist/jsx/CardFooter.native.js.map +1 -1
- package/dist/jsx/CopyField/index.mjs +7 -2
- package/dist/jsx/CopyField/index.mjs.map +1 -1
- package/dist/jsx/CopyField/index.native.js +6 -1
- package/dist/jsx/CopyField/index.native.js.map +1 -1
- package/dist/jsx/DropdownMenu/index.mjs +32 -2
- package/dist/jsx/DropdownMenu/index.mjs.map +1 -1
- package/dist/jsx/DropdownMenu/index.native.js +31 -1
- package/dist/jsx/DropdownMenu/index.native.js.map +1 -1
- package/dist/jsx/Meter/index.mjs +12 -5
- package/dist/jsx/Meter/index.mjs.map +1 -1
- package/dist/jsx/Meter/index.native.js +12 -5
- package/dist/jsx/Meter/index.native.js.map +1 -1
- package/dist/jsx/Tabs/index.mjs +7 -6
- package/dist/jsx/Tabs/index.mjs.map +1 -1
- package/dist/jsx/Tabs/index.native.js +8 -7
- package/dist/jsx/Tabs/index.native.js.map +1 -1
- package/dist/jsx/Toast/index.mjs +52 -3
- package/dist/jsx/Toast/index.mjs.map +1 -1
- package/dist/jsx/Toast/index.native.js +55 -2
- package/dist/jsx/Toast/index.native.js.map +1 -1
- package/dist/jsx/actions/DestructiveAction.mjs +8 -14
- package/dist/jsx/actions/DestructiveAction.mjs.map +1 -1
- package/dist/jsx/actions/DestructiveAction.native.js +7 -15
- package/dist/jsx/actions/DestructiveAction.native.js.map +1 -1
- package/dist/jsx/charts/Axis.mjs +6 -1
- package/dist/jsx/charts/Axis.mjs.map +1 -1
- package/dist/jsx/charts/Axis.native.js +5 -0
- package/dist/jsx/charts/Axis.native.js.map +1 -1
- package/dist/jsx/charts/BarChart.mjs +72 -58
- package/dist/jsx/charts/BarChart.mjs.map +1 -1
- package/dist/jsx/charts/BarChart.native.js +81 -67
- package/dist/jsx/charts/BarChart.native.js.map +1 -1
- package/dist/jsx/charts/ChartDataView.mjs +185 -0
- package/dist/jsx/charts/ChartDataView.mjs.map +1 -0
- package/dist/jsx/charts/ChartDataView.native.js +224 -0
- package/dist/jsx/charts/ChartDataView.native.js.map +1 -0
- package/dist/jsx/charts/ChartSurface.mjs +5 -1
- package/dist/jsx/charts/ChartSurface.mjs.map +1 -1
- package/dist/jsx/charts/ChartSurface.native.js +5 -1
- package/dist/jsx/charts/ChartSurface.native.js.map +1 -1
- package/dist/jsx/charts/LineChart.mjs +82 -68
- package/dist/jsx/charts/LineChart.mjs.map +1 -1
- package/dist/jsx/charts/LineChart.native.js +94 -80
- package/dist/jsx/charts/LineChart.native.js.map +1 -1
- package/dist/jsx/charts/PieChart.mjs +100 -75
- package/dist/jsx/charts/PieChart.mjs.map +1 -1
- package/dist/jsx/charts/PieChart.native.js +109 -84
- package/dist/jsx/charts/PieChart.native.js.map +1 -1
- package/dist/jsx/charts/Sparkline.mjs +11 -2
- package/dist/jsx/charts/Sparkline.mjs.map +1 -1
- package/dist/jsx/charts/Sparkline.native.js +10 -1
- package/dist/jsx/charts/Sparkline.native.js.map +1 -1
- package/dist/jsx/charts/accessibility.mjs +4 -1
- package/dist/jsx/charts/accessibility.mjs.map +1 -1
- package/dist/jsx/charts/accessibility.native.js +7 -0
- package/dist/jsx/charts/accessibility.native.js.map +1 -1
- package/dist/jsx/charts/index.mjs +2 -1
- package/dist/jsx/charts/index.mjs.map +1 -1
- package/dist/jsx/charts/index.native.js +2 -0
- package/dist/jsx/charts/index.native.js.map +1 -1
- package/dist/jsx/charts/math.mjs +16 -1
- package/dist/jsx/charts/math.mjs.map +1 -1
- package/dist/jsx/charts/math.native.js +18 -0
- package/dist/jsx/charts/math.native.js.map +1 -1
- package/dist/jsx/charts/series.mjs +51 -9
- package/dist/jsx/charts/series.mjs.map +1 -1
- package/dist/jsx/charts/series.native.js +53 -11
- package/dist/jsx/charts/series.native.js.map +1 -1
- package/dist/jsx/charts/svg.mjs +40 -4
- package/dist/jsx/charts/svg.mjs.map +1 -1
- package/dist/jsx/charts/svg.native.js +46 -3
- package/dist/jsx/charts/svg.native.js.map +1 -1
- package/dist/jsx/code/CodeBlock/index.mjs +7 -2
- package/dist/jsx/code/CodeBlock/index.mjs.map +1 -1
- package/dist/jsx/code/CodeBlock/index.native.js +6 -1
- package/dist/jsx/code/CodeBlock/index.native.js.map +1 -1
- package/dist/jsx/feedback/ConfirmDialog.mjs +8 -22
- package/dist/jsx/feedback/ConfirmDialog.mjs.map +1 -1
- package/dist/jsx/feedback/ConfirmDialog.native.js +7 -22
- package/dist/jsx/feedback/ConfirmDialog.native.js.map +1 -1
- package/dist/jsx/feedback/NotifyHost.mjs +2 -1
- package/dist/jsx/feedback/NotifyHost.mjs.map +1 -1
- package/dist/jsx/feedback/NotifyHost.native.js +3 -2
- package/dist/jsx/feedback/NotifyHost.native.js.map +1 -1
- package/dist/jsx/feedback/copy.mjs +35 -4
- package/dist/jsx/feedback/copy.mjs.map +1 -1
- package/dist/jsx/feedback/copy.native.js +38 -4
- package/dist/jsx/feedback/copy.native.js.map +1 -1
- package/dist/jsx/feedback/index.mjs +2 -2
- package/dist/jsx/feedback/index.mjs.map +1 -1
- package/dist/jsx/feedback/index.native.js +1 -0
- package/dist/jsx/feedback/index.native.js.map +1 -1
- package/dist/jsx/feedback/notify.mjs +1 -0
- package/dist/jsx/feedback/notify.mjs.map +1 -1
- package/dist/jsx/feedback/notify.native.js +1 -0
- package/dist/jsx/feedback/notify.native.js.map +1 -1
- package/dist/jsx/feedback/route.mjs +3 -0
- package/dist/jsx/feedback/route.mjs.map +1 -1
- package/dist/jsx/feedback/route.native.js +3 -0
- package/dist/jsx/feedback/route.native.js.map +1 -1
- package/dist/jsx/feedback/store.mjs +6 -1
- package/dist/jsx/feedback/store.mjs.map +1 -1
- package/dist/jsx/feedback/store.native.js +8 -0
- package/dist/jsx/feedback/store.native.js.map +1 -1
- package/dist/jsx/icons/lucide.mjs +2 -2
- package/dist/jsx/icons/lucide.mjs.map +1 -1
- package/dist/jsx/icons/lucide.native.js +2 -1
- package/dist/jsx/layouts/PaneScaffold.mjs +97 -42
- package/dist/jsx/layouts/PaneScaffold.mjs.map +1 -1
- package/dist/jsx/layouts/PaneScaffold.native.js +97 -41
- package/dist/jsx/layouts/PaneScaffold.native.js.map +1 -1
- package/dist/jsx/layouts/index.mjs +2 -1
- package/dist/jsx/layouts/index.mjs.map +1 -1
- package/dist/jsx/layouts/index.native.js +2 -0
- package/dist/jsx/layouts/index.native.js.map +1 -1
- package/dist/jsx/layouts/page.mjs +49 -8
- package/dist/jsx/layouts/page.mjs.map +1 -1
- package/dist/jsx/layouts/page.native.js +50 -7
- package/dist/jsx/layouts/page.native.js.map +1 -1
- package/dist/jsx/shared/useKeyboardInset.mjs +1 -19
- package/dist/jsx/shared/useKeyboardInset.mjs.map +1 -1
- package/dist/jsx/shared/useKeyboardInset.native.js +3 -3
- package/dist/jsx/shared/useKeyboardInset.native.js.map +1 -1
- package/dist/jsx/views/Dashboard.mjs +112 -19
- package/dist/jsx/views/Dashboard.mjs.map +1 -1
- package/dist/jsx/views/Dashboard.native.js +151 -45
- package/dist/jsx/views/Dashboard.native.js.map +1 -1
- package/dist/jsx/views/Gantt.mjs +376 -93
- package/dist/jsx/views/Gantt.mjs.map +1 -1
- package/dist/jsx/views/Gantt.native.js +443 -94
- package/dist/jsx/views/Gantt.native.js.map +1 -1
- package/dist/jsx/views/ganttMath.mjs +84 -3
- package/dist/jsx/views/ganttMath.mjs.map +1 -1
- package/dist/jsx/views/ganttMath.native.js +113 -3
- package/dist/jsx/views/ganttMath.native.js.map +1 -1
- package/dist/jsx/views/index.mjs +2 -2
- package/dist/jsx/views/index.mjs.map +1 -1
- package/dist/jsx/views/index.native.js +20 -1
- package/dist/jsx/views/index.native.js.map +1 -1
- package/package.json +11 -9
- package/src/Button.tsx +10 -2
- package/src/Card.spec.tsx +76 -3
- package/src/Card.stories.tsx +1 -1
- package/src/Card.tsx +13 -1
- package/src/CardFooter.stories.tsx +3 -7
- package/src/CardFooter.tsx +3 -1
- package/src/CardHeader.stories.tsx +1 -3
- package/src/Collapsible.stories.tsx +2 -2
- package/src/CopyField/CopyField.spec.tsx +66 -1
- package/src/CopyField/index.tsx +4 -3
- package/src/DropdownMenu/DropdownMenu.spec.tsx +112 -1
- package/src/DropdownMenu/DropdownMenu.stories.tsx +1 -3
- package/src/DropdownMenu/index.tsx +67 -6
- package/src/LinearGradient.stories.tsx +2 -2
- package/src/Meter/Meter.spec.tsx +59 -2
- package/src/Meter/Meter.stories.tsx +38 -0
- package/src/Meter/index.tsx +9 -4
- package/src/Panel.stories.tsx +1 -1
- package/src/SortableList/SortableList.spec.tsx +3 -3
- package/src/Tabs/Tabs.spec.tsx +43 -3
- package/src/Tabs/Tabs.stories.tsx +10 -1
- package/src/Tabs/index.tsx +19 -13
- package/src/Toast/Toast.spec.tsx +56 -1
- package/src/Toast/index.tsx +68 -3
- package/src/Unspaced.stories.tsx +2 -2
- package/src/VisuallyHidden.stories.tsx +2 -2
- package/src/actions/DestructiveAction.spec.tsx +19 -3
- package/src/actions/DestructiveAction.tsx +9 -14
- package/src/charts/Axis.tsx +6 -1
- package/src/charts/BarChart.tsx +82 -67
- package/src/charts/ChartDataView.spec.tsx +104 -0
- package/src/charts/ChartDataView.tsx +158 -0
- package/src/charts/ChartSurface.tsx +7 -2
- package/src/charts/Charts.stories.tsx +213 -9
- package/src/charts/LineChart.tsx +90 -75
- package/src/charts/PieChart.knobs.spec.tsx +25 -0
- package/src/charts/PieChart.tsx +51 -9
- package/src/charts/Sparkline.tsx +25 -3
- package/src/charts/accessibility.ts +8 -0
- package/src/charts/charts.spec.tsx +77 -3
- package/src/charts/index.ts +2 -0
- package/src/charts/math.spec.ts +19 -0
- package/src/charts/math.ts +36 -0
- package/src/charts/series.tsx +101 -21
- package/src/charts/svg.spec.ts +28 -0
- package/src/charts/svg.ts +56 -2
- package/src/code/CodeBlock/CodeBlock.copy.spec.tsx +23 -0
- package/src/code/CodeBlock/index.tsx +4 -3
- package/src/feedback/ConfirmDialog.nativeFocus.spec.tsx +52 -0
- package/src/feedback/ConfirmDialog.spec.tsx +20 -0
- package/src/feedback/ConfirmDialog.tsx +9 -15
- package/src/feedback/NotifyHost.tsx +11 -2
- package/src/feedback/copy.ts +36 -4
- package/src/feedback/index.ts +1 -0
- package/src/feedback/notify.spec.ts +15 -1
- package/src/feedback/notify.ts +1 -0
- package/src/feedback/route.ts +4 -0
- package/src/feedback/store.ts +7 -0
- package/src/icons/lucide.ts +1 -1
- package/src/images/SvgUri/index.native.ts +11 -3
- package/src/layouts/EmptyState.stories.tsx +2 -2
- package/src/layouts/Page.weight.spec.tsx +75 -0
- package/src/layouts/PageHeader.stories.tsx +4 -4
- package/src/layouts/PageTemplates.stories.tsx +2 -2
- package/src/layouts/PaneScaffold.spec.tsx +144 -4
- package/src/layouts/PaneScaffold.stories.tsx +58 -2
- package/src/layouts/PaneScaffold.tsx +156 -58
- package/src/layouts/ScreenToolbar.stories.tsx +6 -23
- package/src/layouts/index.tsx +11 -0
- package/src/layouts/layouts.spec.tsx +51 -0
- package/src/layouts/page.designLaw.spec.tsx +25 -0
- package/src/layouts/page.tsx +46 -9
- package/src/shared/useKeyboardInset.native.ts +43 -0
- package/src/shared/useKeyboardInset.ts +2 -41
- package/src/tamagui.spec.ts +63 -0
- package/src/views/Dashboard.stories.tsx +38 -1
- package/src/views/Dashboard.tsx +119 -21
- package/src/views/Gantt.scroll.spec.tsx +120 -0
- package/src/views/Gantt.spec.tsx +376 -0
- package/src/views/Gantt.stories.tsx +75 -2
- package/src/views/Gantt.tsx +564 -96
- package/src/views/Kanban.spec.tsx +11 -0
- package/src/views/ganttMath.ts +142 -4
- package/src/views/index.ts +44 -1
- package/src/views/views.spec.tsx +39 -0
- package/types/Button.d.ts +12 -2
- package/types/Button.d.ts.map +1 -1
- package/types/Card.d.ts.map +1 -1
- package/types/CardFooter.d.ts +2 -1
- package/types/CardFooter.d.ts.map +1 -1
- package/types/CopyField/index.d.ts.map +1 -1
- package/types/DropdownMenu/index.d.ts +22 -0
- package/types/DropdownMenu/index.d.ts.map +1 -1
- package/types/Meter/index.d.ts.map +1 -1
- package/types/Tabs/index.d.ts +1 -1
- package/types/Tabs/index.d.ts.map +1 -1
- package/types/Toast/index.d.ts +16 -0
- package/types/Toast/index.d.ts.map +1 -1
- package/types/actions/DestructiveAction.d.ts.map +1 -1
- package/types/charts/Axis.d.ts.map +1 -1
- package/types/charts/BarChart.d.ts.map +1 -1
- package/types/charts/ChartDataView.d.ts +22 -0
- package/types/charts/ChartDataView.d.ts.map +1 -0
- package/types/charts/ChartSurface.d.ts +4 -1
- package/types/charts/ChartSurface.d.ts.map +1 -1
- package/types/charts/LineChart.d.ts.map +1 -1
- package/types/charts/PieChart.d.ts +1 -1
- package/types/charts/PieChart.d.ts.map +1 -1
- package/types/charts/Sparkline.d.ts +3 -1
- package/types/charts/Sparkline.d.ts.map +1 -1
- package/types/charts/accessibility.d.ts +3 -0
- package/types/charts/accessibility.d.ts.map +1 -1
- package/types/charts/index.d.ts +1 -0
- package/types/charts/index.d.ts.map +1 -1
- package/types/charts/math.d.ts +12 -0
- package/types/charts/math.d.ts.map +1 -1
- package/types/charts/series.d.ts +1 -1
- package/types/charts/series.d.ts.map +1 -1
- package/types/charts/svg.d.ts +18 -2
- package/types/charts/svg.d.ts.map +1 -1
- package/types/code/CodeBlock/index.d.ts.map +1 -1
- package/types/feedback/ConfirmDialog.d.ts.map +1 -1
- package/types/feedback/NotifyHost.d.ts +3 -1
- package/types/feedback/NotifyHost.d.ts.map +1 -1
- package/types/feedback/copy.d.ts +12 -2
- package/types/feedback/copy.d.ts.map +1 -1
- package/types/feedback/index.d.ts +1 -1
- package/types/feedback/index.d.ts.map +1 -1
- package/types/feedback/notify.d.ts.map +1 -1
- package/types/feedback/route.d.ts +3 -0
- package/types/feedback/route.d.ts.map +1 -1
- package/types/feedback/store.d.ts +2 -0
- package/types/feedback/store.d.ts.map +1 -1
- package/types/icons/lucide.d.ts +1 -1
- package/types/icons/lucide.d.ts.map +1 -1
- package/types/images/SvgUri/index.native.d.ts +4 -3
- package/types/images/SvgUri/index.native.d.ts.map +1 -1
- package/types/layouts/PaneScaffold.d.ts +27 -5
- package/types/layouts/PaneScaffold.d.ts.map +1 -1
- package/types/layouts/index.d.ts +1 -0
- package/types/layouts/index.d.ts.map +1 -1
- package/types/layouts/page.d.ts +10 -5
- package/types/layouts/page.d.ts.map +1 -1
- package/types/shared/useKeyboardInset.d.ts +1 -14
- package/types/shared/useKeyboardInset.d.ts.map +1 -1
- package/types/shared/useKeyboardInset.native.d.ts +16 -0
- package/types/shared/useKeyboardInset.native.d.ts.map +1 -0
- package/types/views/Dashboard.d.ts.map +1 -1
- package/types/views/Gantt.d.ts +132 -13
- package/types/views/Gantt.d.ts.map +1 -1
- package/types/views/ganttMath.d.ts +73 -0
- package/types/views/ganttMath.d.ts.map +1 -1
- package/types/views/index.d.ts +2 -2
- package/types/views/index.d.ts.map +1 -1
package/src/Toast/index.tsx
CHANGED
|
@@ -52,6 +52,7 @@ import {
|
|
|
52
52
|
} from "@tamagui/toast";
|
|
53
53
|
import { useEffect, useId, useLayoutEffect, useMemo, useRef, useSyncExternalStore } from "react";
|
|
54
54
|
import type { CSSProperties, ReactNode } from "react";
|
|
55
|
+
import { AccessibilityInfo } from "react-native";
|
|
55
56
|
import { useTranslation } from "../shared/i18n";
|
|
56
57
|
import {
|
|
57
58
|
SizableText,
|
|
@@ -221,6 +222,9 @@ function paintToastFrame(
|
|
|
221
222
|
attrs: { size: string; density: string; nestedPx: number; edgeColor?: string },
|
|
222
223
|
) {
|
|
223
224
|
if (!node) return;
|
|
225
|
+
// Native host refs are not HTMLElements. Native already binds testID /
|
|
226
|
+
// data-* via dataAttrs and the intent edge via borderStartWidth.
|
|
227
|
+
if (typeof node.setAttribute !== "function") return;
|
|
224
228
|
node.setAttribute("data-testid", "toast");
|
|
225
229
|
node.setAttribute("data-size", attrs.size);
|
|
226
230
|
node.setAttribute("data-density", attrs.density);
|
|
@@ -230,6 +234,42 @@ function paintToastFrame(
|
|
|
230
234
|
if (attrs.edgeColor) node.style.borderInlineStartColor = attrs.edgeColor;
|
|
231
235
|
}
|
|
232
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Spoken confirm. Tamagui's ToastAnnounce portal is web-only
|
|
239
|
+
* (`announceTextContent` is null off-web in ToastImpl), so native VoiceOver
|
|
240
|
+
* never heard CopyField's "Copied to clipboard." Put the title on the
|
|
241
|
+
* frame and announce it the same way field errors do.
|
|
242
|
+
*/
|
|
243
|
+
function spokenToastText(title: ReactNode, description?: ReactNode): string | undefined {
|
|
244
|
+
const chunks: string[] = [];
|
|
245
|
+
if (typeof title === "string" && title.trim()) chunks.push(title.trim());
|
|
246
|
+
if (typeof description === "string" && description.trim()) chunks.push(description.trim());
|
|
247
|
+
return chunks.length ? chunks.join(". ") : undefined;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function useAnnounceToast(text: string | undefined) {
|
|
251
|
+
useEffect(() => {
|
|
252
|
+
if (isWeb || !text) return;
|
|
253
|
+
AccessibilityInfo.announceForAccessibility(text);
|
|
254
|
+
}, [text]);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export function nativeToastA11y(text: string | undefined, hasControls: boolean, web = isWeb) {
|
|
258
|
+
if (web) return {};
|
|
259
|
+
// ToastImplFrame defaults to tabIndex:0, which Tamagui maps to accessible.
|
|
260
|
+
// Explicit false keeps native controls from disappearing inside that group.
|
|
261
|
+
if (!text || hasControls) return { accessible: false as const };
|
|
262
|
+
return {
|
|
263
|
+
accessible: true as const,
|
|
264
|
+
accessibilityLabel: text,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** Native View controls need accessible as well as their button role and label. */
|
|
269
|
+
export function nativeToastControlA11y(web = isWeb) {
|
|
270
|
+
return web ? {} : { accessible: true as const };
|
|
271
|
+
}
|
|
272
|
+
|
|
233
273
|
// Grown transparent press target. Stays UNPAINTED — LC-71 ring lives on the
|
|
234
274
|
// inner pill via `.mp-chip-dismiss:focus-visible .mp-chip-dismiss-ring`.
|
|
235
275
|
const ToastActionTarget = styled(View, {
|
|
@@ -423,7 +463,15 @@ function ToastBody({
|
|
|
423
463
|
}
|
|
424
464
|
return (
|
|
425
465
|
<>
|
|
426
|
-
<View
|
|
466
|
+
<View
|
|
467
|
+
flexShrink={0}
|
|
468
|
+
height={iconPx}
|
|
469
|
+
justifyContent="center"
|
|
470
|
+
marginTop={1}
|
|
471
|
+
accessible={false}
|
|
472
|
+
accessibilityElementsHidden
|
|
473
|
+
importantForAccessibility="no"
|
|
474
|
+
>
|
|
427
475
|
<Icon size={iconPx} weight="fill" color={iconColor} />
|
|
428
476
|
</View>
|
|
429
477
|
<YStack flexGrow={1} flexShrink={1} gap="$1" minWidth={0} justifyContent="center">
|
|
@@ -512,6 +560,8 @@ function ToastInner({
|
|
|
512
560
|
edgeColor,
|
|
513
561
|
} = useToastVisuals(intent, compact);
|
|
514
562
|
const showClose = dismissible ?? onDismiss != null;
|
|
563
|
+
const spoken = spokenToastText(title, description);
|
|
564
|
+
useAnnounceToast(spoken);
|
|
515
565
|
const frameRef = useRef<HTMLElement | null>(null);
|
|
516
566
|
useLayoutEffect(() => {
|
|
517
567
|
paintToastFrame(frameRef.current, {
|
|
@@ -527,8 +577,15 @@ function ToastInner({
|
|
|
527
577
|
: undefined;
|
|
528
578
|
return (
|
|
529
579
|
<XStack
|
|
530
|
-
|
|
531
|
-
|
|
580
|
+
{...(isWeb
|
|
581
|
+
? {
|
|
582
|
+
role: "status" as const,
|
|
583
|
+
"aria-live": "polite" as const,
|
|
584
|
+
"aria-atomic": true,
|
|
585
|
+
"aria-label": spoken,
|
|
586
|
+
}
|
|
587
|
+
: {})}
|
|
588
|
+
{...nativeToastA11y(spoken, action != null || showClose)}
|
|
532
589
|
className="mp-toast"
|
|
533
590
|
transition={knobProps.transition}
|
|
534
591
|
{...frameProps}
|
|
@@ -550,6 +607,7 @@ function ToastInner({
|
|
|
550
607
|
/>
|
|
551
608
|
{action && (
|
|
552
609
|
<ToastActionTarget
|
|
610
|
+
{...nativeToastControlA11y()}
|
|
553
611
|
className="mp-chip-dismiss"
|
|
554
612
|
{...toastActionPressProps(nestedPx)}
|
|
555
613
|
aria-label={action.altText ?? action.label}
|
|
@@ -571,6 +629,7 @@ function ToastInner({
|
|
|
571
629
|
)}
|
|
572
630
|
{showClose && (
|
|
573
631
|
<ToastCloseTarget
|
|
632
|
+
{...nativeToastControlA11y()}
|
|
574
633
|
className="mp-chip-dismiss"
|
|
575
634
|
aria-label={t("Dismiss notification")}
|
|
576
635
|
alignSelf={description ? "flex-start" : "center"}
|
|
@@ -628,6 +687,8 @@ function ToastItemInner({ entry, isTop, compact }: ToastItemProps) {
|
|
|
628
687
|
// Store-resolved policy: 0 = sticky/persistent (never auto-expires).
|
|
629
688
|
const duration = entry.duration === 0 ? Number.POSITIVE_INFINITY : entry.duration;
|
|
630
689
|
const assertive = entry.intent === "error" || entry.intent === "warning";
|
|
690
|
+
const spoken = spokenToastText(entry.title, entry.description);
|
|
691
|
+
useAnnounceToast(entry.open ? spoken : undefined);
|
|
631
692
|
const frameRef = useRef<HTMLElement | null>(null);
|
|
632
693
|
useLayoutEffect(() => {
|
|
633
694
|
paintToastFrame(frameRef.current, {
|
|
@@ -645,6 +706,8 @@ function ToastItemInner({ entry, isTop, compact }: ToastItemProps) {
|
|
|
645
706
|
}}
|
|
646
707
|
duration={duration}
|
|
647
708
|
type={assertive ? "foreground" : "background"}
|
|
709
|
+
{...(isWeb ? { "aria-label": spoken } : {})}
|
|
710
|
+
{...nativeToastA11y(spoken, entry.action != null || entry.dismissible)}
|
|
648
711
|
className="mp-toast"
|
|
649
712
|
transition={knobProps.transition}
|
|
650
713
|
enterStyle={enterExit}
|
|
@@ -668,6 +731,7 @@ function ToastItemInner({ entry, isTop, compact }: ToastItemProps) {
|
|
|
668
731
|
{entry.action && (
|
|
669
732
|
<TamaguiToast.Action altText={entry.action.altText ?? entry.action.label} asChild>
|
|
670
733
|
<ToastActionTarget
|
|
734
|
+
{...nativeToastControlA11y()}
|
|
671
735
|
className="mp-chip-dismiss"
|
|
672
736
|
{...toastActionPressProps(nestedPx)}
|
|
673
737
|
// Toast.Action defaults to aria-label "Close"; announce the action.
|
|
@@ -692,6 +756,7 @@ function ToastItemInner({ entry, isTop, compact }: ToastItemProps) {
|
|
|
692
756
|
{entry.dismissible && (
|
|
693
757
|
<TamaguiToast.Close asChild>
|
|
694
758
|
<ToastCloseTarget
|
|
759
|
+
{...nativeToastControlA11y()}
|
|
695
760
|
className="mp-chip-dismiss"
|
|
696
761
|
aria-label={t("Dismiss notification")}
|
|
697
762
|
{...toastClosePressProps(entry.action != null, closeVisual)}
|
package/src/Unspaced.stories.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
|
-
import { Text
|
|
3
|
-
import { Unspaced } from "./tamagui";
|
|
2
|
+
import { Text } from "./Text";
|
|
3
|
+
import { Unspaced, YStack } from "./tamagui";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Unspaced> = {
|
|
6
6
|
title: "Components/Unspaced",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
2
|
-
import { Text
|
|
3
|
-
import { VisuallyHidden } from "./tamagui";
|
|
2
|
+
import { Text } from "./Text";
|
|
3
|
+
import { VisuallyHidden, YStack } from "./tamagui";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof VisuallyHidden> = {
|
|
6
6
|
title: "Components/VisuallyHidden",
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* @vitest-environment jsdom
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { readFileSync } from "node:fs";
|
|
6
|
+
import { resolve } from "node:path";
|
|
5
7
|
import { fireEvent, screen, waitFor } from "@testing-library/react";
|
|
6
8
|
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
7
9
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
@@ -252,7 +254,7 @@ describe("DestructiveAction", () => {
|
|
|
252
254
|
await waitFor(() => expect(onAction).toHaveBeenCalledTimes(1));
|
|
253
255
|
});
|
|
254
256
|
|
|
255
|
-
it("typed-confirm
|
|
257
|
+
it("typed-confirm field is a Tamagui Input (native-safe), not a raw HTML input with #ccc", async () => {
|
|
256
258
|
renderWithProviders(
|
|
257
259
|
<DestructiveAction
|
|
258
260
|
severity="high"
|
|
@@ -264,8 +266,22 @@ describe("DestructiveAction", () => {
|
|
|
264
266
|
);
|
|
265
267
|
fireEvent.click(screen.getByText("Delete project"));
|
|
266
268
|
await waitFor(() => expect(alertdialog()).toBeTruthy());
|
|
267
|
-
const
|
|
269
|
+
const marked = alertdialog()?.querySelector("[data-mp-confirm-expected]");
|
|
270
|
+
expect(marked).toBeTruthy();
|
|
271
|
+
const input =
|
|
272
|
+
marked instanceof HTMLInputElement
|
|
273
|
+
? marked
|
|
274
|
+
: (marked?.querySelector("input") as HTMLInputElement | null);
|
|
268
275
|
expect(input).toBeTruthy();
|
|
269
|
-
expect(input
|
|
276
|
+
expect(input!.getAttribute("style") ?? input!.style.cssText).not.toMatch(/#ccc/i);
|
|
277
|
+
expect(alertdialog()?.querySelector("[data-mp-confirm-prompt]")?.textContent).toContain(
|
|
278
|
+
'Type "my-project" to confirm.',
|
|
279
|
+
);
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
it("typed-confirm TSX has no HTML span/input hosts (MPO-165)", () => {
|
|
283
|
+
const src = readFileSync(resolve(process.cwd(), "src/actions/DestructiveAction.tsx"), "utf8");
|
|
284
|
+
expect(src).not.toMatch(/<span[\s>]/);
|
|
285
|
+
expect(src).not.toMatch(/<input[\s>]/);
|
|
270
286
|
});
|
|
271
287
|
});
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { Button, formatActionLabel, type ButtonProps } from "@multiplatform.one/forms";
|
|
9
9
|
import { useCallback, useState, type ReactNode } from "react";
|
|
10
10
|
import { useTranslation } from "../shared/i18n";
|
|
11
|
-
import { Paragraph, YStack } from "tamagui";
|
|
11
|
+
import { Input, Paragraph, YStack } from "tamagui";
|
|
12
12
|
import { ConfirmDialog } from "../feedback/ConfirmDialog";
|
|
13
13
|
import { withInterp } from "../shared/t";
|
|
14
14
|
import {
|
|
@@ -211,24 +211,19 @@ export function DestructiveAction({
|
|
|
211
211
|
dialogCtx.expectedText != null ? (
|
|
212
212
|
<YStack gap="$3">
|
|
213
213
|
{consequence ? <Paragraph size="$3">{consequence}</Paragraph> : null}
|
|
214
|
-
<
|
|
215
|
-
|
|
214
|
+
<Paragraph size="$3" data-mp-confirm-prompt="">
|
|
215
|
+
{typedPrompt}
|
|
216
|
+
</Paragraph>
|
|
217
|
+
<Input
|
|
216
218
|
value={typedText}
|
|
217
|
-
|
|
219
|
+
onChangeText={setTypedText}
|
|
218
220
|
placeholder={dialogCtx.expectedText}
|
|
219
221
|
autoCapitalize="none"
|
|
220
|
-
autoCorrect=
|
|
222
|
+
autoCorrect={false}
|
|
221
223
|
spellCheck={false}
|
|
222
224
|
data-mp-confirm-expected=""
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
padding: "8px 12px",
|
|
226
|
-
borderRadius: 8,
|
|
227
|
-
border: "1px solid var(--borderColor, var(--c-color6, currentColor))",
|
|
228
|
-
background: "var(--background, transparent)",
|
|
229
|
-
color: "inherit",
|
|
230
|
-
font: "inherit",
|
|
231
|
-
}}
|
|
225
|
+
accessibilityLabel={typedPrompt ?? undefined}
|
|
226
|
+
width="100%"
|
|
232
227
|
/>
|
|
233
228
|
</YStack>
|
|
234
229
|
) : (
|
package/src/charts/Axis.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ScaleBand, ScaleLinear, ScalePoint } from "d3-scale";
|
|
2
2
|
import { formatAxisTick, getLinearTicks, truncateLabel } from "./math";
|
|
3
|
-
import { G, Line, SvgText } from "./svg";
|
|
3
|
+
import { G, Line, SvgText, chartChromeProps } from "./svg";
|
|
4
4
|
import type { PlotArea } from "./types";
|
|
5
5
|
import { useChartTheme } from "./useChartTheme";
|
|
6
6
|
|
|
@@ -47,6 +47,7 @@ export function XAxis({
|
|
|
47
47
|
<G>
|
|
48
48
|
{showLine ? (
|
|
49
49
|
<Line
|
|
50
|
+
{...chartChromeProps("axis")}
|
|
50
51
|
x1={plot.x}
|
|
51
52
|
y1={y}
|
|
52
53
|
x2={plot.x + plot.width}
|
|
@@ -64,6 +65,7 @@ export function XAxis({
|
|
|
64
65
|
<G key={`${value}-${index}`}>
|
|
65
66
|
{showTicks ? (
|
|
66
67
|
<Line
|
|
68
|
+
{...chartChromeProps("axis")}
|
|
67
69
|
x1={center}
|
|
68
70
|
y1={y}
|
|
69
71
|
x2={center}
|
|
@@ -130,6 +132,7 @@ export function YAxis({
|
|
|
130
132
|
<G>
|
|
131
133
|
{showLine ? (
|
|
132
134
|
<Line
|
|
135
|
+
{...chartChromeProps("axis")}
|
|
133
136
|
x1={plot.x}
|
|
134
137
|
y1={plot.y}
|
|
135
138
|
x2={plot.x}
|
|
@@ -144,6 +147,7 @@ export function YAxis({
|
|
|
144
147
|
<G key={`${value}-${index}`}>
|
|
145
148
|
{showGrid ? (
|
|
146
149
|
<Line
|
|
150
|
+
{...chartChromeProps("grid")}
|
|
147
151
|
x1={plot.x}
|
|
148
152
|
y1={y}
|
|
149
153
|
x2={plot.x + plot.width}
|
|
@@ -154,6 +158,7 @@ export function YAxis({
|
|
|
154
158
|
) : null}
|
|
155
159
|
{showTicks ? (
|
|
156
160
|
<Line
|
|
161
|
+
{...chartChromeProps("axis")}
|
|
157
162
|
x1={plot.x - TICK_LENGTH}
|
|
158
163
|
y1={y}
|
|
159
164
|
x2={plot.x}
|
package/src/charts/BarChart.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useTranslation } from "../shared/i18n";
|
|
2
2
|
import type { YStackProps } from "tamagui";
|
|
3
3
|
import { XAxis, YAxis } from "./Axis";
|
|
4
|
+
import { ChartDataFrame } from "./ChartDataView";
|
|
4
5
|
import { ChartSurface } from "./ChartSurface";
|
|
5
|
-
import { describeChart, describeDatum } from "./accessibility";
|
|
6
|
+
import { chartDatumText, describeChart, describeDatum } from "./accessibility";
|
|
6
7
|
import { computeCartesianPlot, resolveSeriesFills, thinCategories } from "./composeChart";
|
|
7
8
|
import {
|
|
8
9
|
createBandScale,
|
|
@@ -83,73 +84,87 @@ export function BarChart({
|
|
|
83
84
|
const interactive = Boolean(onDatumPress || onDatumHoverIn || onDatumHoverOut);
|
|
84
85
|
|
|
85
86
|
return (
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
87
|
+
<ChartDataFrame data={data} title={title} valueFormatter={valueFormatter} width={width}>
|
|
88
|
+
<ChartSurface
|
|
89
|
+
label={ariaLabel}
|
|
90
|
+
proof={{
|
|
91
|
+
kind: "bar",
|
|
92
|
+
separated: true,
|
|
93
|
+
datumText: false,
|
|
94
|
+
datumValues: chartDatumText(data, valueFormatter),
|
|
95
|
+
datumCount: data.length,
|
|
96
|
+
}}
|
|
97
|
+
height={height}
|
|
98
|
+
width={width}
|
|
99
|
+
{...stackProps}
|
|
100
|
+
>
|
|
101
|
+
{(size) => {
|
|
102
|
+
const domain = domainProp ?? valueDomain(data.map((datum) => datum.value));
|
|
103
|
+
// Explicit domains stay literal (nice: false) so a shared 0–255
|
|
104
|
+
// scale does not drift to 0–260. Auto domains still nice for ticks.
|
|
105
|
+
const nice = domainProp ? false : undefined;
|
|
106
|
+
// Ticks come from the domain alone, so the margin scale needs no
|
|
107
|
+
// meaningful range yet — the plot rectangle depends on label widths.
|
|
108
|
+
const marginScale = createLinearScale({ domain, range: [0, 1], nice });
|
|
109
|
+
const tickValues = getLinearTicks(marginScale, yTicks);
|
|
110
|
+
const plot = computeCartesianPlot(size, {
|
|
111
|
+
showXAxis,
|
|
112
|
+
showYAxis,
|
|
113
|
+
yTickLabels: tickValues.map((value) => format(value)),
|
|
114
|
+
fontSize: labelFontSize,
|
|
115
|
+
});
|
|
116
|
+
if (plot.width <= 0 || plot.height <= 0 || data.length === 0) return null;
|
|
117
|
+
const xScale = createBandScale({
|
|
118
|
+
domain: data.map((datum) => datum.label),
|
|
119
|
+
range: [plot.x, plot.x + plot.width],
|
|
120
|
+
});
|
|
121
|
+
const yScale = createLinearScale({
|
|
122
|
+
domain,
|
|
123
|
+
range: [plot.y + plot.height, plot.y],
|
|
124
|
+
nice,
|
|
125
|
+
});
|
|
126
|
+
return (
|
|
127
|
+
<>
|
|
128
|
+
{showYAxis || showGrid ? (
|
|
129
|
+
<YAxis
|
|
130
|
+
plot={plot}
|
|
131
|
+
scale={yScale}
|
|
132
|
+
ticks={yTicks}
|
|
133
|
+
tickFormat={(value) => format(value)}
|
|
134
|
+
showLabels={showYAxis}
|
|
135
|
+
showGrid={showGrid}
|
|
136
|
+
/>
|
|
137
|
+
) : null}
|
|
138
|
+
<BarSeries
|
|
139
|
+
data={data}
|
|
140
|
+
xScale={xScale}
|
|
141
|
+
yScale={yScale}
|
|
116
142
|
plot={plot}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
143
|
+
fills={fills}
|
|
144
|
+
onDatumPress={onDatumPress}
|
|
145
|
+
onDatumHoverIn={onDatumHoverIn}
|
|
146
|
+
onDatumHoverOut={onDatumHoverOut}
|
|
147
|
+
datumLabel={
|
|
148
|
+
interactive
|
|
149
|
+
? (datum) => describeDatum({ datum, formatValue: valueFormatter })
|
|
150
|
+
: undefined
|
|
151
|
+
}
|
|
122
152
|
/>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
{showXAxis ? (
|
|
140
|
-
<XAxis
|
|
141
|
-
plot={plot}
|
|
142
|
-
scale={xScale}
|
|
143
|
-
tickValues={thinCategories(
|
|
144
|
-
data.map((datum) => datum.label),
|
|
145
|
-
plot.width,
|
|
146
|
-
labelFontSize,
|
|
147
|
-
)}
|
|
148
|
-
/>
|
|
149
|
-
) : null}
|
|
150
|
-
</>
|
|
151
|
-
);
|
|
152
|
-
}}
|
|
153
|
-
</ChartSurface>
|
|
153
|
+
{showXAxis ? (
|
|
154
|
+
<XAxis
|
|
155
|
+
plot={plot}
|
|
156
|
+
scale={xScale}
|
|
157
|
+
tickValues={thinCategories(
|
|
158
|
+
data.map((datum) => datum.label),
|
|
159
|
+
plot.width,
|
|
160
|
+
labelFontSize,
|
|
161
|
+
)}
|
|
162
|
+
/>
|
|
163
|
+
) : null}
|
|
164
|
+
</>
|
|
165
|
+
);
|
|
166
|
+
}}
|
|
167
|
+
</ChartSurface>
|
|
168
|
+
</ChartDataFrame>
|
|
154
169
|
);
|
|
155
170
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
2
|
+
import { cleanup, fireEvent, screen, waitFor } from "@testing-library/react";
|
|
3
|
+
import { afterEach, expect, it, vi } from "vitest";
|
|
4
|
+
import { XStack, YStack } from "tamagui";
|
|
5
|
+
import { ChartDataView } from "./ChartDataView";
|
|
6
|
+
import { Sparkline } from "./Sparkline";
|
|
7
|
+
import { PieChart } from "./PieChart";
|
|
8
|
+
import { ChartCard, KPICard } from "../views/Dashboard";
|
|
9
|
+
|
|
10
|
+
const data = Array.from({ length: 13 }, (_, index) => ({
|
|
11
|
+
label: `Region ${index + 1}`,
|
|
12
|
+
value: index + 1,
|
|
13
|
+
}));
|
|
14
|
+
afterEach(cleanup);
|
|
15
|
+
|
|
16
|
+
it("opens the complete formatted dataset without expanding the concise chart name", async () => {
|
|
17
|
+
renderWithProviders(
|
|
18
|
+
<ChartDataView data={data} title="Revenue" valueFormatter={(value) => `USD ${value}`}>
|
|
19
|
+
{({ action, data: series, valueFormatter }) => (
|
|
20
|
+
<YStack>
|
|
21
|
+
<XStack>{action}</XStack>
|
|
22
|
+
<Sparkline
|
|
23
|
+
data={series}
|
|
24
|
+
label="Revenue trend"
|
|
25
|
+
width={300}
|
|
26
|
+
valueFormatter={valueFormatter}
|
|
27
|
+
/>
|
|
28
|
+
</YStack>
|
|
29
|
+
)}
|
|
30
|
+
</ChartDataView>,
|
|
31
|
+
);
|
|
32
|
+
const image = document.querySelector("svg")!;
|
|
33
|
+
expect(image.getAttribute("aria-label")).toBe("Revenue trend");
|
|
34
|
+
expect(image.getAttribute("height")).toBe("36");
|
|
35
|
+
expect(image.querySelector("button")).toBeNull();
|
|
36
|
+
expect(screen.queryByText("USD 13")).toBeNull();
|
|
37
|
+
fireEvent.click(screen.getByRole("button", { name: "View data for Revenue" }));
|
|
38
|
+
expect(await screen.findByText("USD 13")).toBeInTheDocument();
|
|
39
|
+
expect(document.querySelectorAll("[data-mpo-chart-data-row]")).toHaveLength(13);
|
|
40
|
+
expect(screen.getByText("Region 13")).toBeInTheDocument();
|
|
41
|
+
fireEvent.click(screen.getByRole("button", { name: "Close" }));
|
|
42
|
+
await waitFor(() => expect(screen.queryAllByRole("dialog")).toHaveLength(0));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("normalizes bare sparkline values through the same complete channel", async () => {
|
|
46
|
+
renderWithProviders(
|
|
47
|
+
<ChartDataView data={[40, 50, 60]} title="Activity">
|
|
48
|
+
{({ action, data: series, valueFormatter }) => (
|
|
49
|
+
<YStack>
|
|
50
|
+
{action}
|
|
51
|
+
<Sparkline data={series} width={300} />
|
|
52
|
+
</YStack>
|
|
53
|
+
)}
|
|
54
|
+
</ChartDataView>,
|
|
55
|
+
);
|
|
56
|
+
fireEvent.click(screen.getByRole("button", { name: "View data for Activity" }));
|
|
57
|
+
expect(await screen.findByText("60")).toBeInTheDocument();
|
|
58
|
+
expect(document.querySelectorAll("[data-mpo-chart-data-row]")).toHaveLength(3);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
it("supplies a complete data action when the pie legend is hidden", async () => {
|
|
62
|
+
renderWithProviders(<PieChart data={data} title="Revenue" showLegend={false} />);
|
|
63
|
+
fireEvent.click(screen.getByRole("button", { name: "View data for Revenue" }));
|
|
64
|
+
expect(await screen.findByText("Region 13")).toBeInTheDocument();
|
|
65
|
+
expect(document.querySelectorAll("[data-mpo-chart-data-row]")).toHaveLength(13);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
it("keeps a visible pie legend complete without a dangling data-action association", () => {
|
|
69
|
+
renderWithProviders(
|
|
70
|
+
<ChartCard config={{ id: "revenue", type: "pie", title: "Revenue", data }} />,
|
|
71
|
+
);
|
|
72
|
+
expect(screen.getByText("Region 13")).toBeInTheDocument();
|
|
73
|
+
expect(screen.queryByRole("button", { name: "View data for Revenue" })).toBeNull();
|
|
74
|
+
expect(document.querySelector("svg")!.getAttribute("aria-describedby")).toBeNull();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("keeps a consumer metric press override separate from the data action", async () => {
|
|
78
|
+
const configured = vi.fn();
|
|
79
|
+
const consumer = vi.fn();
|
|
80
|
+
renderWithProviders(
|
|
81
|
+
<KPICard
|
|
82
|
+
config={{
|
|
83
|
+
id: "metric",
|
|
84
|
+
title: "Revenue",
|
|
85
|
+
value: 20,
|
|
86
|
+
sparkline: [10, 20],
|
|
87
|
+
onClick: configured,
|
|
88
|
+
}}
|
|
89
|
+
onPress={consumer}
|
|
90
|
+
/>,
|
|
91
|
+
);
|
|
92
|
+
fireEvent.click(screen.getByRole("button", { name: "View data for Revenue" }));
|
|
93
|
+
expect(consumer).not.toHaveBeenCalled();
|
|
94
|
+
expect(configured).not.toHaveBeenCalled();
|
|
95
|
+
expect(await screen.findByText("Revenue: data")).toBeInTheDocument();
|
|
96
|
+
fireEvent.click(screen.getByRole("button", { name: "Close" }));
|
|
97
|
+
await waitFor(() => expect(screen.queryAllByRole("dialog")).toHaveLength(0));
|
|
98
|
+
const navigation = document.querySelector('[data-mpo-kpi-navigation="metric"]')!;
|
|
99
|
+
fireEvent.click(navigation);
|
|
100
|
+
fireEvent.keyDown(navigation, { key: "Enter" });
|
|
101
|
+
fireEvent.keyDown(navigation, { key: " ", repeat: true });
|
|
102
|
+
expect(consumer).toHaveBeenCalledTimes(2);
|
|
103
|
+
expect(configured).not.toHaveBeenCalled();
|
|
104
|
+
});
|