@ngrok/mantle 0.94.0 → 0.94.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/accordion.d.ts +61 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +61 -56
- package/dist/alert-BkJHDx9X.js +1 -0
- package/dist/{alert-HffaioZM.d.ts → alert-D0zRRUHV.d.ts} +6 -6
- package/dist/alert-center.d.ts +53 -53
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.d.ts +22 -10
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +1 -1
- package/dist/alert.js +1 -1
- package/dist/anchor-Dc6IgvXV.js +1 -0
- package/dist/anchor.d.ts +5 -5
- package/dist/anchor.js +1 -1
- package/dist/app-layout.d.ts +18 -18
- package/dist/app-layout.js +1 -1
- package/dist/area-chart.d.ts +13 -13
- package/dist/area-chart.js +1 -1
- package/dist/avatar.d.ts +24 -24
- package/dist/avatar.js +1 -1
- package/dist/badge.d.ts +7 -7
- package/dist/badge.js +1 -1
- package/dist/bar-chart.d.ts +12 -12
- package/dist/bar-chart.js +1 -1
- package/dist/breadcrumb.d.ts +36 -36
- package/dist/breadcrumb.js +1 -1
- package/dist/browser-only-CZfkNw5A.js +1 -0
- package/dist/browser-only-ymFoM3Ya.js +1 -0
- package/dist/browser-only.js +1 -1
- package/dist/{button-K0pKc3GN.d.ts → button-5Pc7Mby_.d.ts} +3 -3
- package/dist/button-B9bChDgl.js +1 -0
- package/dist/button-D8jixIbH.js +1 -0
- package/dist/button-DNLTJ32M.js +1 -0
- package/dist/{button-Cgf2IcEC.d.ts → button-Ddj6yr10.d.ts} +26 -26
- package/dist/{button-BGwOPjGV.d.ts → button-DnYv7IOT.d.ts} +22 -21
- package/dist/button.d.ts +3 -3
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +1 -1
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +1 -1
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +23 -23
- package/dist/centered-layout.js +1 -1
- package/dist/{chart-CE5Uaqz9.js → chart-BLCqzt56.js} +1 -1
- package/dist/{chart-DCTGGlWL.js → chart-CChZiCrt.js} +1 -1
- package/dist/{chart-BO9EwQ60.js → chart-CUmSu9d7.js} +1 -1
- package/dist/{chart-jitNqimS.d.ts → chart-Dl8gFo_D.d.ts} +22 -22
- package/dist/chart-DtgZBAas.js +2 -0
- package/dist/checkbox-Cu5cgZmk.js +1 -0
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/choice-CCVG2hb9.js +1 -0
- package/dist/{choice-BwfmbepO.d.ts → choice-CNiOSzqV.d.ts} +20 -20
- package/dist/choice.d.ts +1 -1
- package/dist/choice.js +1 -1
- package/dist/code-BPKNY1_w.js +1 -0
- package/dist/{code-block-BGdV4Yty.d.ts → code-block-BDw6MEwH.d.ts} +9 -9
- package/dist/{code-block-W3kWPxCJ.js → code-block-CKzsAMzj.js} +3 -3
- package/dist/code-block.d.ts +15 -17
- package/dist/code-block.js +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code-block_highlight-utils.js +1 -1
- package/dist/code.d.ts +3 -3
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +15 -15
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +47 -47
- package/dist/command.js +1 -1
- package/dist/compose-refs-BdRUneoc.js +1 -0
- package/dist/{copy-to-clipboard-DInu78k_.js → copy-to-clipboard-Dd83caRw.js} +1 -1
- package/dist/cx.d.ts +4 -4
- package/dist/{data-slot-B-LqAcBB.d.ts → data-slot-BW8KQ9Xo.d.ts} +2 -2
- package/dist/data-table.d.ts +36 -36
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +1 -1
- package/dist/description-list.js +1 -1
- package/dist/{dialog-DD5H3EH1.d.ts → dialog-CIEuwNys.d.ts} +24 -8
- package/dist/{dialog-B9JAGy_x.d.ts → dialog-CbEEA0fl.d.ts} +7 -3
- package/dist/dialog-DmzoDfY3.js +1 -0
- package/dist/dialog.d.ts +2 -2
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-DmDxYPde.d.ts → dropdown-menu-CeY498yk.d.ts} +10 -10
- package/dist/dropdown-menu-uheL0prz.js +1 -0
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +2 -2
- package/dist/empty.js +1 -1
- package/dist/field-Bpvn4tQp.js +1 -0
- package/dist/field-Cai_4c1l.js +1 -0
- package/dist/field.d.ts +41 -41
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +3 -3
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +30 -10
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +3 -3
- package/dist/hover-card.js +1 -1
- package/dist/{icon-CgNqu-fl.d.ts → icon--purqHRo.d.ts} +1 -1
- package/dist/{icon-NYvyyRMG.d.ts → icon-DuIYoyft.d.ts} +2 -2
- package/dist/{icon-DXDyhy2N.d.ts → icon-QCm1ui29.d.ts} +2 -2
- package/dist/icon-xb7d9M7X.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons-DEDCLZ8B.js +1 -0
- package/dist/icons-DXadFwpo.js +1 -0
- package/dist/icons-DcesO4Ng.js +1 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +1 -1
- package/dist/{in-view-B3nMAzfE.d.ts → in-view-C_daNafg.d.ts} +4 -23
- package/dist/{input-q8o5uMhW.d.ts → input-DC4nW0Sr.d.ts} +1 -1
- package/dist/input-fW8QSZEO.js +1 -0
- package/dist/input.d.ts +4 -4
- package/dist/input.js +1 -1
- package/dist/kbd-P1nQshWo.js +1 -0
- package/dist/kbd.d.ts +5 -5
- package/dist/kbd.js +1 -1
- package/dist/label-DO1RlMKl.js +1 -0
- package/dist/{label-r2sJcSQ4.d.ts → label-epgtywRz.d.ts} +8 -8
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/layer-container-DL4yclOu.js +1 -0
- package/dist/layer-container.d.ts +2 -2
- package/dist/layer-container.js +1 -1
- package/dist/line-chart.d.ts +12 -12
- package/dist/line-chart.js +1 -1
- package/dist/list-cQZPSjfz.js +1 -0
- package/dist/list.d.ts +17 -17
- package/dist/list.js +1 -1
- package/dist/live-region-Dhapu8a5.js +1 -0
- package/dist/live-region.d.ts +1 -1
- package/dist/live-region.js +1 -1
- package/dist/llms.txt +23 -22
- package/dist/main-CHyWYDak.js +1 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +1 -1
- package/dist/mantle.css +25 -25
- package/dist/media-object.d.ts +4 -4
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +28 -28
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +3 -3
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +4 -4
- package/dist/pagination.js +1 -1
- package/dist/{popover-lwkwWcRW.d.ts → popover-Bei0jyfH.d.ts} +73 -7
- package/dist/popover-DhgunktK.js +1 -0
- package/dist/popover-T2EyaqGK.d.ts +1 -0
- package/dist/popover.d.ts +2 -2
- package/dist/popover.js +1 -1
- package/dist/primitive-D8CzV_Ft.js +1 -0
- package/dist/progress.d.ts +1 -1
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +3 -3
- package/dist/qr-code.js +1 -1
- package/dist/query-filter.d.ts +6 -6
- package/dist/query.d.ts +8 -3
- package/dist/query.js +1 -1
- package/dist/{radio-group-sLz5AA9I.d.ts → radio-group-BJQ6EOqh.d.ts} +1 -1
- package/dist/radio-group-BliblUqe.js +1 -0
- package/dist/radio-group-ggEkCi0V.js +1 -0
- package/dist/radio-group.d.ts +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/sandbar.d.ts +30 -30
- package/dist/sandbar.js +1 -1
- package/dist/sandboxed-on-click-D4PL5_GR.js +1 -0
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/scatter-plot.d.ts +13 -14
- package/dist/scatter-plot.js +1 -1
- package/dist/segmented-control.d.ts +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/select-1xuUx_os.js +1 -0
- package/dist/{select-BqmpVJJT.d.ts → select-BpaXHxJm.d.ts} +6 -6
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +18 -18
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-QfH0ot5K.d.ts → separator-Ck4sPrdN.d.ts} +1 -1
- package/dist/separator-DnvhwY2J.js +1 -0
- package/dist/separator.d.ts +1 -1
- package/dist/separator.js +1 -1
- package/dist/{shake-DL6WhMXM.js → shake-CAUpKBHe.js} +1 -1
- package/dist/sheet-DHy_vlme.js +1 -0
- package/dist/sheet.d.ts +23 -7
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +37 -37
- package/dist/sidebar.js +1 -1
- package/dist/skeleton-DHfyjuQi.js +1 -0
- package/dist/skeleton.d.ts +4 -4
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +1 -1
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +1 -1
- package/dist/slider.js +1 -1
- package/dist/slot-B7rwscwd.js +1 -0
- package/dist/{slot-D12N_fZJ.d.ts → slot-BEMQMbk3.d.ts} +4 -4
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/source-all.css +5 -1
- package/dist/split-button.d.ts +9 -9
- package/dist/split-button.js +1 -1
- package/dist/strata.d.ts +22 -22
- package/dist/strata.js +1 -1
- package/dist/{suggestions-NkqYTT49.d.ts → suggestions-BJeGvwDa.d.ts} +7 -7
- package/dist/switch.d.ts +1 -1
- package/dist/switch.js +1 -1
- package/dist/table-BnLdXUai.js +1 -0
- package/dist/{table-rWiVWEgB.d.ts → table-Ii9hHUWN.d.ts} +5 -5
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +2 -2
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +1 -1
- package/dist/text-area.js +1 -1
- package/dist/theme-BNdZl352.js +1 -0
- package/dist/theme-switcher.d.ts +4 -4
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.d.ts +14 -12
- package/dist/theme.js +1 -1
- package/dist/toast.d.ts +2 -2
- package/dist/toast.js +1 -1
- package/dist/tokens.dark.json +3261 -0
- package/dist/tokens.json +4933 -0
- package/dist/tokens.resolver.json +37 -0
- package/dist/{tooltip-CpK3XTor.d.ts → tooltip-CstGDKwy.d.ts} +4 -4
- package/dist/tooltip-DQO40Mrq.js +1 -0
- package/dist/tooltip.d.ts +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/truncated-text.d.ts +1 -1
- package/dist/truncated-text.js +1 -1
- package/dist/use-breakpoint-B4Kh0xE6.js +1 -0
- package/dist/use-callback-ref-DiOXFQzM.js +1 -0
- package/dist/use-composed-refs-DPYmLDSe.js +1 -0
- package/dist/use-copy-to-clipboard-hBL6_65i.js +1 -0
- package/dist/use-inert-siblings-C4RHXrZc.js +1 -0
- package/dist/use-is-apple-platform-Bq6_KbVX.js +1 -0
- package/dist/use-is-hydrated-BeLOGKwE.js +1 -0
- package/dist/use-is-hydrated-after-paint-CrHt3OHw.js +1 -0
- package/dist/use-isomorphic-layout-effect-CL6iq0Bj.js +1 -0
- package/dist/use-matches-media-query-FfvtNKQe.js +1 -0
- package/dist/use-prefers-reduced-motion-Ck6dnOM9.js +1 -0
- package/dist/use-swipe-to-dismiss-BYdlca8r.js +1 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +1 -1
- package/dist/visually-hidden.d.ts +1 -1
- package/dist/visually-hidden.js +1 -1
- package/dist/well.d.ts +1 -1
- package/dist/well.js +1 -1
- package/package.json +16 -2
- package/dist/alert-CH99Rw-R.js +0 -1
- package/dist/anchor-CgcbWEUs.js +0 -1
- package/dist/browser-only-BTSrYWLj.js +0 -1
- package/dist/button-69InNC_m.js +0 -1
- package/dist/button-BWGUuWnu.js +0 -1
- package/dist/button-Cu9e3SM7.js +0 -1
- package/dist/chart-DudCw24t.js +0 -2
- package/dist/checkbox-CS504fKk.js +0 -1
- package/dist/choice-uyYccm0A.js +0 -1
- package/dist/code-DUJzSl4K.js +0 -1
- package/dist/compose-refs-sFdxsL7k.js +0 -1
- package/dist/dialog-CsugEt2A.js +0 -1
- package/dist/dropdown-menu-DHdgaw4P.js +0 -1
- package/dist/field-Bihblt8U.js +0 -1
- package/dist/field-CPvjazWN.js +0 -1
- package/dist/icon-kK0c-POG.js +0 -1
- package/dist/icons-4JA-SGfv.js +0 -1
- package/dist/icons-CDLz5lpI.js +0 -1
- package/dist/icons-CSwTVV2m.js +0 -1
- package/dist/input-DHovzBjS.js +0 -1
- package/dist/kbd-CLHsJ99p.js +0 -1
- package/dist/label-DmDwzPD8.js +0 -1
- package/dist/layer-container-kEQiE4zV.js +0 -1
- package/dist/list-CO_yLdln.js +0 -1
- package/dist/live-region-DQ1QLv3L.js +0 -1
- package/dist/main-CC1L9IsH.js +0 -1
- package/dist/popover-BhTFutCz.d.ts +0 -1
- package/dist/popover-DxOqLKxy.js +0 -1
- package/dist/primitive-Dz9Al-us.js +0 -1
- package/dist/radio-group-HDVxTNPi.js +0 -1
- package/dist/radio-group-jj2abc0t.js +0 -1
- package/dist/sandboxed-on-click-C7pPu-2M.js +0 -1
- package/dist/select-C6Su0dU0.js +0 -1
- package/dist/separator-DfzxVutO.js +0 -1
- package/dist/sheet-Bd2LIhzF.js +0 -1
- package/dist/skeleton-DBpI-ko5.js +0 -1
- package/dist/slot-DdYN1L1C.js +0 -1
- package/dist/table-CFHiDBW8.js +0 -1
- package/dist/theme-DdZgLvKH.js +0 -1
- package/dist/tooltip-b6oiTaWq.js +0 -1
- package/dist/use-breakpoint--mo7kr9d.js +0 -1
- package/dist/use-callback-ref-BvVyI5K1.js +0 -1
- package/dist/use-copy-to-clipboard-Dy_0Qzb7.js +0 -1
- package/dist/use-inert-siblings-CNmNuS2h.js +0 -1
- package/dist/use-is-apple-platform-D4nifHMx.js +0 -1
- package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +0 -1
- package/dist/use-isomorphic-layout-effect-CLSmHzo4.js +0 -1
- package/dist/use-matches-media-query-m860lols.js +0 -1
- package/dist/use-prefers-reduced-motion-CU6mWmOe.js +0 -1
- package/dist/use-swipe-to-dismiss-i__cTF2v.js +0 -1
package/dist/scatter-plot.d.ts
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/charts/scatter-plot
|
|
5
5
|
*/
|
|
6
|
-
import { a as XAxisPrimitiveProps, c as LegendPrimitiveProps, d as ChartMode, h as ChartDatumEvent, i as ReferenceLinePrimitiveProps, l as CopyButtonPrimitiveProps, m as ChartDatum, n as ChartRootBaseProps, o as YAxisPrimitiveProps, r as GridPrimitiveProps, s as ChartListPrimitiveProps, t as TooltipPrimitiveProps, u as ChartAccessibilityProps, v as PointShape, y as SeriesColor } from "./chart-
|
|
6
|
+
import { a as XAxisPrimitiveProps, c as LegendPrimitiveProps, d as ChartMode, h as ChartDatumEvent, i as ReferenceLinePrimitiveProps, l as CopyButtonPrimitiveProps, m as ChartDatum, n as ChartRootBaseProps, o as YAxisPrimitiveProps, r as GridPrimitiveProps, s as ChartListPrimitiveProps, t as TooltipPrimitiveProps, u as ChartAccessibilityProps, v as PointShape, y as SeriesColor } from "./chart-Dl8gFo_D.js";
|
|
7
7
|
/**
|
|
8
8
|
* Props for {@link ScatterPlot.List}.
|
|
9
9
|
*/
|
|
10
10
|
type ScatterPlotListProps = ChartListPrimitiveProps;
|
|
11
11
|
/**
|
|
12
12
|
* Props for {@link ScatterPlot.Root}. Scatter x values must be continuous
|
|
13
|
-
* (numbers or `Date`s
|
|
13
|
+
* (numbers or `Date`s; there is no categorical scatter axis). Set `zKey` to
|
|
14
14
|
* switch the chart into the 3D projection: points render inside a rotatable
|
|
15
15
|
* cube (drag to orbit), depth-sorted with gentle perspective.
|
|
16
16
|
*
|
|
@@ -48,7 +48,7 @@ type ScatterPlotDepthProps<TDatum extends ChartDatum = ChartDatum> = {
|
|
|
48
48
|
/**
|
|
49
49
|
* How many axes the cloud currently occupies (default `3`). Changing it
|
|
50
50
|
* morphs the points onto the x axis line (`1`), the xy plane (`2`), or
|
|
51
|
-
* the full cube (`3`) with a smooth glide
|
|
51
|
+
* the full cube (`3`) with a smooth glide. This is the pattern behind "click
|
|
52
52
|
* 1D/2D/3D to see the clusters separate" explainers. The y and z frame
|
|
53
53
|
* edges fade in with their dimension.
|
|
54
54
|
*/
|
|
@@ -183,7 +183,7 @@ type ScatterPlotCopyButtonProps = CopyButtonPrimitiveProps;
|
|
|
183
183
|
*/
|
|
184
184
|
declare const Root: <TDatum extends ChartDatum = ChartDatum, TMode extends ChartMode = "interactive">(props: ScatterPlotRootProps<TDatum, TMode>) => import("react").JSX.Element;
|
|
185
185
|
/**
|
|
186
|
-
* One point series. Renders nothing itself
|
|
186
|
+
* One point series. Renders nothing itself: it registers the series with the
|
|
187
187
|
* chart, which paints its points on canvas (r≥4 dots with a surface ring,
|
|
188
188
|
* degrading gracefully past thousands of points).
|
|
189
189
|
*
|
|
@@ -204,9 +204,8 @@ declare const Root: <TDatum extends ChartDatum = ChartDatum, TMode extends Chart
|
|
|
204
204
|
*/
|
|
205
205
|
declare const Point: (props: ScatterPlotPointProps) => null;
|
|
206
206
|
/**
|
|
207
|
-
* Hairline gridlines behind the points (
|
|
208
|
-
*
|
|
209
|
-
* grid.
|
|
207
|
+
* Hairline gridlines behind the points. Renderless (painted on canvas); 2D only
|
|
208
|
+
* (the 3D cube frame carries orientation). Omit the part to omit the grid.
|
|
210
209
|
*
|
|
211
210
|
* @see https://mantle.ngrok.com/components/charts/scatter-plot#scatterplotgrid
|
|
212
211
|
*
|
|
@@ -259,8 +258,8 @@ declare const XAxis: (props: ScatterPlotXAxisProps) => null;
|
|
|
259
258
|
*/
|
|
260
259
|
declare const YAxis: (props: ScatterPlotYAxisProps) => null;
|
|
261
260
|
/**
|
|
262
|
-
* A dashed horizontal marker at a y value (
|
|
263
|
-
* only
|
|
261
|
+
* A dashed horizontal marker at a y value. Renderless (painted on canvas); 2D
|
|
262
|
+
* only (ignored in the 3D projection).
|
|
264
263
|
*
|
|
265
264
|
* @see https://mantle.ngrok.com/components/charts/scatter-plot#scatterplotreferenceline
|
|
266
265
|
*
|
|
@@ -280,7 +279,7 @@ declare const ReferenceLine: (props: ScatterPlotReferenceLineProps) => null;
|
|
|
280
279
|
/**
|
|
281
280
|
* Customizes the hover/keyboard tooltip readout. The tooltip itself is part
|
|
282
281
|
* of `ScatterPlot.Root`'s interaction contract and renders even when this
|
|
283
|
-
* part is absent
|
|
282
|
+
* part is absent. Compose it to format the label or values, append a footer,
|
|
284
283
|
* or replace the content entirely via the render-prop `children`.
|
|
285
284
|
* In 3D the readout also carries the point's z value.
|
|
286
285
|
*
|
|
@@ -311,7 +310,7 @@ declare const ReferenceLine: (props: ScatterPlotReferenceLineProps) => null;
|
|
|
311
310
|
declare const Tooltip: (props: ScatterPlotTooltipProps) => null;
|
|
312
311
|
/**
|
|
313
312
|
* The legend: series names keyed by color dots, rendered as real DOM in flow
|
|
314
|
-
* below the plot. Always compose it on multi-series charts
|
|
313
|
+
* below the plot. Always compose it on multi-series charts: identity must
|
|
315
314
|
* never rely on color-matching alone. It renders nothing for a single series
|
|
316
315
|
* (the chart's title already names it).
|
|
317
316
|
*
|
|
@@ -328,7 +327,7 @@ declare const Tooltip: (props: ScatterPlotTooltipProps) => null;
|
|
|
328
327
|
* | --- | --- | --- |
|
|
329
328
|
* | `data-slot` | `"scatter-plot-legend"` | The legend list. `ScatterPlot.Legend` renders it in flow below the plot. |
|
|
330
329
|
* | `data-slot` | `"scatter-plot-legend-label"` | On the `<div>` wrapping a `children` render prop. The default legend has none. |
|
|
331
|
-
* | `data-shape` | `"circle"` \| `"square"` \| `"triangle"` \| `"diamond"` \| `"triangle-down"` \| `"plus"` \| `"cross"` \| `"star"` | On each series' swatch, naming the glyph its `ScatterPlot.Point` wears
|
|
330
|
+
* | `data-shape` | `"circle"` \| `"square"` \| `"triangle"` \| `"diamond"` \| `"triangle-down"` \| `"plus"` \| `"cross"` \| `"star"` | On each series' swatch, naming the glyph its `ScatterPlot.Point` wears: the `shape` it set, else the circle. The swatch clips itself to that glyph, so target this only to restyle a key. |
|
|
332
331
|
*
|
|
333
332
|
* @see https://mantle.ngrok.com/components/charts/scatter-plot#scatterplotlegend
|
|
334
333
|
*
|
|
@@ -346,7 +345,7 @@ declare const Legend: (props: ScatterPlotLegendProps) => import("react").JSX.Ele
|
|
|
346
345
|
/**
|
|
347
346
|
* A button that copies the chart's current data to the clipboard as a
|
|
348
347
|
* markdown table (ISO dates, plain numbers, one column per series, plus the
|
|
349
|
-
* z column on 3D scatters)
|
|
348
|
+
* z column on 3D scatters). The table pastes into Slack, issues, docs,
|
|
350
349
|
* spreadsheets, and LLM chats. Renders in flow where composed (alongside
|
|
351
350
|
* `Legend`, below the plot); `Root` is relatively positioned, so `className`
|
|
352
351
|
* can dock it over a corner instead (e.g. `absolute right-0 top-0`).
|
|
@@ -391,7 +390,7 @@ declare const CopyButton: (props: ScatterPlotCopyButtonProps) => import("react")
|
|
|
391
390
|
*/
|
|
392
391
|
declare const List: (props: ScatterPlotListProps) => import("react").JSX.Element;
|
|
393
392
|
/**
|
|
394
|
-
* A canvas-rendered scatter plot for correlating two measures
|
|
393
|
+
* A canvas-rendered scatter plot for correlating two measures, or three with
|
|
395
394
|
* the 3D projection (`zKey`), which renders a rotatable, depth-sorted point
|
|
396
395
|
* cloud (drag to orbit). Hover hits the nearest point within 24px; keyboard
|
|
397
396
|
* stepping, polite announcements, and the sr-only description ship with
|
package/dist/scatter-plot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,a as t,c as n,d as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./chart-
|
|
1
|
+
"use client";import{_ as e,a as t,c as n,d as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"./chart-DtgZBAas.js";import{n as f,r as p}from"./chart-BLCqzt56.js";import{c as m}from"react/compiler-runtime";import{useEffect as h}from"react";import{jsx as g}from"react/jsx-runtime";const _=/* @__PURE__ */ new WeakMap,v=e=>{let t=_.get(e);return(t==null||t.parentNode!==e)&&(t=e.ownerDocument.createElement(`span`),t.style.display=`none`,t.setAttribute(`aria-hidden`,`true`),e.appendChild(t),_.set(e,t)),t},y=(e,t)=>{let n=v(e);return n.style.color=t,e.ownerDocument.defaultView?.getComputedStyle(n).color??``},b=/* @__PURE__ */ new WeakMap,x=e=>{let t=b.get(e);if(t!==void 0)return t;let n=e.createElement(`canvas`);n.width=1,n.height=1;let r=n.getContext(`2d`);return b.set(e,r),r},S=[`#010203`,`#030201`],C=/* @__PURE__ */ new WeakMap,w=(e,t)=>{let n=C.get(e);n??(n=/* @__PURE__ */ new Map,C.set(e,n));let r=n.get(t);if(r!=null)return r;let i=!1;for(let n of S)if(e.fillStyle=n,e.fillStyle=t,e.fillStyle!==n){i=!0;break}return n.set(t,i),i},T=/^var\(\s*(--[\w-]+)\s*\)$/i,E=/var\(|currentcolor|light-dark\(/i,D=(e,t)=>{let{computed:n,parseContext:r}=t,i=/* @__PURE__ */ new Map;return{resolve:t=>{let a=i.get(t);if(a!=null)return a;let o=t.trim(),s=T.exec(o),c;c=s?.[1]==null?o.toLowerCase()===`currentcolor`?n.color:o:n.getPropertyValue(s[1]).trim();let l;return l=c===``||E.test(c)?y(e,o):r==null||w(r,c)?c:y(e,o),i.set(t,l),l},fontFamily:n.fontFamily||`sans-serif`}},O=(e,t)=>e.resolve(i(t)),k=e=>({grid:e.resolve(c.grid),baseline:e.resolve(c.baseline),tickText:e.resolve(c.tickText),reference:e.resolve(c.reference),surface:e.resolve(c.surface)}),A=e=>`${e.className}|${e.getAttribute(`data-applied-theme`)??``}|${e.getAttribute(`data-theme`)??``}`,j=/* @__PURE__ */ new WeakMap,M=(e,t)=>{let n=j.get(e);if(n==null){let t=/* @__PURE__ */ new Set,r={observer:new MutationObserver(()=>{let n=A(e);if(n!==r.signature){r.signature=n;for(let e of t)e()}}),listeners:t,signature:A(e)};r.observer.observe(e,{attributes:!0,attributeFilter:[`class`,`data-applied-theme`,`data-theme`]}),j.set(e,r),n=r}return n.listeners.add(t),()=>{n.listeners.delete(t),n.listeners.size===0&&(n.observer.disconnect(),j.delete(e))}};var N=class{kind=`canvas`;element;#e;#t;#n=null;#r=!1;#i;constructor({root:e,plot:t,slotName:n,onColorsChange:r}){this.#e=e,this.#t=t;let i=e.ownerDocument.createElement(`canvas`);i.setAttribute(`data-slot`,`${n}-canvas`),i.setAttribute(`aria-hidden`,`true`),i.style.position=`absolute`,i.style.inset=`0`,i.style.width=`100%`,i.style.height=`100%`,this.element=i,this.#i=M(e.ownerDocument.documentElement,r)}#a(){return this.#r||(this.#r=!0,this.#n=this.element.getContext(`2d`)),this.#n}paintSignature(){return A(this.#e.ownerDocument.documentElement)}resolvePaint({series:e,signature:t}){let n=this.#e.ownerDocument.defaultView;if(n==null)return null;let r=D(this.#t,{computed:n.getComputedStyle(this.#e),parseContext:x(this.#e.ownerDocument)}),i=/* @__PURE__ */ new Map,a=/* @__PURE__ */ new Map;for(let t of e)i.set(t.dataKey,O(r,t.colorInput)),a.set(t.dataKey,`${t.colorInput}|${t.texture}`);return{signature:t,series:i,inputs:a,barFills:/* @__PURE__ */ new Map,chrome:k(r),fontFamily:()=>r.fontFamily,resolve:e=>O(r,e)}}measureContext(){return this.#a()}begin({cssWidth:e,cssHeight:t,devicePixelRatio:n}){let r=this.#a();if(r==null)return null;let i=this.element,a=Math.round(e*n),o=Math.round(t*n);return(i.width!==a||i.height!==o)&&(i.width=a,i.height=o),r.setTransform(n,0,0,n,0,0),r.clearRect(0,0,e,t),r}composite(e,t){let{underlay:n,marks:r,fade:i}=t,a=this.#n;if(i==null||a==null){n(),r();return}r(),a.save(),a.globalCompositeOperation=`destination-out`;let o=a.createLinearGradient(i.left,0,i.left+i.width,0);o.addColorStop(0,`rgba(0, 0, 0, ${i.alpha})`),o.addColorStop(1,`rgba(0, 0, 0, 0)`),a.fillStyle=o,a.fillRect(i.left,i.top,i.width,i.height),a.globalCompositeOperation=`destination-over`,n(),a.restore()}end(){}release(){let e=this.element;(e.width!==0||e.height!==0)&&(e.width=0,e.height=0)}destroy(){this.#i()}};const P=Object.assign(e=>new N(e),{kind:`canvas`}),F={Root:e=>{let t=m(5),n=e.zKey!=null,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{n&&p().catch(I)},i=[n],t[0]=n,t[1]=r,t[2]=i),h(r,i);let a;return t[3]===e?a=t[4]:(a=/* @__PURE__ */ g(u,{kind:`scatter`,componentName:`ScatterPlot`,slotName:`scatter-plot`,paintBackend:P,scatterView:f,...e}),t[3]=e,t[4]=a),a},Point:e=>l(`ScatterPlot.Point`,`scatter`,e),Grid:e=>t(`ScatterPlot.Grid`,e),XAxis:e=>n(`ScatterPlot.XAxis`,e),YAxis:e=>a(`ScatterPlot.YAxis`,e),ReferenceLine:e=>s(`ScatterPlot.ReferenceLine`,e),Tooltip:e=>o(`ScatterPlot.Tooltip`,e),Legend:e=>{let t=m(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ g(r,{partName:`ScatterPlot.Legend`,slotName:`scatter-plot`,...e}),t[0]=e,t[1]=n),n},CopyButton:t=>{let n=m(2),r;return n[0]===t?r=n[1]:(r=/* @__PURE__ */ g(e,{partName:`ScatterPlot.CopyButton`,slotName:`scatter-plot`,...t}),n[0]=t,n[1]=r),r},List:e=>{let t=m(2),n;return t[0]===e?n=t[1]:(n=/* @__PURE__ */ g(d,{slotName:`scatter-plot-list`,...e}),t[0]=e,t[1]=n),n}};function I(){}export{F as ScatterPlot};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/forms/segmented-control
|
|
5
5
|
*/
|
|
6
|
-
import { r as RootProps, t as ItemProps } from "./radio-group-
|
|
6
|
+
import { r as RootProps, t as ItemProps } from "./radio-group-BJQ6EOqh.js";
|
|
7
7
|
/**
|
|
8
8
|
* The props of `SegmentedControl.Root`: the same props as `RadioGroup.Root`,
|
|
9
9
|
* including `value`, `defaultValue`, `onChange`, `name`, `form`, and
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./css-properties-D85fCNV3.js";import{
|
|
1
|
+
"use client";import{t as e}from"./css-properties-D85fCNV3.js";import{t}from"./use-composed-refs-DPYmLDSe.js";import{t as n}from"./cx-CK7o_rVv.js";import{t as r}from"./data-slot-EM6s2WEU.js";import{r as i,t as a}from"./radio-group-ggEkCi0V.js";import{t as o}from"./use-swipe-to-dismiss-BYdlca8r.js";import{t as s}from"./use-prefers-reduced-motion-Ck6dnOM9.js";import{c}from"react/compiler-runtime";import{createContext as l,useContext as u,useEffect as d,useId as f,useRef as p}from"react";import m from"tiny-invariant";import{jsx as h}from"react/jsx-runtime";const g=`--_segmented-control-thumb-offset`;function _(e,t){let n=-1,r=1/0;for(let[i,a]of e.entries()){let e=Math.abs((a.left+a.right)/2-t);!a.disabled&&e<r&&(n=i,r=e)}return n}function v({travel:e,min:t,max:n,give:r}){return e<t?t-o(t-e,r):e>n?n+o(e-n,r):e}function y(e){let t=c(3),n,r;t[0]===e?(n=t[1],r=t[2]):(n=()=>{let t=e.current;if(t==null)return;let n=null,r=!1,i=null,a=()=>t.querySelector(`:scope > [role='radio'][aria-checked='true']`),o=()=>Number.parseFloat(getComputedStyle(t,`::before`).translate)||0,c=e=>{i?.cancel(),i=null;let n=a();if(n==null||s())return;let r=e-n.getBoundingClientRect().left;Math.abs(r)<.5||(i=t.animate([{translate:`${r}px 0`},{translate:`0 0`}],{duration:200,easing:`cubic-bezier(0.23, 1, 0.32, 1)`,pseudoElement:`::before`}))},l=(e,n)=>{let r=n.getBoundingClientRect(),i=e.checkedLeft-r.left;e.checked=n,e.checkedLeft=r.left,e.checkedRight=r.right,e.base+=i,e.offset+=i,t.style.setProperty(g,`${e.offset}px`)},u=a(),d=new MutationObserver(()=>{let e=a();if(e===u)return;let t=u;u=e,n?.dragging?e!=null&&l(n,e):(n!=null&&p(),t?.isConnected&&c(t.getBoundingClientRect().left+o()))});d.observe(t,{attributeFilter:[`aria-checked`],subtree:!0});let f=e=>{t.removeAttribute(`data-dragging`),t.style.removeProperty(g);for(let t of e.segments)t.removeAttribute(`data-thumb-over`)},p=()=>{document.removeEventListener(`pointermove`,h),document.removeEventListener(`pointerup`,y),document.removeEventListener(`pointercancel`,y),n=null},m=e=>{if(!e.isPrimary||e.button!==0||n!=null)return;let r=e.target instanceof Element?e.target.closest(`[role='radio']`):null;if(!(r instanceof HTMLElement)||r.parentElement!==t||r.getAttribute(`aria-checked`)!==`true`||r.getAttribute(`aria-disabled`)===`true`)return;let i=Array.from(t.querySelectorAll(`:scope > [role='radio']`)),a=i.map(S),o=Math.min(...a.map(x)),s=Math.max(...a.map(b)),c=r.getBoundingClientRect();n={pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,checked:r,checkedLeft:c.left,checkedRight:c.right,segments:i,boxes:a,trackLeft:o,trackRight:s,give:o-t.getBoundingClientRect().left-t.clientLeft,dragging:!1,base:0,offset:0,lastX:e.clientX,lastTime:e.timeStamp,velocity:0},document.addEventListener(`pointermove`,h),document.addEventListener(`pointerup`,y),document.addEventListener(`pointercancel`,y)},h=e=>{if(n==null||e.pointerId!==n.pointerId)return;if(!(e.buttons&1)){y(e);return}let r=e.clientX-n.startX;if(!n.dragging){let a=Math.abs(e.clientY-n.startY);if(a>=4&&a>Math.abs(r)){p();return}if(Math.abs(r)<4)return;n.dragging=!0,n.base=o(),i?.cancel(),i=null,t.setPointerCapture(e.pointerId),t.setAttribute(`data-dragging`,``)}let a=e.timeStamp-n.lastTime;a>0&&(n.velocity=(e.clientX-n.lastX)/a),n.lastX=e.clientX,n.lastTime=e.timeStamp,n.offset=v({travel:n.base+r,min:n.trackLeft-n.checkedLeft,max:n.trackRight-n.checkedRight,give:n.give}),t.style.setProperty(g,`${n.offset}px`);let s=(n.checkedLeft+n.checkedRight)/2,c=_(n.boxes,s+n.offset);for(let[e,t]of n.segments.entries())t.toggleAttribute(`data-thumb-over`,e===c)},y=e=>{if(n==null||e.pointerId!==n.pointerId)return;let t=n;if(p(),!t.dragging||(f(t),c(t.checkedLeft+t.offset),e.type===`pointercancel`))return;let i=e.timeStamp-t.lastTime>100?0:t.velocity,a=(t.checkedLeft+t.checkedRight)/2+t.offset+i*150,o=t.segments[_(t.boxes,a)];o!=null&&o!==t.checked&&o.click(),r=!0,window.setTimeout(()=>{r=!1},0)},C=e=>{r&&(r=!1,e.preventDefault(),e.stopPropagation())};return t.addEventListener(`pointerdown`,m),t.addEventListener(`click`,C,!0),()=>{d.disconnect(),i?.cancel(),n?.dragging&&f(n),p(),t.removeEventListener(`pointerdown`,m),t.removeEventListener(`click`,C,!0)}},r=[e],t[0]=e,t[1]=n,t[2]=r),d(n,r)}function b(e){return e.right}function x(e){return e.left}function S(e){let t=e.getBoundingClientRect();return{left:t.left,right:t.right,disabled:e.getAttribute(`aria-disabled`)===`true`}}const C=l(!1),w={Item:e=>{let t=c(14),i,o,s,l;t[0]===e?(i=t[1],o=t[2],s=t[3],l=t[4]):({"data-slot":o,className:i,ref:l,...s}=e,t[0]=e,t[1]=i,t[2]=o,t[3]=s,t[4]=l),m(u(C),`SegmentedControl.Item must be rendered inside SegmentedControl.Root.`);let d;t[5]===o?d=t[6]:(d=r(o,`segmented-control-item`),t[5]=o,t[6]=d);let f;t[7]===i?f=t[8]:(f=n(`group/radio [&_label]:cursor-inherit relative flex flex-1 select-none items-center justify-center gap-2 rounded-md px-3 text-sm`,`whitespace-nowrap`,`focus-visible:ring-focus-accent focus-visible:z-1 focus-visible:ring-4`,`cursor-pointer aria-disabled:cursor-default focus:outline-hidden`,`text-muted not-aria-disabled:hover:text-strong aria-disabled:opacity-50`,`not-aria-disabled:hover:bg-white/60 dark:not-aria-disabled:hover:bg-neutral-500/10`,`aria-checked:not-in-data-dragging:text-strong aria-checked:[anchor-name:var(--_segmented-control-thumb)]`,`data-thumb-over:text-strong`,`aria-checked:touch-pan-y`,`not-supports-[anchor-name:--a]:aria-checked:bg-card not-supports-[anchor-name:--a]:aria-checked:shadow-sm dark:not-supports-[anchor-name:--a]:aria-checked:bg-neutral-300`,i),t[7]=i,t[8]=f);let p;return t[9]!==s||t[10]!==l||t[11]!==d||t[12]!==f?(p=/* @__PURE__ */ h(a,{"data-slot":d,className:f,...s,ref:l}),t[9]=s,t[10]=l,t[11]=d,t[12]=f,t[13]=p):p=t[13],p},Root:a=>{let o=c(24),s,l,u,d,m;o[0]===a?(s=o[1],l=o[2],u=o[3],d=o[4],m=o[5]):({"data-slot":l,className:s,ref:d,style:m,...u}=a,o[0]=a,o[1]=s,o[2]=l,o[3]=u,o[4]=d,o[5]=m);let g=f(),_;if(o[6]!==g){let e;o[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=/[^\w-]/g,o[8]=e):e=o[8],_=g.replaceAll(e,``),o[6]=g,o[7]=_}else _=o[7];let v=`--segmented-control-thumb${_}`,b=p(null),x=t(d,b);y(b);let S;o[9]===l?S=o[10]:(S=r(l,`segmented-control`),o[9]=l,o[10]=S);let w;o[11]===s?w=o[12]:(w=n(`bg-neutral-500/10 relative flex h-9 flex-row flex-nowrap gap-px rounded-[0.625rem] p-1`,`before:absolute before:rounded-md before:bg-card before:shadow-sm dark:before:bg-neutral-300`,`before:[position-anchor:var(--_segmented-control-thumb)] before:top-[anchor(top)] before:left-[anchor(left)] before:w-[anchor-size(width)] before:h-[anchor-size(height)]`,`motion-safe:before:transition-[width] motion-safe:before:duration-200 motion-safe:before:ease-out-strong`,`before:translate-x-(--_segmented-control-thumb-offset,0px) data-dragging:cursor-grabbing`,`has-[[aria-checked=true]:not([aria-disabled]):hover]:before:shadow`,s),o[11]=s,o[12]=w);let T;o[13]===v?T=o[14]:(T=e({"--_segmented-control-thumb":v}),o[13]=v,o[14]=T);let E;o[15]!==m||o[16]!==T?(E={...T,...m},o[15]=m,o[16]=T,o[17]=E):E=o[17];let D;return o[18]!==x||o[19]!==u||o[20]!==S||o[21]!==w||o[22]!==E?(D=/* @__PURE__ */ h(C.Provider,{value:!0,children:/* @__PURE__ */ h(i,{"data-slot":S,className:w,style:E,...u,ref:x})}),o[18]=x,o[19]=u,o[20]=S,o[21]=w,o[22]=E,o[23]=D):D=o[23],D}};export{w as SegmentedControl};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./use-composed-refs-DPYmLDSe.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{i as r,s as i}from"./layer-container-DL4yclOu.js";import{t as a}from"./field-Cai_4c1l.js";import{a as o,r as s}from"./field-Bpvn4tQp.js";import{t as c}from"./icon-xb7d9M7X.js";import{n as l}from"./separator-DnvhwY2J.js";import{c as u}from"react/compiler-runtime";import{CaretDownIcon as d}from"@phosphor-icons/react/CaretDown";import{createContext as f,useContext as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{Slottable as g}from"@radix-ui/react-slot";import{CheckIcon as _}from"@phosphor-icons/react/Check";import{CaretUpIcon as v}from"@phosphor-icons/react/CaretUp";import{Content as y,Group as b,Icon as x,Item as S,ItemIndicator as C,ItemText as w,Label as T,Portal as E,Root as D,ScrollDownButton as O,ScrollUpButton as k,Trigger as A,Value as j,Viewport as M}from"@radix-ui/react-select";const N=f({}),P=e=>{let t=u(26),n,r,i,a,o,s,c,l,d;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],d=t[9]):({"aria-invalid":n,children:r,id:i,validation:d,onBlur:a,onValueChange:s,onChange:o,ref:l,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=d);let f;t[10]!==n||t[11]!==i||t[12]!==a||t[13]!==l||t[14]!==d?(f={"aria-invalid":n,id:i,validation:d,onBlur:a,ref:l},t[10]=n,t[11]=i,t[12]=a,t[13]=l,t[14]=d,t[15]=f):f=t[15];let p=f,h;t[16]!==o||t[17]!==s?(h=e=>{o?.(e),s?.(e)},t[16]=o,t[17]=s,t[18]=h):h=t[18];let g;t[19]!==r||t[20]!==p?(g=/* @__PURE__ */ m(N.Provider,{value:p,children:r}),t[19]=r,t[20]=p,t[21]=g):g=t[21];let _;return t[22]!==c||t[23]!==h||t[24]!==g?(_=/* @__PURE__ */ m(D,{...c,onValueChange:h,children:g}),t[22]=c,t[23]=h,t[24]=g,t[25]=_):_=t[25],_},F=e=>{let r=u(14),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({className:i,"data-slot":a,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=n(a,`select-group`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=t(`space-y-px`,i),r[7]=i,r[8]=l);let d;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(d=/* @__PURE__ */ m(b,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=d):d=r[13],d},I=e=>{let t=u(21),r,i,a,o,s,c;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4],s=t[5],c=t[6]):({asChild:r,children:i,"data-slot":a,placeholder:o,ref:c,...s}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c);let l;t[7]===a?l=t[8]:(l=n(a,`select-value`),t[7]=a,t[8]=l);let d;t[9]===o?d=t[10]:(d=o!=null&&/* @__PURE__ */ m(`span`,{"data-slot":`select-placeholder`,className:`contents`,children:o}),t[9]=o,t[10]=d);let f;t[11]!==r||t[12]!==i?(f=r||i==null?i:/* @__PURE__ */ m(`span`,{"data-slot":`select-value-label`,className:`contents`,children:i}),t[11]=r,t[12]=i,t[13]=f):f=t[13];let p;return t[14]!==r||t[15]!==s||t[16]!==c||t[17]!==l||t[18]!==d||t[19]!==f?(p=/* @__PURE__ */ m(j,{ref:c,asChild:r,"data-slot":l,placeholder:d,...s,children:f}),t[14]=r,t[15]=s,t[16]=c,t[17]=l,t[18]=d,t[19]=f,t[20]=p):p=t[20],p},L=r=>{let i=u(36),l,f,_,v,y,b,S,C,w;i[0]===r?(l=i[1],f=i[2],_=i[3],v=i[4],y=i[5],b=i[6],S=i[7],C=i[8],w=i[9]):({"aria-invalid":l,className:_,children:f,"data-slot":v,id:b,onBlur:y,ref:w,validation:S,...C}=r,i[0]=r,i[1]=l,i[2]=f,i[3]=_,i[4]=v,i[5]=y,i[6]=b,i[7]=S,i[8]=C,i[9]=w);let T=p(N),E=p(a),D=e(w,T.ref),O=o(),k=E?E[`aria-invalid`]:T[`aria-invalid`]??l,j=T.validation??S??O,M;i[10]!==k||i[11]!==j?(M=s({"aria-invalid":k,validation:j}),i[10]=k,i[11]=j,i[12]=M):M=i[12];let{ariaInvalid:P,validation:F}=M,I=E?E.id:T.id??b,L;i[13]===v?L=i[14]:(L=n(v,`select-trigger`),i[13]=v,i[14]=L);let R;i[15]===_?R=i[16]:(R=t(`h-9 text-sm`,`border-form bg-form text-strong font-sans placeholder:text-placeholder hover:bg-form-hover hover:text-strong flex w-full items-center justify-between gap-1.5 rounded-md border px-3 py-2 disabled:pointer-events-none disabled:opacity-50`,`[&>[data-slot=select-trigger-label]>span]:line-clamp-1 [&>[data-slot=select-trigger-label]>span]:text-left`,`hover:border-neutral-400`,`focus:outline-hidden focus:ring-4 aria-expanded:ring-4`,`focus:border-accent-600 focus:ring-focus-accent aria-expanded:border-accent-600 aria-expanded:ring-focus-accent`,`data-validation-success:border-success-600 data-validation-success:focus:border-success-600 data-validation-success:focus:ring-focus-success data-validation-success:aria-expanded:border-success-600 data-validation-success:aria-expanded:ring-focus-success`,`data-validation-warning:border-warning-600 data-validation-warning:focus:border-warning-600 data-validation-warning:focus:ring-focus-warning data-validation-warning:aria-expanded:border-warning-600 data-validation-warning:aria-expanded:ring-focus-warning`,`data-validation-error:border-danger-600 data-validation-error:focus:border-danger-600 data-validation-error:focus:ring-focus-danger data-validation-error:aria-expanded:border-danger-600 data-validation-error:aria-expanded:ring-focus-danger motion-safe:data-validation-error:animate-shake`,_),i[15]=_,i[16]=R);let z=F||void 0,B;i[17]!==T||i[18]!==y?(B=e=>{y?.(e),T.onBlur?.(e)},i[17]=T,i[18]=y,i[19]=B):B=i[19];let H;i[20]===E?H=i[21]:(H=E?{"aria-describedby":E[`aria-describedby`],"aria-errormessage":E[`aria-errormessage`]}:void 0,i[20]=E,i[21]=H);let U;i[22]===f?U=i[23]:(U=/* @__PURE__ */ m(g,{child:f,children:V}),i[22]=f,i[23]=U);let W;i[24]===Symbol.for(`react.memo_cache_sentinel`)?(W=/* @__PURE__ */ m(x,{asChild:!0,children:/* @__PURE__ */ m(c,{svg:/* @__PURE__ */ m(d,{weight:`bold`}),className:`size-4`})}),i[24]=W):W=i[24];let G;return i[25]!==P||i[26]!==I||i[27]!==C||i[28]!==L||i[29]!==R||i[30]!==z||i[31]!==B||i[32]!==H||i[33]!==U||i[34]!==D?(G=/* @__PURE__ */ h(A,{"data-slot":L,className:R,"data-validation":z,id:I,ref:D,...C,onBlur:B,...H,"aria-invalid":P,children:[U,W]}),i[25]=P,i[26]=I,i[27]=C,i[28]=L,i[29]=R,i[30]=z,i[31]=B,i[32]=H,i[33]=U,i[34]=D,i[35]=G):G=i[35],G},R=e=>{let n=u(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`flex cursor-default items-center justify-center py-1`,r),n[4]=r,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=/* @__PURE__ */ m(c,{svg:/* @__PURE__ */ m(v,{weight:`bold`}),className:`size-4`}),n[6]=s):s=n[6];let l;return n[7]!==i||n[8]!==a||n[9]!==o?(l=/* @__PURE__ */ m(k,{ref:a,className:o,...i,children:s}),n[7]=i,n[8]=a,n[9]=o,n[10]=l):l=n[10],l},z=e=>{let n=u(11),r,i,a;n[0]===e?(r=n[1],i=n[2],a=n[3]):({className:r,ref:a,...i}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a);let o;n[4]===r?o=n[5]:(o=t(`flex cursor-default items-center justify-center py-1`,r),n[4]=r,n[5]=o);let s;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=/* @__PURE__ */ m(c,{svg:/* @__PURE__ */ m(d,{weight:`bold`}),className:`size-4`}),n[6]=s):s=n[6];let l;return n[7]!==i||n[8]!==a||n[9]!==o?(l=/* @__PURE__ */ m(O,{ref:a,className:o,...i,children:s}),n[7]=i,n[8]=a,n[9]=o,n[10]=l):l=n[10],l},B={Root:P,Content:e=>{let a=u(33),o,s,c,l,d,f,p,g;a[0]===e?(o=a[1],s=a[2],c=a[3],l=a[4],d=a[5],f=a[6],p=a[7],g=a[8]):({className:s,children:o,"data-slot":c,onEscapeKeyDown:l,position:p,ref:f,width:g,...d}=e,a[0]=e,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=d,a[6]=f,a[7]=p,a[8]=g);let _=p===void 0?`popper`:p,v=g===void 0?`trigger`:g,b=i(),x=r(l),S;a[9]===c?S=a[10]:(S=n(c,`select-content`),a[9]=c,a[10]=S);let C=_===`popper`&&`data-side-bottom:translate-y-2 data-side-left:-translate-x-2 data-side-right:translate-x-2 data-side-top:-translate-y-2 max-h-(--radix-select-content-available-height)`,w=v===`trigger`&&`w-(--radix-select-trigger-width)`,T;a[11]!==s||a[12]!==C||a[13]!==w?(T=t(`border-popover data-side-bottom:slide-in-from-top-1 data-side-left:slide-in-from-right-1 data-side-right:slide-in-from-left-1 data-side-top:slide-in-from-bottom-1 data-side-bottom:slide-out-to-top-1 data-side-left:slide-out-to-right-1 data-side-right:slide-out-to-left-1 data-side-top:slide-out-to-bottom-1 duration-200 ease-out-strong data-state-closed:duration-150 data-state-closed:animate-out data-state-closed:fade-out-0 data-state-closed:zoom-out-95 data-state-open:animate-in data-state-open:fade-in-0 data-state-open:zoom-in-95 motion-reduce:animate-none! relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border shadow-md`,`bg-popover font-sans`,C,w,s),a[11]=s,a[12]=C,a[13]=w,a[14]=T):T=a[14];let D;a[15]===Symbol.for(`react.memo_cache_sentinel`)?(D=/* @__PURE__ */ m(R,{}),a[15]=D):D=a[15];let O=_===`popper`&&`h-(--radix-select-trigger-height) w-full`,k;a[16]===O?k=a[17]:(k=t(`p-1 space-y-px`,O),a[16]=O,a[17]=k);let A;a[18]!==o||a[19]!==k?(A=/* @__PURE__ */ m(M,{className:k,children:o}),a[18]=o,a[19]=k,a[20]=A):A=a[20];let j;a[21]===Symbol.for(`react.memo_cache_sentinel`)?(j=/* @__PURE__ */ m(z,{}),a[21]=j):j=a[21];let N;a[22]!==x||a[23]!==_||a[24]!==d||a[25]!==f||a[26]!==A||a[27]!==S||a[28]!==T?(N=/* @__PURE__ */ h(y,{ref:f,"data-slot":S,className:T,onEscapeKeyDown:x,position:_,...d,children:[D,A,j]}),a[22]=x,a[23]=_,a[24]=d,a[25]=f,a[26]=A,a[27]=S,a[28]=T,a[29]=N):N=a[29];let P;return a[30]!==b||a[31]!==N?(P=/* @__PURE__ */ m(E,{container:b,children:N}),a[30]=b,a[31]=N,a[32]=P):P=a[32],P},Group:F,Item:e=>{let r=u(28),i,a,o,s,l,d,f;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],l=r[5],d=r[6],f=r[7]):({className:a,children:i,"data-slot":o,icon:s,ref:d,translate:f,...l}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r[6]=d,r[7]=f);let p;r[8]===o?p=r[9]:(p=n(o,`select-item`),r[8]=o,r[9]=p);let v;r[10]===a?v=r[11]:(v=t(`relative flex gap-2 w-full cursor-pointer select-none items-center rounded-md py-1.5 pl-2 pr-8 text-strong text-sm outline-hidden`,`focus:bg-active-menu-item`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`data-state-checked:bg-selected-menu-item`,`focus:data-state-checked:bg-active-selected-menu-item`,a),r[10]=a,r[11]=v);let y;r[12]===s?y=r[13]:(y=s&&/* @__PURE__ */ m(c,{svg:s}),r[12]=s,r[13]=y);let b;r[14]===f?b=r[15]:(b=e=>/* @__PURE__ */ m(w,{children:/* @__PURE__ */ m(`span`,{"data-slot":`select-item-label`,className:`contents`,translate:f,children:e})}),r[14]=f,r[15]=b);let x;r[16]!==i||r[17]!==b?(x=/* @__PURE__ */ m(g,{child:i,children:b}),r[16]=i,r[17]=b,r[18]=x):x=r[18];let T;r[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=/* @__PURE__ */ m(C,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:/* @__PURE__ */ m(c,{svg:/* @__PURE__ */ m(_,{weight:`bold`}),className:`size-4 text-accent-600`})}),r[19]=T):T=r[19];let E;return r[20]!==l||r[21]!==d||r[22]!==p||r[23]!==v||r[24]!==y||r[25]!==x||r[26]!==f?(E=/* @__PURE__ */ h(S,{ref:d,"data-slot":p,translate:f,className:v,...l,children:[y,x,T]}),r[20]=l,r[21]=d,r[22]=p,r[23]=v,r[24]=y,r[25]=x,r[26]=f,r[27]=E):E=r[27],E},Label:e=>{let r=u(14),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({className:i,"data-slot":a,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=n(a,`select-label`),r[5]=a,r[6]=c);let l;r[7]===i?l=r[8]:(l=t(`px-2 py-1.5 text-sm font-medium`,i),r[7]=i,r[8]=l);let d;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l?(d=/* @__PURE__ */ m(T,{ref:s,"data-slot":c,className:l,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=d):d=r[13],d},Separator:e=>{let r=u(14),i,a,o,s;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4]):({className:i,"data-slot":a,ref:s,...o}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c;r[5]===a?c=r[6]:(c=n(a,`select-separator`),r[5]=a,r[6]=c);let d;r[7]===i?d=r[8]:(d=t(`-mx-1 my-1 h-px w-auto`,i),r[7]=i,r[8]=d);let f;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==d?(f=/* @__PURE__ */ m(l,{ref:s,"data-slot":c,className:d,...o}),r[9]=o,r[10]=s,r[11]=c,r[12]=d,r[13]=f):f=r[13],f},Trigger:L,Value:I};function V(e){return/* @__PURE__ */ m(`span`,{"data-slot":`select-trigger-label`,className:`contents`,children:e})}export{B as t};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
1
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
2
2
|
import { o as WithValidation } from "./field-BshcNVe_.js";
|
|
3
|
-
import { n as Separator } from "./separator-
|
|
3
|
+
import { n as Separator } from "./separator-Ck4sPrdN.js";
|
|
4
4
|
import { ComponentProps, FocusEvent, PropsWithChildren, ReactNode, Ref, SelectHTMLAttributes } from "react";
|
|
5
5
|
import { Content as Content$1, Group as Group$1, Item as Item$1, Label as Label$1, Trigger as Trigger$1, Value as Value$1 } from "@radix-ui/react-select";
|
|
6
6
|
type WithAriaInvalid = Pick<SelectHTMLAttributes<HTMLSelectElement>, "aria-invalid">;
|
|
@@ -77,7 +77,7 @@ type SelectProps = PropsWithChildren & {
|
|
|
77
77
|
value?: string;
|
|
78
78
|
} & WithValidation & WithAriaInvalid;
|
|
79
79
|
/**
|
|
80
|
-
* Displays a list of options for the user to pick from
|
|
80
|
+
* Displays a list of options for the user to pick from, triggered by a button.
|
|
81
81
|
*
|
|
82
82
|
* Use Select for a small, finite list of options (~2-15) where the user picks exactly one
|
|
83
83
|
* and search/filtering is unnecessary. For larger lists or async/searchable data, use
|
|
@@ -332,7 +332,7 @@ type SelectContentProps = Omit<ComponentProps<typeof Content$1>, "asChild"> & Wi
|
|
|
332
332
|
* </Select.Root>
|
|
333
333
|
* ```
|
|
334
334
|
*/
|
|
335
|
-
declare const Content: ({ className, children, "data-slot": dataSlot, position, ref, width, ...props }: SelectContentProps) => import("react").JSX.Element;
|
|
335
|
+
declare const Content: ({ className, children, "data-slot": dataSlot, onEscapeKeyDown, position, ref, width, ...props }: SelectContentProps) => import("react").JSX.Element;
|
|
336
336
|
/**
|
|
337
337
|
* Used to render the label of a group. It won't be focusable using arrow keys.
|
|
338
338
|
*
|
|
@@ -465,7 +465,7 @@ declare const Item: ({ className, children, "data-slot": dataSlot, icon, ref, tr
|
|
|
465
465
|
*/
|
|
466
466
|
declare const SelectSeparatorComponent: ({ className, "data-slot": dataSlot, ref, ...props }: ComponentProps<typeof Separator> & WithDataSlot) => import("react").JSX.Element;
|
|
467
467
|
/**
|
|
468
|
-
* Displays a list of options for the user to pick from
|
|
468
|
+
* Displays a list of options for the user to pick from, triggered by a button.
|
|
469
469
|
*
|
|
470
470
|
* Use Select for a small, finite list of options (~2-15) where the user picks exactly one
|
|
471
471
|
* and search/filtering is unnecessary. For larger lists or async/searchable data, use
|
|
@@ -526,7 +526,7 @@ declare const SelectSeparatorComponent: ({ className, "data-slot": dataSlot, ref
|
|
|
526
526
|
*/
|
|
527
527
|
declare const Select: {
|
|
528
528
|
/**
|
|
529
|
-
* Displays a list of options for the user to pick from
|
|
529
|
+
* Displays a list of options for the user to pick from, triggered by a button.
|
|
530
530
|
*
|
|
531
531
|
* Use Select for a small, finite list of options (~2-15) where the user picks exactly one
|
|
532
532
|
* and search/filtering is unnecessary. For larger lists or async/searchable data, use
|
package/dist/select.d.ts
CHANGED
package/dist/select.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as Select}from"./select-
|
|
1
|
+
export{t as Select}from"./select-1xuUx_os.js";
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
5
5
|
*/
|
|
6
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
7
|
-
import { t as Choice } from "./choice-
|
|
8
|
-
import { t as Input } from "./input-
|
|
6
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
7
|
+
import { t as Choice } from "./choice-CNiOSzqV.js";
|
|
8
|
+
import { t as Input } from "./input-DC4nW0Sr.js";
|
|
9
9
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
10
10
|
/**
|
|
11
11
|
* A single selectable row in a {@link SelectableList}. The list is data-driven:
|
|
12
12
|
* map your domain objects into these options once, and the list owns filtering,
|
|
13
|
-
* selection, and (optionally) virtualization. Item *rendering* stays composable
|
|
13
|
+
* selection, and (optionally) virtualization. Item *rendering* stays composable:
|
|
14
14
|
* pass a render-prop child to a viewport to draw your own layout.
|
|
15
15
|
*
|
|
16
16
|
* A `label` may be any ReactNode; when it isn't a plain string, `labelText` is
|
|
@@ -50,8 +50,8 @@ type SelectableListOption = {
|
|
|
50
50
|
disabled?: boolean;
|
|
51
51
|
} & ({
|
|
52
52
|
/**
|
|
53
|
-
* Plain-text title
|
|
54
|
-
* `<label
|
|
53
|
+
* Plain-text title. The default row renders it, and as the checkbox's
|
|
54
|
+
* `<label>` it is the accessible name. The default filter also matches it
|
|
55
55
|
* (override that with `labelText`).
|
|
56
56
|
*/
|
|
57
57
|
label: string;
|
|
@@ -59,7 +59,7 @@ type SelectableListOption = {
|
|
|
59
59
|
labelText?: string;
|
|
60
60
|
} | {
|
|
61
61
|
/**
|
|
62
|
-
* A rich title (any ReactNode). Keep readable text inside
|
|
62
|
+
* A rich title (any ReactNode). Keep readable text inside: the rendered
|
|
63
63
|
* content is the checkbox's accessible name.
|
|
64
64
|
*/
|
|
65
65
|
label: ReactNode;
|
|
@@ -85,7 +85,7 @@ declare function optionLabelText(option: SelectableListOption): string;
|
|
|
85
85
|
* Case-insensitive substring filter over each option's plain text (see
|
|
86
86
|
* {@link optionLabelText}: `labelText`, or a string `label`). Returns the input
|
|
87
87
|
* untouched for an empty/whitespace query so the common "no filter" path does no
|
|
88
|
-
* work. Pure
|
|
88
|
+
* work. Pure, so it is safe to unit test and to call from `useMemo`.
|
|
89
89
|
*
|
|
90
90
|
* @example
|
|
91
91
|
* ```ts
|
|
@@ -196,8 +196,8 @@ declare const Root: ({ "data-slot": dataSlot, className, defaultQuery, defaultVa
|
|
|
196
196
|
/**
|
|
197
197
|
* The filter/search box for a `SelectableList`. Renders the mantle `Input` with
|
|
198
198
|
* a leading magnifying-glass icon and drives the list's filter query (a
|
|
199
|
-
* case-insensitive substring match over each option's plain text
|
|
200
|
-
* or a string `label`). Optional
|
|
199
|
+
* case-insensitive substring match over each option's plain text: `labelText`,
|
|
200
|
+
* or a string `label`). Optional: omit it for a non-filterable list.
|
|
201
201
|
*
|
|
202
202
|
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
203
203
|
*
|
|
@@ -214,8 +214,8 @@ declare const Root: ({ "data-slot": dataSlot, className, defaultQuery, defaultVa
|
|
|
214
214
|
declare const Filter: ({ "data-slot": dataSlot, "aria-label": ariaLabel, ref, ...props }: Omit<ComponentProps<typeof Input>, "value" | "defaultValue" | "onChange" | "type" | "children"> & WithDataSlot) => import("react").JSX.Element;
|
|
215
215
|
/**
|
|
216
216
|
* A tri-state "select all" header for a `SelectableList`. Reflects the selection
|
|
217
|
-
* of the **currently filtered** options
|
|
218
|
-
* indeterminate when only some are, unchecked when none are
|
|
217
|
+
* of the **currently filtered** options (checked when all are selected,
|
|
218
|
+
* indeterminate when only some are, unchecked when none are), and toggling it
|
|
219
219
|
* selects or clears that filtered set. Optional. Children are the visible label.
|
|
220
220
|
*
|
|
221
221
|
* **Structure.** `children` render inside a
|
|
@@ -263,7 +263,7 @@ type SelectableListItemProps = Omit<ComponentProps<"div">, "children" | "id"> &
|
|
|
263
263
|
/** The option's selection value. Selection state is read from, and toggled in, the list. */
|
|
264
264
|
value: string;
|
|
265
265
|
/**
|
|
266
|
-
* Item content
|
|
266
|
+
* Item content, typically `SelectableList.ItemTitle` over a
|
|
267
267
|
* `SelectableList.ItemDescription`, or any layout you like. It fills the row's
|
|
268
268
|
* content `gridcell`; nested interactive content (links, buttons) is allowed.
|
|
269
269
|
*/
|
|
@@ -302,7 +302,7 @@ type SelectableListItemProps = Omit<ComponentProps<"div">, "children" | "id"> &
|
|
|
302
302
|
*/
|
|
303
303
|
declare const Item: ({ "data-slot": dataSlot, children, className, ref, value, ...props }: SelectableListItemProps) => import("react").JSX.Element;
|
|
304
304
|
/**
|
|
305
|
-
* The emphasized title of a `SelectableList.Item`, rendered as `Choice.Label
|
|
305
|
+
* The emphasized title of a `SelectableList.Item`, rendered as `Choice.Label`:
|
|
306
306
|
* a real `<label>` wired to the row's checkbox, so clicking it toggles the row
|
|
307
307
|
* and it supplies the checkbox's accessible name.
|
|
308
308
|
*
|
|
@@ -395,7 +395,7 @@ type SelectableListViewportProps = Omit<ComponentProps<"div">, "children"> & {
|
|
|
395
395
|
*/
|
|
396
396
|
declare const Viewport: ({ "data-slot": dataSlot, children, ref, ...props }: SelectableListViewportProps) => import("react").JSX.Element | null;
|
|
397
397
|
/**
|
|
398
|
-
* Props for `SelectableList.VirtualViewport
|
|
398
|
+
* Props for `SelectableList.VirtualViewport`: the `Viewport` props plus the
|
|
399
399
|
* virtualizer knobs.
|
|
400
400
|
*
|
|
401
401
|
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
@@ -467,16 +467,16 @@ declare const VirtualViewport: ({ "data-slot": dataSlot, children, ref, ...props
|
|
|
467
467
|
*/
|
|
468
468
|
declare const Empty: ({ "data-slot": dataSlot, children, className, ref, ...props }: ComponentProps<"div"> & WithDataSlot) => import("react").JSX.Element;
|
|
469
469
|
/**
|
|
470
|
-
* A filterable, multi-select **grid** of checkbox rows
|
|
470
|
+
* A filterable, multi-select **grid** of checkbox rows, the inline
|
|
471
471
|
* (non-popover) counterpart to `MultiSelect`/`Combobox`. Map your data into
|
|
472
472
|
* `options` once; the list owns filtering, selection, and (optionally)
|
|
473
473
|
* virtualization. Each row is an APG grid `role="row"` (`aria-selected`) whose
|
|
474
|
-
* cells hold a real `Checkbox` and a `Choice`-laid-out title + description
|
|
474
|
+
* cells hold a real `Checkbox` and a `Choice`-laid-out title + description. This is the
|
|
475
475
|
* pattern that lets a selectable row carry a real control and nested interactive
|
|
476
476
|
* content. Non-virtualized by default; swap `Viewport` → `VirtualViewport` (same
|
|
477
477
|
* props) for windowing. Built on the shared `list` primitive.
|
|
478
478
|
*
|
|
479
|
-
* Keyboard: the grid is a single tab stop
|
|
479
|
+
* Keyboard: the grid is a single tab stop: `Arrow`/`Home`/`End` move an active
|
|
480
480
|
* row (tracked via `aria-activedescendant`, so navigation works across the full
|
|
481
481
|
* option set even when virtualized) and `Space`/`Enter` toggles it.
|
|
482
482
|
*
|
package/dist/selectable-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-callback-ref-BvVyI5K1.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{n as r,t as i}from"./checkbox-CS504fKk.js";import{t as a}from"./choice-uyYccm0A.js";import{n as o,t as s}from"./input-DHovzBjS.js";import{n as c,r as l,t as u}from"./list-CO_yLdln.js";import{c as d}from"react/compiler-runtime";import{cloneElement as f,createContext as p,isValidElement as m,useContext as h,useId as g,useState as _}from"react";import v from"tiny-invariant";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{MagnifyingGlassIcon as x}from"@phosphor-icons/react/MagnifyingGlass";function S(e){return e.labelText==null?typeof e.label==`string`?e.label:``:e.labelText}function C(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>S(e).toLowerCase().includes(n))}function w(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function T(e,t){let n=0,r=0;for(let i of e)i.disabled||(n+=1,t.has(i.value)&&(r+=1));return n===0?{allSelected:!1,someSelected:!1}:{allSelected:r===n,someSelected:r>0}}const E=p(null);function D(e){let t=h(E);return v(t,`SelectableList.${e} must be rendered inside SelectableList.Root.`),t}const O=[],k=r=>{let i=d(53),a,o,s,c,l,u,f,p,m,h,v,b;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],f=i[7],p=i[8],m=i[9],h=i[10],v=i[11],b=i[12]):({"data-slot":o,className:a,defaultQuery:s,defaultValue:c,filter:l,onQueryChange:u,onValueChange:f,options:p,query:h,ref:v,value:b,...m}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=f,i[8]=p,i[9]=m,i[10]=h,i[11]=v,i[12]=b);let x=g(),S=b!=null,[T,D]=_(c??O),k=S?b:T,A=h!=null,[j,M]=_(s??``),N=A?h:j,P=e(f),F=e(u),I;i[13]!==S||i[14]!==P?(I=e=>{S||D(e),P(e)},i[13]=S,i[14]=P,i[15]=I):I=i[15];let L=I,R;i[16]!==A||i[17]!==F?(R=e=>{A||M(e),F(e)},i[16]=A,i[17]=F,i[18]=R):R=i[18];let z=R,V;i[19]===k?V=i[20]:(V=new Set(k),i[19]=k,i[20]=V);let H=V,U;i[21]===p?U=i[22]:(U=new Set(p.filter(B).map(ee)),i[21]=p,i[22]=U);let W=U,G;i[23]!==l||i[24]!==p||i[25]!==N?(G=l==null?C(p,N):p.filter(e=>l(e,N)),i[23]=l,i[24]=p,i[25]=N,i[26]=G):G=i[26];let K=G,q;i[27]!==L||i[28]!==W||i[29]!==k?(q=e=>{W.has(e)||L(w(k,e))},i[27]=L,i[28]=W,i[29]=k,i[30]=q):q=i[30];let J;i[31]!==L||i[32]!==W||i[33]!==K||i[34]!==x||i[35]!==N||i[36]!==H||i[37]!==k||i[38]!==z||i[39]!==q?(J={listId:x,filteredOptions:K,query:N,setQuery:z,selectedValues:k,selectedSet:H,disabledSet:W,toggle:q,setSelection:L},i[31]=L,i[32]=W,i[33]=K,i[34]=x,i[35]=N,i[36]=H,i[37]=k,i[38]=z,i[39]=q,i[40]=J):J=i[40];let Y=J,X;i[41]===o?X=i[42]:(X=n(o,`selectable-list`),i[41]=o,i[42]=X);let Z;i[43]===a?Z=i[44]:(Z=t(`flex w-full flex-col gap-3`,a),i[43]=a,i[44]=Z);let Q;i[45]!==m||i[46]!==v||i[47]!==X||i[48]!==Z?(Q=/* @__PURE__ */ y(`div`,{ref:v,"data-slot":X,className:Z,...m}),i[45]=m,i[46]=v,i[47]=X,i[48]=Z,i[49]=Q):Q=i[49];let $;return i[50]!==Y||i[51]!==Q?($=/* @__PURE__ */ y(E.Provider,{value:Y,children:Q}),i[50]=Y,i[51]=Q,i[52]=$):$=i[52],$},A=e=>{let t=d(18),r,i,a,c;t[0]===e?(r=t[1],i=t[2],a=t[3],c=t[4]):({"data-slot":r,"aria-label":c,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=c);let l=c===void 0?`Filter`:c,{query:u,setQuery:f}=D(`Filter`),p;t[5]===r?p=t[6]:(p=n(r,`selectable-list-filter`),t[5]=r,t[6]=p);let m;t[7]===f?m=t[8]:(m=e=>f(e.target.value),t[7]=f,t[8]=m);let h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=/* @__PURE__ */ y(x,{"aria-hidden":!0}),g=/* @__PURE__ */ y(o,{}),t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;return t[11]!==l||t[12]!==i||t[13]!==u||t[14]!==a||t[15]!==p||t[16]!==m?(_=/* @__PURE__ */ b(s,{ref:a,type:`text`,"data-slot":p,"aria-label":l,value:u,onChange:m,...i,children:[h,g]}),t[11]=l,t[12]=i,t[13]=u,t[14]=a,t[15]=p,t[16]=m,t[17]=_):_=t[17],_},j=e=>{let a=d(36),o,s,c,l,u;a[0]===e?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5]):({"data-slot":c,children:o,className:s,ref:u,...l}=e,a[0]=e,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u);let{filteredOptions:f,selectedValues:p,selectedSet:m,setSelection:h}=D(`SelectAll`),_=g(),v,x;if(a[6]!==f||a[7]!==m){let{allSelected:e,someSelected:t}=T(f,m);v=e,x=r({allSelected:v,someSelected:t}),a[6]=f,a[7]=m,a[8]=v,a[9]=x}else v=a[8],x=a[9];let S=x,C;a[10]===f?C=a[11]:(C=f.some(V),a[10]=f,a[11]=C);let w=C,E;a[12]!==v||a[13]!==f||a[14]!==p||a[15]!==h?(E=()=>{let e=f.filter(H).map(U);if(v){let t=new Set(e);h(p.filter(e=>!t.has(e)))}else h([.../* @__PURE__ */ new Set([...p,...e])])},a[12]=v,a[13]=f,a[14]=p,a[15]=h,a[16]=E):E=a[16];let O=E,k;a[17]===c?k=a[18]:(k=n(c,`selectable-list-select-all`),a[17]=c,a[18]=k);let A;a[19]===s?A=a[20]:(A=t(`text-strong flex cursor-pointer items-center gap-2 text-sm font-medium font-sans`,s),a[19]=s,a[20]=A);let j=!w,M;a[21]!==S||a[22]!==_||a[23]!==O||a[24]!==j?(M=/* @__PURE__ */ y(i,{id:_,checked:S,onChange:O,disabled:j}),a[21]=S,a[22]=_,a[23]=O,a[24]=j,a[25]=M):M=a[25];let N;a[26]===o?N=a[27]:(N=/* @__PURE__ */ y(`span`,{"data-slot":`selectable-list-select-all-label`,className:`contents`,children:o}),a[26]=o,a[27]=N);let P;return a[28]!==_||a[29]!==l||a[30]!==u||a[31]!==k||a[32]!==A||a[33]!==M||a[34]!==N?(P=/* @__PURE__ */ b(`label`,{ref:u,htmlFor:_,"data-slot":k,className:A,...l,children:[M,N]}),a[28]=_,a[29]=l,a[30]=u,a[31]=k,a[32]=A,a[33]=M,a[34]=N,a[35]=P):P=a[35],P};function M(e,t){return`${e}-control-${encodeURIComponent(t)}`}const N=e=>{let r=d(42),o,s,l,u,f,p;r[0]===e?(o=r[1],s=r[2],l=r[3],u=r[4],f=r[5],p=r[6]):({"data-slot":l,children:o,className:s,ref:f,value:p,...u}=e,r[0]=e,r[1]=o,r[2]=s,r[3]=l,r[4]=u,r[5]=f,r[6]=p);let{listId:m,selectedSet:h,disabledSet:g,toggle:_}=D(`Item`),v;r[7]!==m||r[8]!==p?(v=M(m,p),r[7]=m,r[8]=p,r[9]=v):v=r[9];let x=v,S;r[10]!==h||r[11]!==p?(S=h.has(p),r[10]=h,r[11]=p,r[12]=S):S=r[12];let C=S,w;r[13]!==g||r[14]!==p?(w=g.has(p),r[13]=g,r[14]=p,r[15]=w):w=r[15];let T=w,E;r[16]===s?E=r[17]:(E=t(`px-2 py-1.5 text-sm`,`cursor-pointer aria-disabled:cursor-default`,s),r[16]=s,r[17]=E);let O;r[18]===l?O=r[19]:(O=n(l,`selectable-list-item`),r[18]=l,r[19]=O);let k;r[20]!==_||r[21]!==p?(k=()=>_(p),r[20]=_,r[21]=p,r[22]=k):k=r[22];let A;r[23]!==C||r[24]!==k?(A=/* @__PURE__ */ y(a.Indicator,{role:`gridcell`,children:/* @__PURE__ */ y(i,{checked:C,onChange:k,tabIndex:-1})}),r[23]=C,r[24]=k,r[25]=A):A=r[25];let j;r[26]===o?j=r[27]:(j=/* @__PURE__ */ y(a.Content,{role:`gridcell`,children:o}),r[26]=o,r[27]=j);let N;r[28]!==x||r[29]!==T||r[30]!==A||r[31]!==j?(N=/* @__PURE__ */ b(a.Root,{id:x,disabled:T,children:[A,j]}),r[28]=x,r[29]=T,r[30]=A,r[31]=j,r[32]=N):N=r[32];let P;return r[33]!==T||r[34]!==u||r[35]!==f||r[36]!==C||r[37]!==E||r[38]!==O||r[39]!==N||r[40]!==p?(P=/* @__PURE__ */ y(c,{ref:f,asChild:!0,selected:C,disabled:T,className:E,...u,"data-slot":O,"data-value":p,children:N}),r[33]=T,r[34]=u,r[35]=f,r[36]=C,r[37]=E,r[38]=O,r[39]=N,r[40]=p,r[41]=P):P=r[41],P},P=e=>{let t=d(8),r,i;t[0]===e?(r=t[1],i=t[2]):({"data-slot":r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let o;t[3]===r?o=t[4]:(o=n(r,`selectable-list-item-title`),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=/* @__PURE__ */ y(a.Label,{"data-slot":o,...i}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s},F=e=>{let t=d(8),r,i;t[0]===e?(r=t[1],i=t[2]):({"data-slot":r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let o;t[3]===r?o=t[4]:(o=n(r,`selectable-list-item-description`),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=/* @__PURE__ */ y(a.Description,{"data-slot":o,...i}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s};function I(e){return/* @__PURE__ */ b(N,{value:e.value,children:[/* @__PURE__ */ y(P,{children:e.label}),e.description!=null&&/* @__PURE__ */ y(F,{children:e.description})]})}function L(e,t){let n=[],r=[];for(let i of e){let e=t(i);m(e)&&(n.push(f(e,{key:i.value})),r.push(i))}return{items:n,options:r}}function R(e,t){let n=d(17),{filteredOptions:r,listId:i,toggle:a}=D(e),o=t??I,s;n[0]!==r||n[1]!==o?(s=L(r,o),n[0]=r,n[1]=o,n[2]=s):s=n[2];let{items:c,options:l}=s,u;n[3]!==l||n[4]!==a?(u=e=>{let t=l[e];t!=null&&a(t.value)},n[3]=l,n[4]=a,n[5]=u):u=n[5];let f=u,p;n[6]!==l||n[7]!==i?(p=e=>{let t=l[e];return t==null?``:M(i,t.value)},n[6]=l,n[7]=i,n[8]=p):p=n[8];let m=p,h;n[9]===l?h=n[10]:(h=e=>l[e]?.disabled===!0,n[9]=l,n[10]=h);let g=h,_=c.length===0,v;return n[11]!==g||n[12]!==m||n[13]!==c||n[14]!==f||n[15]!==_?(v={isEmpty:_,isItemDisabled:g,onActivate:f,itemId:m,items:c},n[11]=g,n[12]=m,n[13]=c,n[14]=f,n[15]=_,n[16]=v):v=n[16],v}const z={Root:k,Filter:A,SelectAll:j,Viewport:e=>{let t=d(15),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({"data-slot":i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let{isEmpty:s,isItemDisabled:c,onActivate:u,itemId:f,items:p}=R(`Viewport`,r);if(s)return null;let m;t[5]===i?m=t[6]:(m=n(i,`selectable-list-viewport`),t[5]=i,t[6]=m);let h;return t[7]!==c||t[8]!==f||t[9]!==p||t[10]!==u||t[11]!==a||t[12]!==o||t[13]!==m?(h=/* @__PURE__ */ y(l,{ref:o,"data-slot":m,semantics:`grid`,...a,"aria-multiselectable":!0,isItemDisabled:c,onActivate:u,itemId:f,children:p}),t[7]=c,t[8]=f,t[9]=p,t[10]=u,t[11]=a,t[12]=o,t[13]=m,t[14]=h):h=t[14],h},VirtualViewport:e=>{let t=d(15),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({"data-slot":i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let{isEmpty:s,isItemDisabled:c,onActivate:l,itemId:f,items:p}=R(`VirtualViewport`,r);if(s)return null;let m;t[5]===i?m=t[6]:(m=n(i,`selectable-list-viewport`),t[5]=i,t[6]=m);let h;return t[7]!==c||t[8]!==f||t[9]!==p||t[10]!==l||t[11]!==a||t[12]!==o||t[13]!==m?(h=/* @__PURE__ */ y(u,{ref:o,"data-slot":m,semantics:`grid`,...a,"aria-multiselectable":!0,isItemDisabled:c,onActivate:l,itemId:f,children:p}),t[7]=c,t[8]=f,t[9]=p,t[10]=l,t[11]=a,t[12]=o,t[13]=m,t[14]=h):h=t[14],h},Item:N,ItemTitle:P,ItemDescription:F,Empty:e=>{let r=d(21),i,a,o,s,c;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({"data-slot":o,children:i,className:a,ref:c,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c);let{filteredOptions:l}=D(`Empty`),u=l.length===0,f;r[6]===o?f=r[7]:(f=n(o,`selectable-list-empty`),r[6]=o,r[7]=f);let p=!u&&`sr-only`,m=u&&`text-muted border-popover bg-popover flex items-center justify-center rounded-md border px-3 py-8 text-center text-sm`,h;r[8]!==a||r[9]!==p||r[10]!==m?(h=t(p,m,a),r[8]=a,r[9]=p,r[10]=m,r[11]=h):h=r[11];let g;r[12]!==i||r[13]!==u?(g=u&&/* @__PURE__ */ y(`span`,{"data-slot":`selectable-list-empty-label`,className:`contents`,children:i}),r[12]=i,r[13]=u,r[14]=g):g=r[14];let _;return r[15]!==s||r[16]!==c||r[17]!==f||r[18]!==h||r[19]!==g?(_=/* @__PURE__ */ y(`div`,{ref:c,"data-slot":f,role:`status`,className:h,...s,children:g}),r[15]=s,r[16]=c,r[17]=f,r[18]=h,r[19]=g,r[20]=_):_=r[20],_}};function B(e){return e.disabled}function ee(e){return e.value}function V(e){return!e.disabled}function H(e){return!e.disabled}function U(e){return e.value}export{z as SelectableList,C as filterSelectableOptions,S as optionLabelText,T as summarizeSelection,w as toggleSelectionValue};
|
|
1
|
+
"use client";import{t as e}from"./use-callback-ref-DiOXFQzM.js";import{t}from"./cx-CK7o_rVv.js";import{t as n}from"./data-slot-EM6s2WEU.js";import{n as r,t as i}from"./checkbox-Cu5cgZmk.js";import{t as a}from"./choice-CCVG2hb9.js";import{n as o,t as s}from"./input-fW8QSZEO.js";import{n as c,r as l,t as u}from"./list-cQZPSjfz.js";import{c as d}from"react/compiler-runtime";import{cloneElement as f,createContext as p,isValidElement as m,useContext as h,useId as g,useState as _}from"react";import v from"tiny-invariant";import{jsx as y,jsxs as b}from"react/jsx-runtime";import{MagnifyingGlassIcon as x}from"@phosphor-icons/react/MagnifyingGlass";function S(e){return e.labelText==null?typeof e.label==`string`?e.label:``:e.labelText}function C(e,t){let n=t.trim().toLowerCase();return n===``?e:e.filter(e=>S(e).toLowerCase().includes(n))}function w(e,t){return e.includes(t)?e.filter(e=>e!==t):[...e,t]}function T(e,t){let n=0,r=0;for(let i of e)i.disabled||(n+=1,t.has(i.value)&&(r+=1));return n===0?{allSelected:!1,someSelected:!1}:{allSelected:r===n,someSelected:r>0}}const E=p(null);function D(e){let t=h(E);return v(t,`SelectableList.${e} must be rendered inside SelectableList.Root.`),t}const O=[],k=r=>{let i=d(53),a,o,s,c,l,u,f,p,m,h,v,b;i[0]===r?(a=i[1],o=i[2],s=i[3],c=i[4],l=i[5],u=i[6],f=i[7],p=i[8],m=i[9],h=i[10],v=i[11],b=i[12]):({"data-slot":o,className:a,defaultQuery:s,defaultValue:c,filter:l,onQueryChange:u,onValueChange:f,options:p,query:h,ref:v,value:b,...m}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=c,i[5]=l,i[6]=u,i[7]=f,i[8]=p,i[9]=m,i[10]=h,i[11]=v,i[12]=b);let x=g(),S=b!=null,[T,D]=_(c??O),k=S?b:T,A=h!=null,[j,M]=_(s??``),N=A?h:j,P=e(f),F=e(u),I;i[13]!==S||i[14]!==P?(I=e=>{S||D(e),P(e)},i[13]=S,i[14]=P,i[15]=I):I=i[15];let L=I,R;i[16]!==A||i[17]!==F?(R=e=>{A||M(e),F(e)},i[16]=A,i[17]=F,i[18]=R):R=i[18];let z=R,V;i[19]===k?V=i[20]:(V=new Set(k),i[19]=k,i[20]=V);let H=V,U;i[21]===p?U=i[22]:(U=new Set(p.filter(B).map(ee)),i[21]=p,i[22]=U);let W=U,G;i[23]!==l||i[24]!==p||i[25]!==N?(G=l==null?C(p,N):p.filter(e=>l(e,N)),i[23]=l,i[24]=p,i[25]=N,i[26]=G):G=i[26];let K=G,q;i[27]!==L||i[28]!==W||i[29]!==k?(q=e=>{W.has(e)||L(w(k,e))},i[27]=L,i[28]=W,i[29]=k,i[30]=q):q=i[30];let J;i[31]!==L||i[32]!==W||i[33]!==K||i[34]!==x||i[35]!==N||i[36]!==H||i[37]!==k||i[38]!==z||i[39]!==q?(J={listId:x,filteredOptions:K,query:N,setQuery:z,selectedValues:k,selectedSet:H,disabledSet:W,toggle:q,setSelection:L},i[31]=L,i[32]=W,i[33]=K,i[34]=x,i[35]=N,i[36]=H,i[37]=k,i[38]=z,i[39]=q,i[40]=J):J=i[40];let Y=J,X;i[41]===o?X=i[42]:(X=n(o,`selectable-list`),i[41]=o,i[42]=X);let Z;i[43]===a?Z=i[44]:(Z=t(`flex w-full flex-col gap-3`,a),i[43]=a,i[44]=Z);let Q;i[45]!==m||i[46]!==v||i[47]!==X||i[48]!==Z?(Q=/* @__PURE__ */ y(`div`,{ref:v,"data-slot":X,className:Z,...m}),i[45]=m,i[46]=v,i[47]=X,i[48]=Z,i[49]=Q):Q=i[49];let $;return i[50]!==Y||i[51]!==Q?($=/* @__PURE__ */ y(E.Provider,{value:Y,children:Q}),i[50]=Y,i[51]=Q,i[52]=$):$=i[52],$},A=e=>{let t=d(18),r,i,a,c;t[0]===e?(r=t[1],i=t[2],a=t[3],c=t[4]):({"data-slot":r,"aria-label":c,ref:a,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=c);let l=c===void 0?`Filter`:c,{query:u,setQuery:f}=D(`Filter`),p;t[5]===r?p=t[6]:(p=n(r,`selectable-list-filter`),t[5]=r,t[6]=p);let m;t[7]===f?m=t[8]:(m=e=>f(e.target.value),t[7]=f,t[8]=m);let h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=/* @__PURE__ */ y(x,{"aria-hidden":!0}),g=/* @__PURE__ */ y(o,{}),t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;return t[11]!==l||t[12]!==i||t[13]!==u||t[14]!==a||t[15]!==p||t[16]!==m?(_=/* @__PURE__ */ b(s,{ref:a,type:`text`,"data-slot":p,"aria-label":l,value:u,onChange:m,...i,children:[h,g]}),t[11]=l,t[12]=i,t[13]=u,t[14]=a,t[15]=p,t[16]=m,t[17]=_):_=t[17],_},j=e=>{let a=d(36),o,s,c,l,u;a[0]===e?(o=a[1],s=a[2],c=a[3],l=a[4],u=a[5]):({"data-slot":c,children:o,className:s,ref:u,...l}=e,a[0]=e,a[1]=o,a[2]=s,a[3]=c,a[4]=l,a[5]=u);let{filteredOptions:f,selectedValues:p,selectedSet:m,setSelection:h}=D(`SelectAll`),_=g(),v,x;if(a[6]!==f||a[7]!==m){let{allSelected:e,someSelected:t}=T(f,m);v=e,x=r({allSelected:v,someSelected:t}),a[6]=f,a[7]=m,a[8]=v,a[9]=x}else v=a[8],x=a[9];let S=x,C;a[10]===f?C=a[11]:(C=f.some(V),a[10]=f,a[11]=C);let w=C,E;a[12]!==v||a[13]!==f||a[14]!==p||a[15]!==h?(E=()=>{let e=f.filter(H).map(U);if(v){let t=new Set(e);h(p.filter(e=>!t.has(e)))}else h([.../* @__PURE__ */ new Set([...p,...e])])},a[12]=v,a[13]=f,a[14]=p,a[15]=h,a[16]=E):E=a[16];let O=E,k;a[17]===c?k=a[18]:(k=n(c,`selectable-list-select-all`),a[17]=c,a[18]=k);let A;a[19]===s?A=a[20]:(A=t(`text-strong flex cursor-pointer items-center gap-2 text-sm font-medium font-sans`,s),a[19]=s,a[20]=A);let j=!w,M;a[21]!==S||a[22]!==_||a[23]!==O||a[24]!==j?(M=/* @__PURE__ */ y(i,{id:_,checked:S,onChange:O,disabled:j}),a[21]=S,a[22]=_,a[23]=O,a[24]=j,a[25]=M):M=a[25];let N;a[26]===o?N=a[27]:(N=/* @__PURE__ */ y(`span`,{"data-slot":`selectable-list-select-all-label`,className:`contents`,children:o}),a[26]=o,a[27]=N);let P;return a[28]!==_||a[29]!==l||a[30]!==u||a[31]!==k||a[32]!==A||a[33]!==M||a[34]!==N?(P=/* @__PURE__ */ b(`label`,{ref:u,htmlFor:_,"data-slot":k,className:A,...l,children:[M,N]}),a[28]=_,a[29]=l,a[30]=u,a[31]=k,a[32]=A,a[33]=M,a[34]=N,a[35]=P):P=a[35],P};function M(e,t){return`${e}-control-${encodeURIComponent(t)}`}const N=e=>{let r=d(42),o,s,l,u,f,p;r[0]===e?(o=r[1],s=r[2],l=r[3],u=r[4],f=r[5],p=r[6]):({"data-slot":l,children:o,className:s,ref:f,value:p,...u}=e,r[0]=e,r[1]=o,r[2]=s,r[3]=l,r[4]=u,r[5]=f,r[6]=p);let{listId:m,selectedSet:h,disabledSet:g,toggle:_}=D(`Item`),v;r[7]!==m||r[8]!==p?(v=M(m,p),r[7]=m,r[8]=p,r[9]=v):v=r[9];let x=v,S;r[10]!==h||r[11]!==p?(S=h.has(p),r[10]=h,r[11]=p,r[12]=S):S=r[12];let C=S,w;r[13]!==g||r[14]!==p?(w=g.has(p),r[13]=g,r[14]=p,r[15]=w):w=r[15];let T=w,E;r[16]===s?E=r[17]:(E=t(`px-2 py-1.5 text-sm`,`cursor-pointer aria-disabled:cursor-default`,s),r[16]=s,r[17]=E);let O;r[18]===l?O=r[19]:(O=n(l,`selectable-list-item`),r[18]=l,r[19]=O);let k;r[20]!==_||r[21]!==p?(k=()=>_(p),r[20]=_,r[21]=p,r[22]=k):k=r[22];let A;r[23]!==C||r[24]!==k?(A=/* @__PURE__ */ y(a.Indicator,{role:`gridcell`,children:/* @__PURE__ */ y(i,{checked:C,onChange:k,tabIndex:-1})}),r[23]=C,r[24]=k,r[25]=A):A=r[25];let j;r[26]===o?j=r[27]:(j=/* @__PURE__ */ y(a.Content,{role:`gridcell`,children:o}),r[26]=o,r[27]=j);let N;r[28]!==x||r[29]!==T||r[30]!==A||r[31]!==j?(N=/* @__PURE__ */ b(a.Root,{id:x,disabled:T,children:[A,j]}),r[28]=x,r[29]=T,r[30]=A,r[31]=j,r[32]=N):N=r[32];let P;return r[33]!==T||r[34]!==u||r[35]!==f||r[36]!==C||r[37]!==E||r[38]!==O||r[39]!==N||r[40]!==p?(P=/* @__PURE__ */ y(c,{ref:f,asChild:!0,selected:C,disabled:T,className:E,...u,"data-slot":O,"data-value":p,children:N}),r[33]=T,r[34]=u,r[35]=f,r[36]=C,r[37]=E,r[38]=O,r[39]=N,r[40]=p,r[41]=P):P=r[41],P},P=e=>{let t=d(8),r,i;t[0]===e?(r=t[1],i=t[2]):({"data-slot":r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let o;t[3]===r?o=t[4]:(o=n(r,`selectable-list-item-title`),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=/* @__PURE__ */ y(a.Label,{"data-slot":o,...i}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s},F=e=>{let t=d(8),r,i;t[0]===e?(r=t[1],i=t[2]):({"data-slot":r,...i}=e,t[0]=e,t[1]=r,t[2]=i);let o;t[3]===r?o=t[4]:(o=n(r,`selectable-list-item-description`),t[3]=r,t[4]=o);let s;return t[5]!==i||t[6]!==o?(s=/* @__PURE__ */ y(a.Description,{"data-slot":o,...i}),t[5]=i,t[6]=o,t[7]=s):s=t[7],s};function I(e){return/* @__PURE__ */ b(N,{value:e.value,children:[/* @__PURE__ */ y(P,{children:e.label}),e.description!=null&&/* @__PURE__ */ y(F,{children:e.description})]})}function L(e,t){let n=[],r=[];for(let i of e){let e=t(i);m(e)&&(n.push(f(e,{key:i.value})),r.push(i))}return{items:n,options:r}}function R(e,t){let n=d(17),{filteredOptions:r,listId:i,toggle:a}=D(e),o=t??I,s;n[0]!==r||n[1]!==o?(s=L(r,o),n[0]=r,n[1]=o,n[2]=s):s=n[2];let{items:c,options:l}=s,u;n[3]!==l||n[4]!==a?(u=e=>{let t=l[e];t!=null&&a(t.value)},n[3]=l,n[4]=a,n[5]=u):u=n[5];let f=u,p;n[6]!==l||n[7]!==i?(p=e=>{let t=l[e];return t==null?``:M(i,t.value)},n[6]=l,n[7]=i,n[8]=p):p=n[8];let m=p,h;n[9]===l?h=n[10]:(h=e=>l[e]?.disabled===!0,n[9]=l,n[10]=h);let g=h,_=c.length===0,v;return n[11]!==g||n[12]!==m||n[13]!==c||n[14]!==f||n[15]!==_?(v={isEmpty:_,isItemDisabled:g,onActivate:f,itemId:m,items:c},n[11]=g,n[12]=m,n[13]=c,n[14]=f,n[15]=_,n[16]=v):v=n[16],v}const z={Root:k,Filter:A,SelectAll:j,Viewport:e=>{let t=d(15),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({"data-slot":i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let{isEmpty:s,isItemDisabled:c,onActivate:u,itemId:f,items:p}=R(`Viewport`,r);if(s)return null;let m;t[5]===i?m=t[6]:(m=n(i,`selectable-list-viewport`),t[5]=i,t[6]=m);let h;return t[7]!==c||t[8]!==f||t[9]!==p||t[10]!==u||t[11]!==a||t[12]!==o||t[13]!==m?(h=/* @__PURE__ */ y(l,{ref:o,"data-slot":m,semantics:`grid`,...a,"aria-multiselectable":!0,isItemDisabled:c,onActivate:u,itemId:f,children:p}),t[7]=c,t[8]=f,t[9]=p,t[10]=u,t[11]=a,t[12]=o,t[13]=m,t[14]=h):h=t[14],h},VirtualViewport:e=>{let t=d(15),r,i,a,o;t[0]===e?(r=t[1],i=t[2],a=t[3],o=t[4]):({"data-slot":i,children:r,ref:o,...a}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=a,t[4]=o);let{isEmpty:s,isItemDisabled:c,onActivate:l,itemId:f,items:p}=R(`VirtualViewport`,r);if(s)return null;let m;t[5]===i?m=t[6]:(m=n(i,`selectable-list-viewport`),t[5]=i,t[6]=m);let h;return t[7]!==c||t[8]!==f||t[9]!==p||t[10]!==l||t[11]!==a||t[12]!==o||t[13]!==m?(h=/* @__PURE__ */ y(u,{ref:o,"data-slot":m,semantics:`grid`,...a,"aria-multiselectable":!0,isItemDisabled:c,onActivate:l,itemId:f,children:p}),t[7]=c,t[8]=f,t[9]=p,t[10]=l,t[11]=a,t[12]=o,t[13]=m,t[14]=h):h=t[14],h},Item:N,ItemTitle:P,ItemDescription:F,Empty:e=>{let r=d(21),i,a,o,s,c;r[0]===e?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({"data-slot":o,children:i,className:a,ref:c,...s}=e,r[0]=e,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c);let{filteredOptions:l}=D(`Empty`),u=l.length===0,f;r[6]===o?f=r[7]:(f=n(o,`selectable-list-empty`),r[6]=o,r[7]=f);let p=!u&&`sr-only`,m=u&&`text-muted border-popover bg-popover flex items-center justify-center rounded-md border px-3 py-8 text-center text-sm`,h;r[8]!==a||r[9]!==p||r[10]!==m?(h=t(p,m,a),r[8]=a,r[9]=p,r[10]=m,r[11]=h):h=r[11];let g;r[12]!==i||r[13]!==u?(g=u&&/* @__PURE__ */ y(`span`,{"data-slot":`selectable-list-empty-label`,className:`contents`,children:i}),r[12]=i,r[13]=u,r[14]=g):g=r[14];let _;return r[15]!==s||r[16]!==c||r[17]!==f||r[18]!==h||r[19]!==g?(_=/* @__PURE__ */ y(`div`,{ref:c,"data-slot":f,role:`status`,className:h,...s,children:g}),r[15]=s,r[16]=c,r[17]=f,r[18]=h,r[19]=g,r[20]=_):_=r[20],_}};function B(e){return e.disabled}function ee(e){return e.value}function V(e){return!e.disabled}function H(e){return!e.disabled}function U(e){return e.value}export{z as SelectableList,C as filterSelectableOptions,S as optionLabelText,T as summarizeSelection,w as toggleSelectionValue};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as WithAsChild } from "./as-child-DFxX3U2i.js";
|
|
2
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
2
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
3
3
|
import { ComponentProps } from "react";
|
|
4
4
|
declare const orientations: readonly ["horizontal", "vertical"];
|
|
5
5
|
type Orientation = (typeof orientations)[number];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./slot-B7rwscwd.js";import{c as r}from"react/compiler-runtime";import{createContext as i,useContext as a}from"react";import{jsx as o}from"react/jsx-runtime";const s=[`horizontal`,`vertical`],c=i({}),l={orientation:`horizontal`},u=i=>{let a=r(16),s,u,d,f,p;a[0]===i?(s=a[1],u=a[2],d=a[3],f=a[4],p=a[5]):({"data-slot":f,className:d,children:u,asChild:s,...p}=i,a[0]=i,a[1]=s,a[2]=u,a[3]=d,a[4]=f,a[5]=p);let m=s?n:`div`,h;a[6]===f?h=a[7]:(h=t(f,`horizontal-separator-group`),a[6]=f,a[7]=h);let g;a[8]===d?g=a[9]:(g=e(`group flex items-center gap-2 [&>*:not([data-separator])]:shrink-0`,d),a[8]=d,a[9]=g);let _;return a[10]!==m||a[11]!==u||a[12]!==p||a[13]!==h||a[14]!==g?(_=/* @__PURE__ */ o(c.Provider,{value:l,children:/* @__PURE__ */ o(m,{"data-slot":h,"data-horizontal-separator-group":!0,className:g,...p,children:u})}),a[10]=m,a[11]=u,a[12]=p,a[13]=h,a[14]=g,a[15]=_):_=a[15],_},d=i=>{let s=r(32),l,u,d,p,m,h,g,_;s[0]===i?(l=s[1],u=s[2],d=s[3],p=s[4],m=s[5],h=s[6],g=s[7],_=s[8]):({"data-slot":d,asChild:g,children:l,className:u,orientation:p,ref:h,semantic:_,...m}=i,s[0]=i,s[1]=l,s[2]=u,s[3]=d,s[4]=p,s[5]=m,s[6]=h,s[7]=g,s[8]=_);let v=g!==void 0&&g,y=_!==void 0&&_,b=v?n:`div`,x=a(c),S;s[9]!==x.orientation||s[10]!==p?(S=x.orientation??(f(p)?p:`horizontal`),s[9]=x.orientation,s[10]=p,s[11]=S):S=s[11];let C=S,w=C===`vertical`?C:void 0,T;s[12]!==w||s[13]!==y?(T=y?{"aria-orientation":w,role:`separator`}:{role:`none`},s[12]=w,s[13]=y,s[14]=T):T=s[14];let E=T,D;s[15]===d?D=s[16]:(D=t(d,`separator`),s[15]=d,s[16]=D);let O=C===`horizontal`?`h-px w-full group-data-horizontal-separator-group:flex-1`:`h-full w-px`,k;s[17]!==u||s[18]!==O?(k=e(`separator`,`bg-separator shrink-0`,O,u),s[17]=u,s[18]=O,s[19]=k):k=s[19];let A;s[20]!==v||s[21]!==l?(A=v?{children:l}:{},s[20]=v,s[21]=l,s[22]=A):A=s[22];let j;return s[23]!==b||s[24]!==C||s[25]!==m||s[26]!==h||s[27]!==E||s[28]!==D||s[29]!==k||s[30]!==A?(j=/* @__PURE__ */ o(b,{"data-slot":D,className:k,"data-orientation":C,"data-separator":!0,...E,ref:h,...A,...m}),s[23]=b,s[24]=C,s[25]=m,s[26]=h,s[27]=E,s[28]=D,s[29]=k,s[30]=A,s[31]=j):j=s[31],j};function f(e){return typeof e==`string`&&s.some(t=>t===e)}export{d as n,u as t};
|
package/dist/separator.d.ts
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/structure/separator
|
|
5
5
|
*/
|
|
6
|
-
import { n as Separator, t as HorizontalSeparatorGroup } from "./separator-
|
|
6
|
+
import { n as Separator, t as HorizontalSeparatorGroup } from "./separator-Ck4sPrdN.js";
|
|
7
7
|
export { HorizontalSeparatorGroup, Separator };
|
package/dist/separator.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as HorizontalSeparatorGroup,n as Separator}from"./separator-
|
|
1
|
+
export{t as HorizontalSeparatorGroup,n as Separator}from"./separator-DnvhwY2J.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./use-prefers-reduced-motion-
|
|
1
|
+
import{t as e}from"./use-prefers-reduced-motion-Ck6dnOM9.js";function t(t){if(e()||typeof t.getAnimations!=`function`)return;let r=n(t);if(r!=null){r.currentTime=0;return}t.setAttribute(`data-shake`,``);let i=n(t),a=()=>t.removeAttribute(`data-shake`);i==null?a():i.finished.then(a,a)}function n(e){return e.getAnimations().find(e=>e instanceof CSSAnimation&&e.animationName===`shake`)}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{t as e}from"./cx-CK7o_rVv.js";import{t}from"./data-slot-EM6s2WEU.js";import{t as n}from"./layer-container-DL4yclOu.js";import{t as r}from"./button-B9bChDgl.js";import{a as i,c as a,i as o,l as s,n as c,o as l,r as u,s as d,t as f}from"./primitive-D8CzV_Ft.js";import{t as p}from"./slot-B7rwscwd.js";import{c as m}from"react/compiler-runtime";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{XIcon as _}from"@phosphor-icons/react/X";import{cva as v}from"class-variance-authority";const y=s();function b(){return y(void 0)}const x=e=>{let t=m(3),n=b(),r;return t[0]!==e||t[1]!==n?(r=/* @__PURE__ */ h(l,{...e,...n}),t[0]=e,t[1]=n,t[2]=r):r=t[2],r},S=e=>{let n=m(17),r,i,o,s;n[0]===e?(r=n[1],i=n[2],o=n[3],s=n[4]):({asChild:r,children:i,"data-slot":o,...s}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=o,n[4]=s);let c=b(),l;n[5]===o?l=n[6]:(l=t(o,`sheet-trigger`),n[5]=o,n[6]=l);let u=l,d;n[7]!==r||n[8]!==i||n[9]!==u?(d=r?/* @__PURE__ */ h(p,{"data-slot":u,children:i}):i,n[7]=r,n[8]=i,n[9]=u,n[10]=d):d=n[10];let f;return n[11]!==r||n[12]!==s||n[13]!==c||n[14]!==u||n[15]!==d?(f=/* @__PURE__ */ h(a,{asChild:r,"data-slot":u,...s,...c,children:d}),n[11]=r,n[12]=s,n[13]=c,n[14]=u,n[15]=d,n[16]=f):f=n[16],f},C=e=>{let n=m(17),r,i,a,o;n[0]===e?(r=n[1],i=n[2],a=n[3],o=n[4]):({asChild:r,children:i,"data-slot":a,...o}=e,n[0]=e,n[1]=r,n[2]=i,n[3]=a,n[4]=o);let s=b(),c;n[5]===a?c=n[6]:(c=t(a,`sheet-close`),n[5]=a,n[6]=c);let l=c,u;n[7]!==r||n[8]!==i||n[9]!==l?(u=r?/* @__PURE__ */ h(p,{"data-slot":l,children:i}):i,n[7]=r,n[8]=i,n[9]=l,n[10]=u):u=n[10];let d;return n[11]!==r||n[12]!==o||n[13]!==s||n[14]!==l||n[15]!==u?(d=/* @__PURE__ */ h(f,{asChild:r,"data-slot":l,...o,...s,children:u}),n[11]=r,n[12]=o,n[13]=s,n[14]=l,n[15]=u,n[16]=d):d=n[16],d},w=e=>{let t=m(3),n=b(),r;return t[0]!==e||t[1]!==n?(r=/* @__PURE__ */ h(i,{...e,...n}),t[0]=e,t[1]=n,t[2]=r):r=t[2],r},T=n=>{let r=m(15),i,a,s,c;r[0]===n?(i=r[1],a=r[2],s=r[3],c=r[4]):({"data-slot":a,className:i,ref:c,...s}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=s,r[4]=c);let l=b(),u;r[5]===a?u=r[6]:(u=t(a,`sheet-overlay`),r[5]=a,r[6]=u);let d;r[7]===i?d=r[8]:(d=e(`bg-overlay data-state-closed:animate-out data-state-closed:fade-out-0 data-state-open:animate-in data-state-open:fade-in-0 duration-200 ease-out-strong data-state-closed:duration-150 fixed inset-0 z-60 backdrop-blur-xs`,i),r[7]=i,r[8]=d);let f;return r[9]!==s||r[10]!==c||r[11]!==l||r[12]!==u||r[13]!==d?(f=/* @__PURE__ */ h(o,{"data-slot":u,className:d,...s,...l,ref:c}),r[9]=s,r[10]=c,r[11]=l,r[12]=u,r[13]=d,r[14]=f):f=r[14],f},E=v(`bg-dialog border-dialog inset-y-0 h-full w-full fixed flex flex-col shadow-lg outline-hidden focus-within:outline-hidden data-state-closed:animate-out data-state-open:animate-in duration-200 ease-out-strong data-state-closed:duration-150 motion-reduce:animate-none!`,{variants:{side:{left:`data-state-closed:slide-out-to-left data-state-open:slide-in-from-left left-0 border-r`,right:`data-state-closed:slide-out-to-right data-state-open:slide-in-from-right right-0 border-l`}},defaultVariants:{side:`right`}}),D={Root:x,Actions:n=>{let r=m(16),i,a,o,s,c;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({"data-slot":o,children:i,className:a,ref:c,...s}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c);let l;r[6]===o?l=r[7]:(l=t(o,`sheet-actions`),r[6]=o,r[7]=l);let u;r[8]===a?u=r[9]:(u=e(`flex h-full items-center gap-2`,a),r[8]=a,r[9]=u);let d;return r[10]!==i||r[11]!==s||r[12]!==c||r[13]!==l||r[14]!==u?(d=/* @__PURE__ */ h(`div`,{"data-slot":l,className:u,...s,ref:c,children:i}),r[10]=i,r[11]=s,r[12]=c,r[13]=l,r[14]=u,r[15]=d):d=r[15],d},Body:n=>{let r=m(12),i,a,o;r[0]===n?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=t(a,`sheet-body`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=e(`scrollbar scrollbar-gutter-stable text-body flex-1 overflow-y-auto p-6`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ h(`div`,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Close:C,CloseIconButton:e=>{let n=m(22),i,a,o,s,c,l,u;n[0]===e?(i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7]):({"data-slot":i,size:o,type:s,label:c,appearance:l,intent:u,...a}=e,n[0]=e,n[1]=i,n[2]=a,n[3]=o,n[4]=s,n[5]=c,n[6]=l,n[7]=u);let d=o===void 0?`md`:o,p=s===void 0?`button`:s,g=c===void 0?`Close Sheet`:c,v=l===void 0?`ghost`:l,y=u===void 0?`neutral`:u,x=b(),S;n[8]===i?S=n[9]:(S=t(i,`sheet-close-icon-button`),n[8]=i,n[9]=S);let C;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(C=/* @__PURE__ */ h(_,{}),n[10]=C):C=n[10];let w;n[11]!==v||n[12]!==y||n[13]!==g||n[14]!==a||n[15]!==d||n[16]!==S||n[17]!==p?(w=/* @__PURE__ */ h(r,{"data-slot":S,appearance:v,icon:C,intent:y,label:g,size:d,type:p,...a}),n[11]=v,n[12]=y,n[13]=g,n[14]=a,n[15]=d,n[16]=S,n[17]=p,n[18]=w):w=n[18];let T;return n[19]!==x||n[20]!==w?(T=/* @__PURE__ */ h(f,{asChild:!0,...x,children:w}),n[19]=x,n[20]=w,n[21]=T):T=n[21],T},Content:r=>{let i=m(22),a,o,s,l,u,d,f;i[0]===r?(a=i[1],o=i[2],s=i[3],l=i[4],u=i[5],d=i[6],f=i[7]):({"data-slot":s,children:a,className:o,preferredWidth:d,side:f,ref:u,...l}=r,i[0]=r,i[1]=a,i[2]=o,i[3]=s,i[4]=l,i[5]=u,i[6]=d,i[7]=f);let p=d===void 0?`sm:max-w-120`:d,_=f===void 0?`right`:f,v=b(),y;i[8]===Symbol.for(`react.memo_cache_sentinel`)?(y=/* @__PURE__ */ h(T,{}),i[8]=y):y=i[8];let x;i[9]===s?x=i[10]:(x=t(s,`sheet-content`),i[9]=s,i[10]=x);let S;i[11]!==o||i[12]!==p||i[13]!==_?(S=e(E({side:_}),p,o),i[11]=o,i[12]=p,i[13]=_,i[14]=S):S=i[14];let C;return i[15]!==a||i[16]!==l||i[17]!==u||i[18]!==v||i[19]!==x||i[20]!==S?(C=/* @__PURE__ */ g(w,{children:[y,/* @__PURE__ */ h(n,{"data-slot":`sheet-positioner`,className:`fixed z-60 motion-safe:not-has-[>[data-mantle-modal-content][data-state=open]]:animate-exit-hold`,children:/* @__PURE__ */ h(c,{"data-slot":x,"data-mantle-modal-content":!0,className:S,ref:u,...l,...v,children:a})})]}),i[15]=a,i[16]=l,i[17]=u,i[18]=v,i[19]=x,i[20]=S,i[21]=C):C=i[21],C},Description:n=>{let r=m(15),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c=b(),l;r[5]===a?l=r[6]:(l=t(a,`sheet-description`),r[5]=a,r[6]=l);let d;r[7]===i?d=r[8]:(d=e(`text-body text-sm`,i),r[7]=i,r[8]=d);let f;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l||r[13]!==d?(f=/* @__PURE__ */ h(u,{"data-slot":l,ref:s,className:d,...o,...c}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=d,r[14]=f):f=r[14],f},Footer:n=>{let r=m(12),i,a,o;r[0]===n?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=t(a,`sheet-footer`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=e(`border-dialog-muted flex shrink-0 justify-end gap-2 border-t px-6 py-2.5`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ h(`div`,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Header:n=>{let r=m(12),i,a,o;r[0]===n?(i=r[1],a=r[2],o=r[3]):({"data-slot":a,className:i,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o);let s;r[4]===a?s=r[5]:(s=t(a,`sheet-header`),r[4]=a,r[5]=s);let c;r[6]===i?c=r[7]:(c=e(`border-dialog-muted flex shrink-0 flex-col gap-2 border-b py-4 pl-6 pr-4`,`has-[.icon-button]:pr-4`,i),r[6]=i,r[7]=c);let l;return r[8]!==o||r[9]!==s||r[10]!==c?(l=/* @__PURE__ */ h(`div`,{"data-slot":s,className:c,...o}),r[8]=o,r[9]=s,r[10]=c,r[11]=l):l=r[11],l},Title:n=>{let r=m(15),i,a,o,s;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4]):({"data-slot":a,className:i,ref:s,...o}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s);let c=b(),l;r[5]===a?l=r[6]:(l=t(a,`sheet-title`),r[5]=a,r[6]=l);let u;r[7]===i?u=r[8]:(u=e(`text-strong flex-1 truncate text-lg font-medium`,i),r[7]=i,r[8]=u);let f;return r[9]!==o||r[10]!==s||r[11]!==c||r[12]!==l||r[13]!==u?(f=/* @__PURE__ */ h(d,{"data-slot":l,ref:s,className:u,...o,...c}),r[9]=o,r[10]=s,r[11]=c,r[12]=l,r[13]=u,r[14]=f):f=r[14],f},TitleGroup:n=>{let r=m(16),i,a,o,s,c;r[0]===n?(i=r[1],a=r[2],o=r[3],s=r[4],c=r[5]):({"data-slot":o,children:i,className:a,ref:c,...s}=n,r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=c);let l;r[6]===o?l=r[7]:(l=t(o,`sheet-title-group`),r[6]=o,r[7]=l);let u;r[8]===a?u=r[9]:(u=e(`flex items-center justify-between gap-2`,a),r[8]=a,r[9]=u);let d;return r[10]!==i||r[11]!==s||r[12]!==c||r[13]!==l||r[14]!==u?(d=/* @__PURE__ */ h(`div`,{"data-slot":l,className:u,...s,ref:c,children:i}),r[10]=i,r[11]=s,r[12]=c,r[13]=l,r[14]=u,r[15]=d):d=r[15],d},Trigger:S};export{D as t};
|
package/dist/sheet.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @see https://mantle.ngrok.com/components/overlays/sheet
|
|
5
5
|
*/
|
|
6
|
-
import { t as WithDataSlot } from "./data-slot-
|
|
7
|
-
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-
|
|
8
|
-
import { c as Trigger$1, n as Content$1, o as Root$1, r as Description$1, s as Title$1, t as Close$1 } from "./dialog-
|
|
6
|
+
import { t as WithDataSlot } from "./data-slot-BW8KQ9Xo.js";
|
|
7
|
+
import { i as IconButtonIntent, n as IconButtonProps, r as IconButtonAppearance } from "./button-DnYv7IOT.js";
|
|
8
|
+
import { c as Trigger$1, n as Content$1, o as Root$1, r as Description$1, s as Title$1, t as Close$1 } from "./dialog-CbEEA0fl.js";
|
|
9
9
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
10
10
|
import { VariantProps } from "class-variance-authority";
|
|
11
11
|
/**
|
|
@@ -161,7 +161,7 @@ declare const Root: (props: ComponentProps<typeof Root$1>) => import("react").JS
|
|
|
161
161
|
* </Sheet.Root>
|
|
162
162
|
* ```
|
|
163
163
|
*/
|
|
164
|
-
declare const Trigger: (props: ComponentProps<typeof Trigger$1>) => import("react").JSX.Element;
|
|
164
|
+
declare const Trigger: ({ asChild, children, "data-slot": dataSlot, ...props }: ComponentProps<typeof Trigger$1> & WithDataSlot) => import("react").JSX.Element;
|
|
165
165
|
/**
|
|
166
166
|
* The close button for a `Sheet`. Should be rendered as a child of the `Sheet.Content` component.
|
|
167
167
|
* Usually contained within the `Sheet.Footer` component.
|
|
@@ -203,7 +203,7 @@ declare const Trigger: (props: ComponentProps<typeof Trigger$1>) => import("reac
|
|
|
203
203
|
* </Sheet.Root>
|
|
204
204
|
* ```
|
|
205
205
|
*/
|
|
206
|
-
declare const Close: (props: ComponentProps<typeof Close$1>) => import("react").JSX.Element;
|
|
206
|
+
declare const Close: ({ asChild, children, "data-slot": dataSlot, ...props }: ComponentProps<typeof Close$1> & WithDataSlot) => import("react").JSX.Element;
|
|
207
207
|
declare const sheetVariants: (props?: ({
|
|
208
208
|
side?: "left" | "right" | null | undefined;
|
|
209
209
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
@@ -239,6 +239,14 @@ type SheetContentProps = ComponentProps<typeof Content$1> & VariantProps<typeof
|
|
|
239
239
|
* focus and hides outside content from assistive technology. Put a control that
|
|
240
240
|
* every user must reach inside the content.
|
|
241
241
|
*
|
|
242
|
+
* A script can show its own popup in a frame on `<body>`, above the sheet,
|
|
243
|
+
* such as the 3-D Secure challenge of a payment script. While that frame is
|
|
244
|
+
* on top at the center of the viewport, the sheet yields to the popup:
|
|
245
|
+
*
|
|
246
|
+
* - Focus that a script moves into the popup stays there.
|
|
247
|
+
* - Escape moves focus into the popup and does not close the sheet.
|
|
248
|
+
* - A click in the popup is not an outside click.
|
|
249
|
+
*
|
|
242
250
|
* @see https://mantle.ngrok.com/components/overlays/sheet#sheetcontent
|
|
243
251
|
*
|
|
244
252
|
* @example
|
|
@@ -288,7 +296,7 @@ type SheetContentProps = ComponentProps<typeof Content$1> & VariantProps<typeof
|
|
|
288
296
|
declare const Content: ({ "data-slot": dataSlot, children, className, preferredWidth, side, ref, ...props }: SheetContentProps) => import("react").JSX.Element;
|
|
289
297
|
type SheetCloseIconButtonProps = Partial<Omit<IconButtonProps, "icon" | "appearance" | "intent">> & {
|
|
290
298
|
/**
|
|
291
|
-
* The visual style of the close icon button. Optional here
|
|
299
|
+
* The visual style of the close icon button. Optional here:
|
|
292
300
|
* `Sheet.CloseIconButton` defaults to `"ghost"` so it stays visually quiet
|
|
293
301
|
* in the `Sheet.Header` beside the title.
|
|
294
302
|
*
|
|
@@ -296,7 +304,7 @@ type SheetCloseIconButtonProps = Partial<Omit<IconButtonProps, "icon" | "appeara
|
|
|
296
304
|
*/
|
|
297
305
|
appearance?: IconButtonAppearance;
|
|
298
306
|
/**
|
|
299
|
-
* The tone of the close icon button. Optional here
|
|
307
|
+
* The tone of the close icon button. Optional here: `Sheet.CloseIconButton`
|
|
300
308
|
* defaults to `"neutral"`, the workhorse tone for routine dismissal, and the
|
|
301
309
|
* only tone `IconButton` draws.
|
|
302
310
|
*
|
|
@@ -1076,6 +1084,14 @@ declare const Sheet: {
|
|
|
1076
1084
|
* focus and hides outside content from assistive technology. Put a control that
|
|
1077
1085
|
* every user must reach inside the content.
|
|
1078
1086
|
*
|
|
1087
|
+
* A script can show its own popup in a frame on `<body>`, above the sheet,
|
|
1088
|
+
* such as the 3-D Secure challenge of a payment script. While that frame is
|
|
1089
|
+
* on top at the center of the viewport, the sheet yields to the popup:
|
|
1090
|
+
*
|
|
1091
|
+
* - Focus that a script moves into the popup stays there.
|
|
1092
|
+
* - Escape moves focus into the popup and does not close the sheet.
|
|
1093
|
+
* - A click in the popup is not an outside click.
|
|
1094
|
+
*
|
|
1079
1095
|
* @see https://mantle.ngrok.com/components/overlays/sheet#sheetcontent
|
|
1080
1096
|
*
|
|
1081
1097
|
* @example
|
package/dist/sheet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{t as Sheet}from"./sheet-
|
|
1
|
+
export{t as Sheet}from"./sheet-DHy_vlme.js";
|