@ngrok/mantle 0.77.0 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion.d.ts +63 -21
- package/dist/accordion.js +1 -1
- package/dist/agent.json +4 -1
- package/dist/alert-dialog.d.ts +102 -70
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.d.ts +39 -39
- package/dist/alert.js +1 -1
- package/dist/{anchor-BtgEJoPN.js → anchor-C_tjSVy6.js} +1 -1
- package/dist/anchor.d.ts +3 -4
- package/dist/anchor.js +1 -1
- package/dist/{as-child-uN_018tj.d.ts → as-child-CYEVu1WY.d.ts} +0 -7
- package/dist/badge.d.ts +5 -56
- package/dist/badge.js +1 -1
- package/dist/breadcrumb.d.ts +212 -0
- package/dist/breadcrumb.js +1 -0
- package/dist/browser-only.d.ts +2 -6
- package/dist/{button-CERx95KE.js → button-5t6-JS_I.js} +1 -1
- package/dist/button-ClC60Nzg.js +1 -0
- package/dist/button-DcXOWUYo.d.ts +131 -0
- package/dist/button.d.ts +6 -4
- package/dist/button.js +1 -1
- package/dist/calendar.d.ts +2 -8
- package/dist/calendar.js +1 -1
- package/dist/card.d.ts +8 -8
- package/dist/card.js +1 -1
- package/dist/centered-layout.d.ts +147 -0
- package/dist/centered-layout.js +1 -0
- package/dist/checkbox-DJ2xl7Rc.js +1 -0
- package/dist/checkbox.d.ts +9 -11
- package/dist/checkbox.js +1 -1
- package/dist/{choice-D6S38dPs.js → choice-DOdyNzFC.js} +1 -1
- package/dist/choice.d.ts +16 -14
- package/dist/choice.js +1 -1
- package/dist/code-block.d.ts +5 -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 +4 -5
- package/dist/code.js +1 -1
- package/dist/combobox.d.ts +40 -19
- package/dist/combobox.js +1 -1
- package/dist/command.d.ts +71 -49
- package/dist/command.js +1 -1
- package/dist/cx-IiQEAKf5.js +1 -0
- package/dist/cx.js +1 -1
- package/dist/data-slot-CChfb_cv.d.ts +17 -0
- package/dist/data-table.d.ts +77 -137
- package/dist/data-table.js +1 -1
- package/dist/description-list.d.ts +7 -7
- package/dist/description-list.js +1 -1
- package/dist/{dialog-uyJcNks7.js → dialog-ZCgG41hx.js} +1 -1
- package/dist/dialog.d.ts +213 -88
- package/dist/dialog.js +1 -1
- package/dist/{direction-CcTY0FmA.d.ts → direction-BjU0bPST.d.ts} +1 -1
- package/dist/{dropdown-menu-OEuW4GLp.js → dropdown-menu-ByUQkAvJ.js} +1 -1
- package/dist/{dropdown-menu-CADgs9gz.d.ts → dropdown-menu-DMNw8ItM.d.ts} +26 -27
- package/dist/dropdown-menu.d.ts +2 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/empty.d.ts +139 -59
- package/dist/empty.js +1 -1
- package/dist/{field-context-4k1kI7Bo.js → field-context-BR01g789.js} +1 -1
- package/dist/field.d.ts +41 -36
- package/dist/field.js +1 -1
- package/dist/flag.d.ts +2 -9
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +13 -15
- package/dist/hooks.js +1 -1
- package/dist/hover-card.d.ts +42 -20
- package/dist/hover-card.js +1 -1
- package/dist/icon-CDtYjF_H.js +1 -0
- package/dist/{icon-n49kOh4_.d.ts → icon-Cevjo93X.d.ts} +2 -3
- package/dist/{icon-button-D7hs6bX2.d.ts → icon-button-B7uEj1qq.d.ts} +73 -11
- package/dist/icon-button-DV2-GZHf.js +1 -0
- package/dist/icon.d.ts +3 -3
- package/dist/icon.js +1 -1
- package/dist/icons.d.ts +7 -19
- package/dist/icons.js +1 -1
- package/dist/{in-view-bItE1fkG.d.ts → in-view-nkSOdED2.d.ts} +1 -6
- package/dist/{index-CTU6apE6.d.ts → index-BivvYYs-.d.ts} +8 -7
- package/dist/{index-Bed_XLWa.d.ts → index-D47aqlpz.d.ts} +3 -2
- package/dist/index-DZRbVkZa.d.ts +1 -0
- package/dist/index-Rv8RL7xy.d.ts +25 -0
- package/dist/{input-B3TS9yAP.js → input-Ct1YOqSy.js} +1 -1
- package/dist/input.d.ts +10 -11
- package/dist/input.js +1 -1
- package/dist/intents-DdSKSj1c.d.ts +28 -0
- package/dist/{kbd-D6k4Dnrf.js → kbd-K8iaZ-Ti.js} +1 -1
- package/dist/kbd.d.ts +3 -8
- package/dist/kbd.js +1 -1
- package/dist/{label-BLXfnQmn.js → label-BMlHW_2D.js} +1 -1
- package/dist/{label-PY0qM0G5.d.ts → label-v2-bv98k.d.ts} +1 -1
- package/dist/label.d.ts +1 -1
- package/dist/label.js +1 -1
- package/dist/list.d.ts +18 -60
- package/dist/list.js +1 -1
- package/dist/llms.txt +4 -1
- package/dist/main.d.ts +4 -27
- package/dist/main.js +1 -1
- package/dist/mantle.css +6 -6
- package/dist/media-object.d.ts +6 -7
- package/dist/media-object.js +1 -1
- package/dist/multi-select.d.ts +80 -33
- package/dist/multi-select.js +1 -1
- package/dist/otp-input.d.ts +7 -8
- package/dist/otp-input.js +1 -1
- package/dist/pagination.d.ts +11 -22
- package/dist/pagination.js +1 -1
- package/dist/{popover-Bq52EC7X.js → popover-D5WxxnBY.js} +1 -1
- package/dist/popover.d.ts +17 -18
- package/dist/popover.js +1 -1
- package/dist/{primitive-FoWela9a.d.ts → primitive-C64-m48O.d.ts} +0 -1
- package/dist/{primitive-BuVqb6zf.js → primitive-M-kZdNIS.js} +1 -1
- package/dist/progress.d.ts +55 -46
- package/dist/progress.js +1 -1
- package/dist/qr-code.d.ts +10 -9
- package/dist/qr-code.js +1 -1
- package/dist/radio-group.d.ts +71 -60
- package/dist/radio-group.js +1 -1
- package/dist/{resolve-pre-rendered-props-DxJ9-DAl.d.ts → resolve-pre-rendered-props-B6OlZrSI.d.ts} +13 -26
- package/dist/{resolve-pre-rendered-props-DwIF_M_K.js → resolve-pre-rendered-props-C3e5Auo3.js} +1 -1
- package/dist/sandboxed-on-click.d.ts +4 -8
- package/dist/sandboxed-on-click.js +1 -1
- package/dist/{select-BUGOJMER.d.ts → select-Bwt2YduR.d.ts} +11 -12
- package/dist/{select-Bxq_N-_o.js → select-D-5u0Blc.js} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/select.js +1 -1
- package/dist/selectable-list.d.ts +160 -146
- package/dist/selectable-list.js +1 -1
- package/dist/{separator-CqohKk4z.js → separator-kBnnv3Cw.js} +1 -1
- package/dist/separator.d.ts +6 -37
- package/dist/separator.js +1 -1
- package/dist/sheet.d.ts +302 -89
- package/dist/sheet.js +1 -1
- package/dist/sizes-BCoI4bhP.d.ts +29 -0
- package/dist/skeleton-Bu3tgNcW.js +1 -0
- package/dist/skeleton.d.ts +2 -2
- package/dist/skeleton.js +1 -1
- package/dist/skip-to-main-link.d.ts +4 -34
- package/dist/skip-to-main-link.js +1 -1
- package/dist/slider.d.ts +2 -21
- package/dist/slider.js +1 -1
- package/dist/slot-DmPrjM7N.js +1 -0
- package/dist/slot.d.ts +1 -1
- package/dist/slot.js +1 -1
- package/dist/split-button.d.ts +21 -13
- package/dist/split-button.js +1 -1
- package/dist/{svg-only-f6ToFLH0.d.ts → svg-only-BFeFS1aa.d.ts} +2 -3
- package/dist/{svg-only-CSOaF1tL.js → svg-only-DDx6FtJd.js} +1 -1
- package/dist/switch.d.ts +4 -5
- package/dist/switch.js +1 -1
- package/dist/{table-CAitdL78.js → table-CPH2md2-.js} +1 -1
- package/dist/{table-BWD9IlIN.d.ts → table-CwFHXC-G.d.ts} +10 -10
- package/dist/table.d.ts +1 -1
- package/dist/table.js +1 -1
- package/dist/tabs.d.ts +29 -15
- package/dist/tabs.js +1 -1
- package/dist/text-area.d.ts +2 -3
- package/dist/text-area.js +1 -1
- package/dist/theme-D8kZCOzM.js +1 -0
- package/dist/theme-provider-Djj_jBo6.js +1 -0
- package/dist/theme-switcher.d.ts +53 -0
- package/dist/theme-switcher.js +1 -0
- package/dist/theme.d.ts +15 -101
- package/dist/theme.js +1 -1
- package/dist/toast-D3ntBmn4.js +1 -0
- package/dist/toast.d.ts +32 -50
- package/dist/toast.js +1 -1
- package/dist/tooltip.d.ts +16 -50
- package/dist/tooltip.js +1 -1
- package/dist/{types-CTam1uIW.d.ts → types-C19IR7jf.d.ts} +1 -0
- package/dist/{types-BvUzforF.d.ts → types-D1RY5Tcj.d.ts} +0 -1
- package/dist/types.d.ts +3 -3
- package/dist/use-prefers-reduced-motion-CagaNRgm.js +1 -0
- package/dist/utils.d.ts +2 -3
- package/dist/{validation-xyX_6kph.d.ts → validation-7QeiTFwl.d.ts} +3 -12
- package/dist/{validation-DCyx-ceH.js → validation-Bpptk_9t.js} +1 -1
- package/dist/{virtual-PBNiHjMK.js → virtual-DZMBu7Ch.js} +1 -1
- package/dist/well.d.ts +3 -3
- package/dist/well.js +1 -1
- package/dist/{with-style-props-CyImx7vd.d.ts → with-style-props-Dq5Vntqy.d.ts} +0 -1
- package/package.json +17 -14
- package/dist/button-C9GW9nAr.js +0 -1
- package/dist/button-mfYak6Rx.d.ts +0 -71
- package/dist/checkbox-Apow0ipK.js +0 -1
- package/dist/cx-C1UYP5We.js +0 -1
- package/dist/icon-SUx16Sl3.js +0 -1
- package/dist/icon-button-DiX9iZ9n.js +0 -1
- package/dist/index-CJbKEKr2.d.ts +0 -20
- package/dist/slot-DT_E5BQx.js +0 -1
- package/dist/theme-provider-C5XYi2-H.js +0 -1
- package/dist/toast-CZBWjXcP.js +0 -1
- package/dist/use-prefers-reduced-motion-DBqNw1wB.js +0 -1
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
2
|
-
import { o as WithValidation } from "./validation-
|
|
3
|
-
import { i as WithInputType, r as WithAutoComplete } from "./types-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
|
+
import { o as WithValidation } from "./validation-7QeiTFwl.js";
|
|
3
|
+
import { i as WithInputType, r as WithAutoComplete } from "./types-C19IR7jf.js";
|
|
4
4
|
import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
5
|
-
|
|
6
5
|
//#region src/components/selectable-list/selectable-list.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* A single selectable row in a {@link SelectableList}. The list is data-driven:
|
|
@@ -13,7 +12,7 @@ import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
|
13
12
|
* A `label` may be any ReactNode; when it isn't a plain string, `labelText` is
|
|
14
13
|
* required so the default filter has text to match.
|
|
15
14
|
*
|
|
16
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
15
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
17
16
|
*
|
|
18
17
|
* @example
|
|
19
18
|
* ```ts
|
|
@@ -39,8 +38,11 @@ import { ComponentProps, ReactElement, ReactNode } from "react";
|
|
|
39
38
|
* ```
|
|
40
39
|
*/
|
|
41
40
|
type SelectableListOption = {
|
|
42
|
-
/** Stable, unique selection value. This is what flows through `value` / `onValueChange`. */
|
|
43
|
-
|
|
41
|
+
/** Stable, unique selection value. This is what flows through `value` / `onValueChange`. */
|
|
42
|
+
value: string;
|
|
43
|
+
/** Optional de-emphasized sub-line under the title in the default row (e.g. a masked identifier). */
|
|
44
|
+
description?: ReactNode;
|
|
45
|
+
/** When `true`, the row renders dimmed and cannot be toggled or selected by "select all". */
|
|
44
46
|
disabled?: boolean;
|
|
45
47
|
} & ({
|
|
46
48
|
/**
|
|
@@ -48,14 +50,16 @@ type SelectableListOption = {
|
|
|
48
50
|
* `<label>`, its accessible name. Also what the default filter matches
|
|
49
51
|
* (override that with `labelText`).
|
|
50
52
|
*/
|
|
51
|
-
label: string;
|
|
53
|
+
label: string;
|
|
54
|
+
/** Optional plain-text override for what the default filter matches. */
|
|
52
55
|
labelText?: string;
|
|
53
56
|
} | {
|
|
54
57
|
/**
|
|
55
58
|
* A rich title (any ReactNode). Keep readable text inside — the rendered
|
|
56
59
|
* content is the checkbox's accessible name.
|
|
57
60
|
*/
|
|
58
|
-
label: ReactNode;
|
|
61
|
+
label: ReactNode;
|
|
62
|
+
/** The plain-text form of the label. Required for a rich label so the default filter has text to match. */
|
|
59
63
|
labelText: string;
|
|
60
64
|
});
|
|
61
65
|
/**
|
|
@@ -121,7 +125,7 @@ declare function summarizeSelection(options: readonly SelectableListOption[], se
|
|
|
121
125
|
* which is replaced by `onValueChange`) with the option set and the
|
|
122
126
|
* controlled/uncontrolled selection state.
|
|
123
127
|
*
|
|
124
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
128
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
125
129
|
*
|
|
126
130
|
* @example
|
|
127
131
|
* ```tsx
|
|
@@ -131,12 +135,19 @@ declare function summarizeSelection(options: readonly SelectableListOption[], se
|
|
|
131
135
|
* ```
|
|
132
136
|
*/
|
|
133
137
|
type SelectableListRootProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
134
|
-
/** The full set of selectable rows. Map your domain data into these once. */
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
/** The full set of selectable rows. Map your domain data into these once. */
|
|
139
|
+
options: readonly SelectableListOption[];
|
|
140
|
+
/** Controlled selected values. Pair with `onValueChange`. */
|
|
141
|
+
value?: readonly string[];
|
|
142
|
+
/** Initial selected values for the uncontrolled case. */
|
|
143
|
+
defaultValue?: readonly string[];
|
|
144
|
+
/** Called with the next selection whenever it changes. */
|
|
145
|
+
onValueChange?: (values: string[]) => void;
|
|
146
|
+
/** Controlled filter query. Pair with `onQueryChange`. */
|
|
147
|
+
query?: string;
|
|
148
|
+
/** Initial filter query for the uncontrolled case. */
|
|
149
|
+
defaultQuery?: string;
|
|
150
|
+
/** Called with the next query whenever it changes (e.g. typing in `SelectableList.Filter`). */
|
|
140
151
|
onQueryChange?: (query: string) => void;
|
|
141
152
|
/**
|
|
142
153
|
* Custom filter predicate, called per option with the raw query; return
|
|
@@ -151,7 +162,7 @@ type SelectableListRootProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
|
151
162
|
* `value` the row represents; selection and disabled state are read from the
|
|
152
163
|
* list by that value (`options[].disabled` is the single source of truth).
|
|
153
164
|
*
|
|
154
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
165
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
155
166
|
*
|
|
156
167
|
* @example
|
|
157
168
|
* ```tsx
|
|
@@ -162,7 +173,8 @@ type SelectableListRootProps = Omit<ComponentProps<"div">, "onChange"> & {
|
|
|
162
173
|
* ```
|
|
163
174
|
*/
|
|
164
175
|
type SelectableListItemProps = Omit<ComponentProps<"div">, "children" | "id"> & {
|
|
165
|
-
/** The option's selection value. Selection state is read from, and toggled in, the list. */
|
|
176
|
+
/** The option's selection value. Selection state is read from, and toggled in, the list. */
|
|
177
|
+
value: string;
|
|
166
178
|
/**
|
|
167
179
|
* Item content — typically `SelectableList.ItemTitle` over a
|
|
168
180
|
* `SelectableList.ItemDescription`, or any layout you like. It fills the row's
|
|
@@ -174,7 +186,7 @@ type SelectableListItemProps = Omit<ComponentProps<"div">, "children" | "id"> &
|
|
|
174
186
|
* Props for `SelectableList.Viewport`. Extends `<div>` props (the scroll
|
|
175
187
|
* viewport) with an optional render-prop child for custom row layouts.
|
|
176
188
|
*
|
|
177
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
189
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
178
190
|
*
|
|
179
191
|
* @example
|
|
180
192
|
* ```tsx
|
|
@@ -195,7 +207,7 @@ type SelectableListViewportProps = Omit<ComponentProps<"div">, "children"> & {
|
|
|
195
207
|
* Props for `SelectableList.VirtualViewport` — the `Viewport` props plus the
|
|
196
208
|
* virtualizer knobs.
|
|
197
209
|
*
|
|
198
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
210
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
199
211
|
*
|
|
200
212
|
* @example
|
|
201
213
|
* ```tsx
|
|
@@ -203,7 +215,9 @@ type SelectableListViewportProps = Omit<ComponentProps<"div">, "children"> & {
|
|
|
203
215
|
* ```
|
|
204
216
|
*/
|
|
205
217
|
type SelectableListVirtualViewportProps = SelectableListViewportProps & {
|
|
206
|
-
/** Estimated item height in px, used to seed the virtualizer before items are measured. */
|
|
218
|
+
/** Estimated item height in px, used to seed the virtualizer before items are measured. */
|
|
219
|
+
estimateItemHeight?: number;
|
|
220
|
+
/** Rows rendered beyond the visible window on each side. */
|
|
207
221
|
overscan?: number;
|
|
208
222
|
};
|
|
209
223
|
/**
|
|
@@ -220,7 +234,7 @@ type SelectableListVirtualViewportProps = SelectableListViewportProps & {
|
|
|
220
234
|
* row (tracked via `aria-activedescendant`, so navigation works across the full
|
|
221
235
|
* option set even when virtualized) and `Space`/`Enter` toggles it.
|
|
222
236
|
*
|
|
223
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
237
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
224
238
|
*
|
|
225
239
|
* @example
|
|
226
240
|
* Composition:
|
|
@@ -255,7 +269,7 @@ declare const SelectableList: {
|
|
|
255
269
|
/**
|
|
256
270
|
* Root: owns selection + filter state and the derived filtered options.
|
|
257
271
|
*
|
|
258
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
272
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
259
273
|
*
|
|
260
274
|
* @example
|
|
261
275
|
* ```tsx
|
|
@@ -271,7 +285,7 @@ declare const SelectableList: {
|
|
|
271
285
|
/**
|
|
272
286
|
* Optional filter/search box (mantle `Input` + magnifying-glass icon).
|
|
273
287
|
*
|
|
274
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
288
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
275
289
|
*
|
|
276
290
|
* @example
|
|
277
291
|
* ```tsx
|
|
@@ -283,13 +297,13 @@ declare const SelectableList: {
|
|
|
283
297
|
* </SelectableList.Root>
|
|
284
298
|
* ```
|
|
285
299
|
*/
|
|
286
|
-
readonly Filter: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "
|
|
300
|
+
readonly Filter: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "autoComplete" | "type"> & WithAutoComplete & WithInputType & WithValidation & {
|
|
287
301
|
children?: ReactNode | undefined;
|
|
288
|
-
} & import("react").RefAttributes<HTMLInputElement>, "ref">, "children" | "defaultValue" | "onChange" | "
|
|
302
|
+
} & import("react").RefAttributes<HTMLInputElement>, "ref">, "children" | "defaultValue" | "onChange" | "type" | "value"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
289
303
|
/**
|
|
290
304
|
* Optional tri-state "select all" header over the filtered options.
|
|
291
305
|
*
|
|
292
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
306
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
293
307
|
*
|
|
294
308
|
* @example
|
|
295
309
|
* ```tsx
|
|
@@ -306,7 +320,7 @@ declare const SelectableList: {
|
|
|
306
320
|
* The scrollable grid of rows (non-virtualized). Give it an `aria-label`;
|
|
307
321
|
* pass a render-prop child for a custom row layout, or omit it for the default.
|
|
308
322
|
*
|
|
309
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
323
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
310
324
|
*
|
|
311
325
|
* @example
|
|
312
326
|
* ```tsx
|
|
@@ -322,7 +336,7 @@ declare const SelectableList: {
|
|
|
322
336
|
/**
|
|
323
337
|
* The windowed grid of rows — same surface as `Viewport`, for long lists.
|
|
324
338
|
*
|
|
325
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
339
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
326
340
|
*
|
|
327
341
|
* @example
|
|
328
342
|
* ```tsx
|
|
@@ -339,7 +353,7 @@ declare const SelectableList: {
|
|
|
339
353
|
* A selectable grid row for custom viewport rendering. Reads its selection
|
|
340
354
|
* and disabled state from the list by `value`.
|
|
341
355
|
*
|
|
342
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
356
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
343
357
|
*
|
|
344
358
|
* @example
|
|
345
359
|
* ```tsx
|
|
@@ -362,7 +376,7 @@ declare const SelectableList: {
|
|
|
362
376
|
/**
|
|
363
377
|
* Emphasized title (`Choice.Label`) for a `SelectableList.Item`.
|
|
364
378
|
*
|
|
365
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
379
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
366
380
|
*
|
|
367
381
|
* @example
|
|
368
382
|
* ```tsx
|
|
@@ -382,122 +396,12 @@ declare const SelectableList: {
|
|
|
382
396
|
* ```
|
|
383
397
|
*/
|
|
384
398
|
readonly ItemTitle: import("react").ForwardRefExoticComponent<Omit<Omit<{
|
|
385
|
-
children?: ReactNode;
|
|
386
|
-
form?: string | undefined | undefined;
|
|
387
|
-
slot?: string | undefined | undefined;
|
|
388
|
-
style?: import("react").CSSProperties | undefined;
|
|
389
|
-
title?: string | undefined | undefined;
|
|
390
|
-
onSelect?: import("react").ReactEventHandler<HTMLLabelElement> | undefined;
|
|
391
|
-
ref?: import("react").Ref<HTMLLabelElement> | undefined;
|
|
392
399
|
key?: import("react").Key | null | undefined;
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
396
|
-
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
397
|
-
accessKey?: string | undefined | undefined;
|
|
398
|
-
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
399
|
-
autoFocus?: boolean | undefined | undefined;
|
|
400
|
-
className?: string | undefined | undefined;
|
|
401
|
-
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
402
|
-
contextMenu?: string | undefined | undefined;
|
|
403
|
-
dir?: string | undefined | undefined;
|
|
404
|
-
draggable?: (boolean | "true" | "false") | undefined;
|
|
405
|
-
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
406
|
-
hidden?: boolean | undefined | undefined;
|
|
407
|
-
id?: string | undefined | undefined;
|
|
408
|
-
lang?: string | undefined | undefined;
|
|
409
|
-
nonce?: string | undefined | undefined;
|
|
410
|
-
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
411
|
-
tabIndex?: number | undefined | undefined;
|
|
412
|
-
translate?: "yes" | "no" | undefined | undefined;
|
|
413
|
-
radioGroup?: string | undefined | undefined;
|
|
414
|
-
role?: import("react").AriaRole | undefined;
|
|
415
|
-
about?: string | undefined | undefined;
|
|
416
|
-
content?: string | undefined | undefined;
|
|
417
|
-
datatype?: string | undefined | undefined;
|
|
418
|
-
inlist?: any;
|
|
419
|
-
prefix?: string | undefined | undefined;
|
|
420
|
-
property?: string | undefined | undefined;
|
|
421
|
-
rel?: string | undefined | undefined;
|
|
422
|
-
resource?: string | undefined | undefined;
|
|
423
|
-
rev?: string | undefined | undefined;
|
|
424
|
-
typeof?: string | undefined | undefined;
|
|
425
|
-
vocab?: string | undefined | undefined;
|
|
426
|
-
autoCorrect?: string | undefined | undefined;
|
|
427
|
-
autoSave?: string | undefined | undefined;
|
|
428
|
-
color?: string | undefined | undefined;
|
|
429
|
-
itemProp?: string | undefined | undefined;
|
|
430
|
-
itemScope?: boolean | undefined | undefined;
|
|
431
|
-
itemType?: string | undefined | undefined;
|
|
432
|
-
itemID?: string | undefined | undefined;
|
|
433
|
-
itemRef?: string | undefined | undefined;
|
|
434
|
-
results?: number | undefined | undefined;
|
|
435
|
-
security?: string | undefined | undefined;
|
|
436
|
-
unselectable?: "on" | "off" | undefined | undefined;
|
|
437
|
-
popover?: "" | "auto" | "manual" | "hint" | undefined | undefined;
|
|
438
|
-
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
439
|
-
popoverTarget?: string | undefined | undefined;
|
|
440
|
-
inert?: boolean | undefined | undefined;
|
|
441
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
442
|
-
is?: string | undefined | undefined;
|
|
443
|
-
exportparts?: string | undefined | undefined;
|
|
444
|
-
part?: string | undefined | undefined;
|
|
445
|
-
"aria-activedescendant"?: string | undefined | undefined;
|
|
446
|
-
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
447
|
-
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
448
|
-
"aria-braillelabel"?: string | undefined | undefined;
|
|
449
|
-
"aria-brailleroledescription"?: string | undefined | undefined;
|
|
450
|
-
"aria-busy"?: (boolean | "true" | "false") | undefined;
|
|
451
|
-
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
452
|
-
"aria-colcount"?: number | undefined | undefined;
|
|
453
|
-
"aria-colindex"?: number | undefined | undefined;
|
|
454
|
-
"aria-colindextext"?: string | undefined | undefined;
|
|
455
|
-
"aria-colspan"?: number | undefined | undefined;
|
|
456
|
-
"aria-controls"?: string | undefined | undefined;
|
|
457
|
-
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined | undefined;
|
|
458
|
-
"aria-describedby"?: string | undefined | undefined;
|
|
459
|
-
"aria-description"?: string | undefined | undefined;
|
|
460
|
-
"aria-details"?: string | undefined | undefined;
|
|
461
|
-
"aria-disabled"?: (boolean | "true" | "false") | undefined;
|
|
462
|
-
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined | undefined;
|
|
463
|
-
"aria-errormessage"?: string | undefined | undefined;
|
|
464
|
-
"aria-expanded"?: (boolean | "true" | "false") | undefined;
|
|
465
|
-
"aria-flowto"?: string | undefined | undefined;
|
|
466
|
-
"aria-grabbed"?: (boolean | "true" | "false") | undefined;
|
|
467
|
-
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined | undefined;
|
|
468
|
-
"aria-hidden"?: (boolean | "true" | "false") | undefined;
|
|
469
|
-
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined | undefined;
|
|
470
|
-
"aria-keyshortcuts"?: string | undefined | undefined;
|
|
471
|
-
"aria-label"?: string | undefined | undefined;
|
|
472
|
-
"aria-labelledby"?: string | undefined | undefined;
|
|
473
|
-
"aria-level"?: number | undefined | undefined;
|
|
474
|
-
"aria-live"?: "off" | "assertive" | "polite" | undefined | undefined;
|
|
475
|
-
"aria-modal"?: (boolean | "true" | "false") | undefined;
|
|
476
|
-
"aria-multiline"?: (boolean | "true" | "false") | undefined;
|
|
477
|
-
"aria-multiselectable"?: (boolean | "true" | "false") | undefined;
|
|
478
|
-
"aria-orientation"?: "horizontal" | "vertical" | undefined | undefined;
|
|
479
|
-
"aria-owns"?: string | undefined | undefined;
|
|
480
|
-
"aria-placeholder"?: string | undefined | undefined;
|
|
481
|
-
"aria-posinset"?: number | undefined | undefined;
|
|
482
|
-
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined | undefined;
|
|
483
|
-
"aria-readonly"?: (boolean | "true" | "false") | undefined;
|
|
484
|
-
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined | undefined;
|
|
485
|
-
"aria-required"?: (boolean | "true" | "false") | undefined;
|
|
486
|
-
"aria-roledescription"?: string | undefined | undefined;
|
|
487
|
-
"aria-rowcount"?: number | undefined | undefined;
|
|
488
|
-
"aria-rowindex"?: number | undefined | undefined;
|
|
489
|
-
"aria-rowindextext"?: string | undefined | undefined;
|
|
490
|
-
"aria-rowspan"?: number | undefined | undefined;
|
|
491
|
-
"aria-selected"?: (boolean | "true" | "false") | undefined;
|
|
492
|
-
"aria-setsize"?: number | undefined | undefined;
|
|
493
|
-
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined | undefined;
|
|
494
|
-
"aria-valuemax"?: number | undefined | undefined;
|
|
495
|
-
"aria-valuemin"?: number | undefined | undefined;
|
|
496
|
-
"aria-valuenow"?: number | undefined | undefined;
|
|
497
|
-
"aria-valuetext"?: string | undefined | undefined;
|
|
400
|
+
ref?: import("react").Ref<HTMLLabelElement> | undefined;
|
|
401
|
+
children?: ReactNode | undefined;
|
|
498
402
|
dangerouslySetInnerHTML?: {
|
|
499
403
|
__html: string | TrustedHTML;
|
|
500
|
-
} | undefined
|
|
404
|
+
} | undefined;
|
|
501
405
|
onCopy?: import("react").ClipboardEventHandler<HTMLLabelElement> | undefined;
|
|
502
406
|
onCopyCapture?: import("react").ClipboardEventHandler<HTMLLabelElement> | undefined;
|
|
503
407
|
onCut?: import("react").ClipboardEventHandler<HTMLLabelElement> | undefined;
|
|
@@ -616,6 +520,7 @@ declare const SelectableList: {
|
|
|
616
520
|
onMouseOverCapture?: import("react").MouseEventHandler<HTMLLabelElement> | undefined;
|
|
617
521
|
onMouseUp?: import("react").MouseEventHandler<HTMLLabelElement> | undefined;
|
|
618
522
|
onMouseUpCapture?: import("react").MouseEventHandler<HTMLLabelElement> | undefined;
|
|
523
|
+
onSelect?: import("react").ReactEventHandler<HTMLLabelElement> | undefined;
|
|
619
524
|
onSelectCapture?: import("react").ReactEventHandler<HTMLLabelElement> | undefined;
|
|
620
525
|
onTouchCancel?: import("react").TouchEventHandler<HTMLLabelElement> | undefined;
|
|
621
526
|
onTouchCancelCapture?: import("react").TouchEventHandler<HTMLLabelElement> | undefined;
|
|
@@ -665,11 +570,120 @@ declare const SelectableList: {
|
|
|
665
570
|
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLLabelElement> | undefined;
|
|
666
571
|
onTransitionStart?: import("react").TransitionEventHandler<HTMLLabelElement> | undefined;
|
|
667
572
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLLabelElement> | undefined;
|
|
573
|
+
"aria-activedescendant"?: string | undefined;
|
|
574
|
+
"aria-atomic"?: ("false" | "true" | boolean) | undefined;
|
|
575
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
576
|
+
"aria-braillelabel"?: string | undefined;
|
|
577
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
578
|
+
"aria-busy"?: ("false" | "true" | boolean) | undefined;
|
|
579
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
580
|
+
"aria-colcount"?: number | undefined;
|
|
581
|
+
"aria-colindex"?: number | undefined;
|
|
582
|
+
"aria-colindextext"?: string | undefined;
|
|
583
|
+
"aria-colspan"?: number | undefined;
|
|
584
|
+
"aria-controls"?: string | undefined;
|
|
585
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
586
|
+
"aria-describedby"?: string | undefined;
|
|
587
|
+
"aria-description"?: string | undefined;
|
|
588
|
+
"aria-details"?: string | undefined;
|
|
589
|
+
"aria-disabled"?: ("false" | "true" | boolean) | undefined;
|
|
590
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
591
|
+
"aria-errormessage"?: string | undefined;
|
|
592
|
+
"aria-expanded"?: ("false" | "true" | boolean) | undefined;
|
|
593
|
+
"aria-flowto"?: string | undefined;
|
|
594
|
+
"aria-grabbed"?: ("false" | "true" | boolean) | undefined;
|
|
595
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
596
|
+
"aria-hidden"?: ("false" | "true" | boolean) | undefined;
|
|
597
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
598
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
599
|
+
"aria-label"?: string | undefined;
|
|
600
|
+
"aria-labelledby"?: string | undefined;
|
|
601
|
+
"aria-level"?: number | undefined;
|
|
602
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
603
|
+
"aria-modal"?: ("false" | "true" | boolean) | undefined;
|
|
604
|
+
"aria-multiline"?: ("false" | "true" | boolean) | undefined;
|
|
605
|
+
"aria-multiselectable"?: ("false" | "true" | boolean) | undefined;
|
|
606
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
607
|
+
"aria-owns"?: string | undefined;
|
|
608
|
+
"aria-placeholder"?: string | undefined;
|
|
609
|
+
"aria-posinset"?: number | undefined;
|
|
610
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
611
|
+
"aria-readonly"?: ("false" | "true" | boolean) | undefined;
|
|
612
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
613
|
+
"aria-required"?: ("false" | "true" | boolean) | undefined;
|
|
614
|
+
"aria-roledescription"?: string | undefined;
|
|
615
|
+
"aria-rowcount"?: number | undefined;
|
|
616
|
+
"aria-rowindex"?: number | undefined;
|
|
617
|
+
"aria-rowindextext"?: string | undefined;
|
|
618
|
+
"aria-rowspan"?: number | undefined;
|
|
619
|
+
"aria-selected"?: ("false" | "true" | boolean) | undefined;
|
|
620
|
+
"aria-setsize"?: number | undefined;
|
|
621
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
622
|
+
"aria-valuemax"?: number | undefined;
|
|
623
|
+
"aria-valuemin"?: number | undefined;
|
|
624
|
+
"aria-valuenow"?: number | undefined;
|
|
625
|
+
"aria-valuetext"?: string | undefined;
|
|
626
|
+
defaultChecked?: boolean | undefined;
|
|
627
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
628
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
629
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
630
|
+
accessKey?: string | undefined;
|
|
631
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
|
|
632
|
+
autoFocus?: boolean | undefined;
|
|
633
|
+
className?: string | undefined;
|
|
634
|
+
contentEditable?: ("false" | "true" | boolean) | "inherit" | "plaintext-only" | undefined;
|
|
635
|
+
contextMenu?: string | undefined;
|
|
636
|
+
dir?: string | undefined;
|
|
637
|
+
draggable?: ("false" | "true" | boolean) | undefined;
|
|
638
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
639
|
+
hidden?: boolean | undefined;
|
|
640
|
+
id?: string | undefined;
|
|
641
|
+
lang?: string | undefined;
|
|
642
|
+
nonce?: string | undefined;
|
|
643
|
+
slot?: string | undefined;
|
|
644
|
+
spellCheck?: ("false" | "true" | boolean) | undefined;
|
|
645
|
+
style?: import("react").CSSProperties | undefined;
|
|
646
|
+
tabIndex?: number | undefined;
|
|
647
|
+
title?: string | undefined;
|
|
648
|
+
translate?: "yes" | "no" | undefined;
|
|
649
|
+
radioGroup?: string | undefined;
|
|
650
|
+
role?: import("react").AriaRole | undefined;
|
|
651
|
+
about?: string | undefined;
|
|
652
|
+
content?: string | undefined;
|
|
653
|
+
datatype?: string | undefined;
|
|
654
|
+
inlist?: any;
|
|
655
|
+
prefix?: string | undefined;
|
|
656
|
+
property?: string | undefined;
|
|
657
|
+
rel?: string | undefined;
|
|
658
|
+
resource?: string | undefined;
|
|
659
|
+
rev?: string | undefined;
|
|
660
|
+
typeof?: string | undefined;
|
|
661
|
+
vocab?: string | undefined;
|
|
662
|
+
autoCorrect?: string | undefined;
|
|
663
|
+
autoSave?: string | undefined;
|
|
664
|
+
color?: string | undefined;
|
|
665
|
+
itemProp?: string | undefined;
|
|
666
|
+
itemScope?: boolean | undefined;
|
|
667
|
+
itemType?: string | undefined;
|
|
668
|
+
itemID?: string | undefined;
|
|
669
|
+
itemRef?: string | undefined;
|
|
670
|
+
results?: number | undefined;
|
|
671
|
+
security?: string | undefined;
|
|
672
|
+
unselectable?: "on" | "off" | undefined;
|
|
673
|
+
popover?: "" | "auto" | "manual" | "hint" | undefined;
|
|
674
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
|
|
675
|
+
popoverTarget?: string | undefined;
|
|
676
|
+
inert?: boolean | undefined;
|
|
677
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
678
|
+
is?: string | undefined;
|
|
679
|
+
exportparts?: string | undefined;
|
|
680
|
+
part?: string | undefined;
|
|
681
|
+
form?: string | undefined;
|
|
668
682
|
}, "ref"> & import("react").RefAttributes<HTMLLabelElement>, "ref"> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
669
683
|
/**
|
|
670
684
|
* De-emphasized sub-line (`Choice.Description`) for a `SelectableList.Item`.
|
|
671
685
|
*
|
|
672
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
686
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
673
687
|
*
|
|
674
688
|
* @example
|
|
675
689
|
* ```tsx
|
|
@@ -693,7 +707,7 @@ declare const SelectableList: {
|
|
|
693
707
|
* Shown when the filter matches no options — a polite `role="status"` live
|
|
694
708
|
* region, so the empty state is announced as the filter narrows.
|
|
695
709
|
*
|
|
696
|
-
* @see https://mantle.ngrok.com/components/selectable-list
|
|
710
|
+
* @see https://mantle.ngrok.com/components/data-display/selectable-list
|
|
697
711
|
*
|
|
698
712
|
* @example
|
|
699
713
|
* ```tsx
|
package/dist/selectable-list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{n as t,t as n}from"./checkbox-DJ2xl7Rc.js";import{t as r}from"./choice-DOdyNzFC.js";import{n as i,t as a}from"./input-Ct1YOqSy.js";import{n as o,r as s,t as c}from"./virtual-DZMBu7Ch.js";import{cloneElement as l,createContext as u,forwardRef as d,isValidElement as f,useCallback as p,useContext as m,useId as h,useMemo 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=u(null);function D(e){let t=m(E);return v(t,`SelectableList.${e} must be rendered inside SelectableList.Root.`),t}const O=[],k=d(({className:t,defaultQuery:n,defaultValue:r,filter:i,onQueryChange:a,onValueChange:o,options:s,query:c,value:l,...u},d)=>{let f=h(),m=l!=null,[v,b]=_(r??O),x=m?l:v,S=c!=null,[T,D]=_(n??``),k=S?c:T,A=p(e=>{m||b(e),o?.(e)},[m,o]),j=p(e=>{S||D(e),a?.(e)},[S,a]),M=g(()=>new Set(x),[x]),N=g(()=>new Set(s.filter(e=>e.disabled).map(e=>e.value)),[s]),P=g(()=>i==null?C(s,k):s.filter(e=>i(e,k)),[s,k,i]),F=g(()=>({listId:f,filteredOptions:P,query:k,setQuery:j,selectedValues:x,selectedSet:M,disabledSet:N,toggle:e=>{N.has(e)||A(w(x,e))},setSelection:A}),[f,P,k,j,x,M,N,A]);return y(E.Provider,{value:F,children:y(`div`,{ref:d,"data-slot":`selectable-list`,className:e(`flex w-full flex-col gap-3`,t),...u})})});k.displayName=`SelectableListRoot`;const A=d(({"aria-label":e=`Filter`,...t},n)=>{let{query:r,setQuery:o}=D(`Filter`);return b(a,{ref:n,type:`text`,"data-slot":`selectable-list-filter`,"aria-label":e,value:r,onChange:e=>o(e.target.value),...t,children:[y(x,{}),y(i,{})]})});A.displayName=`SelectableListFilter`;const j=d(({children:r,className:i,...a},o)=>{let{filteredOptions:s,selectedValues:c,selectedSet:l,setSelection:u}=D(`SelectAll`),d=h(),{allSelected:f,someSelected:p}=T(s,l),m=t({allSelected:f,someSelected:p}),g=s.some(e=>!e.disabled),_=()=>{let e=s.filter(e=>!e.disabled).map(e=>e.value);if(f){let t=new Set(e);u(c.filter(e=>!t.has(e)));return}u([...new Set([...c,...e])])};return b(`label`,{ref:o,htmlFor:d,"data-slot":`selectable-list-select-all`,className:e(`text-strong flex cursor-pointer items-center gap-2 text-sm font-medium font-sans`,i),...a,children:[y(n,{id:d,checked:m,onChange:_,disabled:!g}),r]})});j.displayName=`SelectableListSelectAll`;function M(e,t){return`${e}-control-${encodeURIComponent(t)}`}const N=d(({children:t,className:i,value:a,...s},c)=>{let{listId:l,selectedSet:u,disabledSet:d,toggle:f}=D(`Item`),p=M(l,a),m=u.has(a),h=d.has(a);return y(o,{ref:c,asChild:!0,selected:m,disabled:h,className:e(`px-2 py-1.5 text-sm`,`cursor-pointer aria-disabled:cursor-default`,i),...s,"data-slot":`selectable-list-item`,"data-value":a,children:b(r.Root,{id:p,disabled:h,children:[y(r.Indicator,{role:`gridcell`,children:y(n,{checked:m,onChange:()=>f(a),tabIndex:-1})}),y(r.Content,{role:`gridcell`,children:t})]})})});N.displayName=`SelectableListItem`;const P=d((e,t)=>y(r.Label,{ref:t,"data-slot":`selectable-list-item-title`,...e}));P.displayName=`SelectableListItemTitle`;const F=d((e,t)=>y(r.Description,{ref:t,"data-slot":`selectable-list-item-description`,...e}));F.displayName=`SelectableListItemDescription`;function I(e){return b(N,{value:e.value,children:[y(P,{children:e.label}),e.description!=null&&y(F,{children:e.description})]})}function L(e,t){let n=[],r=[];for(let i of e){let e=t(i);f(e)&&(n.push(l(e,{key:i.value})),r.push(i))}return{items:n,options:r}}function R(e,t){let{filteredOptions:n,listId:r,toggle:i}=D(e),a=t??I,{items:o,options:s}=g(()=>L(n,a),[n,a]),c=p(e=>{let t=s[e];t!=null&&i(t.value)},[s,i]),l=p(e=>{let t=s[e];return t==null?``:M(r,t.value)},[s,r]),u=p(e=>s[e]?.disabled===!0,[s]);return{isEmpty:o.length===0,isItemDisabled:u,onActivate:c,itemId:l,items:o}}const z=d(({children:e,...t},n)=>{let{isEmpty:r,isItemDisabled:i,onActivate:a,itemId:o,items:c}=R(`Viewport`,e);return r?null:y(s,{ref:n,"data-slot":`selectable-list-viewport`,semantics:`grid`,...t,"aria-multiselectable":!0,isItemDisabled:i,onActivate:a,itemId:o,children:c})});z.displayName=`SelectableListViewport`;const B=d(({children:e,...t},n)=>{let{isEmpty:r,isItemDisabled:i,onActivate:a,itemId:o,items:s}=R(`VirtualViewport`,e);return r?null:y(c,{ref:n,"data-slot":`selectable-list-viewport`,semantics:`grid`,...t,"aria-multiselectable":!0,isItemDisabled:i,onActivate:a,itemId:o,children:s})});B.displayName=`SelectableListVirtualViewport`;const V=d(({children:t,className:n,...r},i)=>{let{filteredOptions:a}=D(`Empty`),o=a.length===0;return y(`div`,{ref:i,"data-slot":`selectable-list-empty`,role:`status`,className:e(!o&&`sr-only`,o&&`text-muted border-popover bg-popover flex items-center justify-center rounded-md border px-3 py-8 text-center text-sm`,n),...r,children:o?t:null})});V.displayName=`SelectableListEmpty`;const H={Root:k,Filter:A,SelectAll:j,Viewport:z,VirtualViewport:B,Item:N,ItemTitle:P,ItemDescription:F,Empty:V};export{H as SelectableList,C as filterSelectableOptions,S as optionLabelText,T as summarizeSelection,w as toggleSelectionValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./cx-
|
|
1
|
+
import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DmPrjM7N.js";import{createContext as n,forwardRef as r,useContext as i}from"react";import{jsx as a}from"react/jsx-runtime";const o=[`horizontal`,`vertical`],s=n({}),c={orientation:`horizontal`},l=({className:n,children:r,asChild:i,...o})=>{let l=i?t:`div`;return a(s.Provider,{value:c,children:a(l,{"data-slot":`horizontal-separator-group`,"data-horizontal-separator-group":!0,className:e(`group flex items-center gap-2 [&>*:not([data-separator])]:shrink-0`,n),...o,children:r})})};l.displayName=`HorizontalSeparatorGroup`;const u=r(({asChild:n=!1,children:r,className:o,orientation:c,semantic:l=!1,...u},f)=>{let p=n?t:`div`,m=i(s).orientation??(d(c)?c:`horizontal`),h=l?{"aria-orientation":m===`vertical`?m:void 0,role:`separator`}:{role:`none`};return a(p,{"data-slot":`separator`,className:e(`separator`,`bg-separator`,m===`horizontal`?`h-px w-full group-data-horizontal-separator-group:flex-1`:`h-full w-px`,o),"data-orientation":m,"data-separator":!0,...h,ref:f,...n?{children:r}:{},...u})});u.displayName=`Separator`;function d(e){return typeof e==`string`&&o.includes(e)}export{u as n,l as t};
|
package/dist/separator.d.ts
CHANGED
|
@@ -1,43 +1,12 @@
|
|
|
1
|
-
import { t as WithAsChild } from "./as-child-
|
|
1
|
+
import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
|
|
2
2
|
import { ComponentProps, HTMLAttributes } from "react";
|
|
3
|
-
|
|
4
3
|
//#region src/components/separator/separator.d.ts
|
|
5
4
|
declare const orientations: readonly ["horizontal", "vertical"];
|
|
6
5
|
type Orientation = (typeof orientations)[number];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* @see https://mantle.ngrok.com/components/separator
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```tsx
|
|
15
|
-
* <HorizontalSeparatorGroup>
|
|
16
|
-
* <Separator />
|
|
17
|
-
* <h3>ngrok mantle</h3>
|
|
18
|
-
* <Separator />
|
|
19
|
-
* </HorizontalSeparatorGroup>
|
|
20
|
-
*
|
|
21
|
-
* <HorizontalSeparatorGroup>
|
|
22
|
-
* <h3>ngrok mantle</h3>
|
|
23
|
-
* <Separator />
|
|
24
|
-
* </HorizontalSeparatorGroup>
|
|
25
|
-
*
|
|
26
|
-
* <HorizontalSeparatorGroup>
|
|
27
|
-
* <Separator />
|
|
28
|
-
* <h3>ngrok mantle</h3>
|
|
29
|
-
* </HorizontalSeparatorGroup>
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
declare const HorizontalSeparatorGroup: {
|
|
33
|
-
({
|
|
34
|
-
className,
|
|
35
|
-
children,
|
|
36
|
-
asChild,
|
|
37
|
-
...props
|
|
38
|
-
}: HTMLAttributes<HTMLDivElement> & WithAsChild): import("react").JSX.Element;
|
|
39
|
-
displayName: string;
|
|
40
|
-
};
|
|
6
|
+
declare function HorizontalSeparatorGroup({ className, children, asChild, ...props }: HTMLAttributes<HTMLDivElement> & WithAsChild): import("react").JSX.Element;
|
|
7
|
+
declare namespace HorizontalSeparatorGroup {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
41
10
|
type SeparatorProps = ComponentProps<"div"> & WithAsChild & {
|
|
42
11
|
/**
|
|
43
12
|
* Either `horizontal` or `vertical`.
|
|
@@ -62,7 +31,7 @@ type SeparatorProps = ComponentProps<"div"> & WithAsChild & {
|
|
|
62
31
|
* your own dividers with `bg-separator` / `border-separator` / `divide-separator`
|
|
63
32
|
* so they stay consistent with separators across the system.
|
|
64
33
|
*
|
|
65
|
-
* @see https://mantle.ngrok.com/components/separator
|
|
34
|
+
* @see https://mantle.ngrok.com/components/structure/separator
|
|
66
35
|
*
|
|
67
36
|
* @example
|
|
68
37
|
* ```tsx
|
package/dist/separator.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,t}from"./separator-
|
|
1
|
+
import{n as e,t}from"./separator-kBnnv3Cw.js";export{t as HorizontalSeparatorGroup,e as Separator};
|