@ngrok/mantle 0.70.2 → 0.71.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/alert-dialog.d.ts +337 -90
- package/dist/alert-dialog.js.map +1 -1
- package/dist/alert.js.map +1 -1
- package/dist/anchor-2stEauOz.js.map +1 -1
- package/dist/anchor.d.ts +45 -4
- package/dist/badge.d.ts +32 -3
- package/dist/badge.js.map +1 -1
- package/dist/{button-BMgAxAwM.d.ts → button-Bq0x5Pv4.d.ts} +4 -4
- package/dist/button.d.ts +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/code-block.d.ts +1 -1
- package/dist/code-block_highlight-utils.d.ts +1 -1
- package/dist/code.d.ts +22 -1
- package/dist/code.js.map +1 -1
- package/dist/combobox.d.ts +10 -0
- package/dist/combobox.js.map +1 -1
- package/dist/command.js.map +1 -1
- package/dist/copy-to-clipboard-DjOD_Mwb.js.map +1 -1
- package/dist/data-table.d.ts +303 -22
- package/dist/data-table.js.map +1 -1
- package/dist/dialog-BHzl9eye.js.map +1 -1
- package/dist/dialog.d.ts +6 -1
- package/dist/flag.d.ts +33 -4
- package/dist/flag.js.map +1 -1
- package/dist/hooks.d.ts +299 -74
- package/dist/hooks.js.map +1 -1
- package/dist/hover-card.d.ts +15 -10
- package/dist/hover-card.js.map +1 -1
- package/dist/icons.js.map +1 -1
- package/dist/{index-DMAkXvFI.d.ts → index-C91lxoX9.d.ts} +55 -12
- package/dist/input.d.ts +1 -1
- package/dist/input.js.map +1 -1
- package/dist/kbd-CAVUiqBT.js.map +1 -1
- package/dist/kbd.d.ts +37 -8
- package/dist/label.d.ts +40 -9
- package/dist/label.js.map +1 -1
- package/dist/media-object.d.ts +26 -10
- package/dist/media-object.js.map +1 -1
- package/dist/multi-select.d.ts +185 -34
- package/dist/multi-select.js.map +1 -1
- package/dist/otp-input.d.ts +167 -0
- package/dist/otp-input.js +2 -0
- package/dist/otp-input.js.map +1 -0
- package/dist/pagination.d.ts +1 -1
- package/dist/pagination.js.map +1 -1
- package/dist/popover.d.ts +7 -5
- package/dist/popover.js.map +1 -1
- package/dist/primitive-tXm_8n_t.js.map +1 -1
- package/dist/progress.js.map +1 -1
- package/dist/resolve-pre-rendered-props-C-kiaLHj.js.map +1 -1
- package/dist/{resolve-pre-rendered-props-x-52gvQ1.d.ts → resolve-pre-rendered-props-CNUnH1fU.d.ts} +2 -2
- package/dist/select-DOgdZO0Q.js.map +1 -1
- package/dist/{select-BjpP51vO.d.ts → select-DZutJxyr.d.ts} +9 -1
- package/dist/select.d.ts +1 -1
- package/dist/separator-DSOIrnhj.js.map +1 -1
- package/dist/sheet.d.ts +5 -1
- package/dist/sheet.js.map +1 -1
- package/dist/skeleton.d.ts +32 -5
- package/dist/skeleton.js.map +1 -1
- package/dist/sort-DzCsa6Qj.js.map +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/{table--DsTqaWO.d.ts → table-BsNJBKiq.d.ts} +7 -3
- package/dist/table-Cl4nlRMR.js.map +1 -1
- package/dist/table.d.ts +1 -1
- package/dist/theme-provider-BFcnjeME.js.map +1 -1
- package/dist/theme.d.ts +1 -1
- package/dist/theme.js.map +1 -1
- package/dist/tooltip.d.ts +31 -14
- package/dist/tooltip.js.map +1 -1
- package/dist/use-copy-to-clipboard-C7vsjJe-.js.map +1 -1
- package/dist/use-matches-media-query-CojcYxlA.js.map +1 -1
- package/dist/use-prefers-reduced-motion-aXfsyo-k.js.map +1 -1
- package/package.json +12 -7
package/dist/label.d.ts
CHANGED
|
@@ -2,23 +2,54 @@ import * as _$react from "react";
|
|
|
2
2
|
|
|
3
3
|
//#region src/components/label/label.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* A
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* A caption for a form control — input, checkbox, radio, switch, select.
|
|
6
|
+
* Renders a native `<label>`. Pair every form control with a `Label` so the
|
|
7
|
+
* control has an accessible name, clicks on the label focus the control, and
|
|
8
|
+
* screen readers announce the field correctly.
|
|
9
|
+
*
|
|
10
|
+
* **When to use**
|
|
11
|
+
* - Every visible form control. Always.
|
|
12
|
+
* - Above or beside an input to describe it ("Email", "API key").
|
|
13
|
+
* - Wrapping a checkbox or radio next to its descriptive text.
|
|
14
|
+
*
|
|
15
|
+
* **When not to use**
|
|
16
|
+
* - For static UI text that isn't labeling a control — use a heading or
|
|
17
|
+
* plain `<p>`/`<span>`.
|
|
18
|
+
* - As a substitute for `aria-label` on non-`<input>` widgets that don't
|
|
19
|
+
* support `<label for>` association.
|
|
20
|
+
*
|
|
21
|
+
* **Two ways to associate.** Either wrap the control inside the `<Label>`
|
|
22
|
+
* (implicit association — simplest) or set `htmlFor` to the control's `id`
|
|
23
|
+
* (explicit — required when the control isn't a child).
|
|
24
|
+
*
|
|
25
|
+
* **Disabled state.** Pass `disabled` to render the label in a disabled
|
|
26
|
+
* style. Typically you'll want this to mirror the underlying control's
|
|
27
|
+
* disabled state so the visual treatment stays consistent.
|
|
9
28
|
*
|
|
10
29
|
* @see https://mantle.ngrok.com/components/label
|
|
11
30
|
*
|
|
12
31
|
* @example
|
|
13
32
|
* ```tsx
|
|
14
|
-
*
|
|
15
|
-
*
|
|
33
|
+
* import { Label } from "@ngrok/mantle/label";
|
|
34
|
+
* import { Input } from "@ngrok/mantle/input";
|
|
35
|
+
*
|
|
36
|
+
* // Implicit — control nested inside the label.
|
|
37
|
+
* <Label className="grid gap-1">
|
|
38
|
+
* <span>Email</span>
|
|
39
|
+
* <Input type="email" name="email" />
|
|
16
40
|
* </Label>
|
|
17
41
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* <
|
|
42
|
+
* // Explicit — htmlFor matches the control's id.
|
|
43
|
+
* <div className="grid gap-1">
|
|
44
|
+
* <Label htmlFor="api-key">API key</Label>
|
|
45
|
+
* <Input id="api-key" name="apiKey" />
|
|
21
46
|
* </div>
|
|
47
|
+
*
|
|
48
|
+
* // Inline label for a checkbox.
|
|
49
|
+
* <Label className="flex items-center gap-2">
|
|
50
|
+
* <Checkbox name="terms" />
|
|
51
|
+
* <span>I agree to the terms</span>
|
|
52
|
+
* </Label>
|
|
22
53
|
* ```
|
|
23
54
|
*/
|
|
24
55
|
declare const Label: _$react.ForwardRefExoticComponent<Omit<_$react.DetailedHTMLProps<_$react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
|
package/dist/label.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","names":[],"sources":["../src/components/label/label.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype LabelProps = ComponentPropsWithoutRef<\"label\"> & {\n\t/**\n\t * If set, the label will appear disabled.\n\t */\n\tdisabled?: boolean;\n};\n\n/**\n * A
|
|
1
|
+
{"version":3,"file":"label.js","names":[],"sources":["../src/components/label/label.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ComponentRef } from \"react\";\nimport { cx } from \"../../utils/cx/cx.js\";\n\ntype LabelProps = ComponentPropsWithoutRef<\"label\"> & {\n\t/**\n\t * If set, the label will appear disabled.\n\t */\n\tdisabled?: boolean;\n};\n\n/**\n * A caption for a form control — input, checkbox, radio, switch, select.\n * Renders a native `<label>`. Pair every form control with a `Label` so the\n * control has an accessible name, clicks on the label focus the control, and\n * screen readers announce the field correctly.\n *\n * **When to use**\n * - Every visible form control. Always.\n * - Above or beside an input to describe it (\"Email\", \"API key\").\n * - Wrapping a checkbox or radio next to its descriptive text.\n *\n * **When not to use**\n * - For static UI text that isn't labeling a control — use a heading or\n * plain `<p>`/`<span>`.\n * - As a substitute for `aria-label` on non-`<input>` widgets that don't\n * support `<label for>` association.\n *\n * **Two ways to associate.** Either wrap the control inside the `<Label>`\n * (implicit association — simplest) or set `htmlFor` to the control's `id`\n * (explicit — required when the control isn't a child).\n *\n * **Disabled state.** Pass `disabled` to render the label in a disabled\n * style. Typically you'll want this to mirror the underlying control's\n * disabled state so the visual treatment stays consistent.\n *\n * @see https://mantle.ngrok.com/components/label\n *\n * @example\n * ```tsx\n * import { Label } from \"@ngrok/mantle/label\";\n * import { Input } from \"@ngrok/mantle/input\";\n *\n * // Implicit — control nested inside the label.\n * <Label className=\"grid gap-1\">\n * <span>Email</span>\n * <Input type=\"email\" name=\"email\" />\n * </Label>\n *\n * // Explicit — htmlFor matches the control's id.\n * <div className=\"grid gap-1\">\n * <Label htmlFor=\"api-key\">API key</Label>\n * <Input id=\"api-key\" name=\"apiKey\" />\n * </div>\n *\n * // Inline label for a checkbox.\n * <Label className=\"flex items-center gap-2\">\n * <Checkbox name=\"terms\" />\n * <span>I agree to the terms</span>\n * </Label>\n * ```\n */\nconst Label = forwardRef<ComponentRef<\"label\">, LabelProps>(\n\t(\n\t\t{ \"aria-disabled\": _ariaDisabled, children, className, disabled, onMouseDown, ...props },\n\t\tref,\n\t) => (\n\t\t// biome-ignore lint/a11y/noLabelWithoutControl: this is a composable label component\n\t\t<label\n\t\t\taria-disabled={disabled ?? _ariaDisabled}\n\t\t\tdata-slot=\"label\"\n\t\t\tclassName={cx(\n\t\t\t\t\"text-strong cursor-pointer text-sm peer-disabled:cursor-default has-disabled:cursor-default aria-disabled:cursor-default font-sans\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\tonMouseDown={(event) => {\n\t\t\t\t// only prevent text selection if clicking inside the label itself\n\t\t\t\tconst target = event.target as HTMLElement;\n\t\t\t\tif (target.closest(\"button, input, select, textarea\")) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tonMouseDown?.(event);\n\n\t\t\t\t// prevent text selection when double clicking label\n\t\t\t\tif (!event.defaultPrevented && event.detail > 1) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t}}\n\t\t\tref={ref}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t</label>\n\t),\n);\nLabel.displayName = \"Label\";\n\nexport {\n\t//\n\tLabel,\n};\n"],"mappings":"gHA8DA,MAAM,EAAQ,GAEZ,CAAE,gBAAiB,EAAe,WAAU,YAAW,WAAU,cAAa,GAAG,GACjF,IAGA,EAAC,QAAD,CACC,gBAAe,GAAY,EAC3B,YAAU,QACV,UAAW,EACV,qIACA,EACA,CACD,YAAc,GAAU,CAER,EAAM,OACV,QAAQ,kCAAkC,GAIrD,IAAc,EAAM,CAGhB,CAAC,EAAM,kBAAoB,EAAM,OAAS,GAC7C,EAAM,gBAAgB,GAGnB,MACL,GAAI,EAEH,WACM,CAAA,CAET,CACD,EAAM,YAAc"}
|
package/dist/media-object.d.ts
CHANGED
|
@@ -5,17 +5,30 @@ import { ComponentProps } from "react";
|
|
|
5
5
|
//#region src/components/media-object/media-object.d.ts
|
|
6
6
|
type Props = ComponentProps<"div"> & WithAsChild;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* content
|
|
10
|
-
*
|
|
8
|
+
* A small, reusable layout primitive for "image/icon on one side,
|
|
9
|
+
* descriptive content on the other" — the foundational
|
|
10
|
+
* {@link https://www.stubbornella.org/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/ "media object" pattern}.
|
|
11
|
+
* Use it to compose avatars-with-text, icons-with-copy, thumbnails-with-titles,
|
|
12
|
+
* and similar two-up rows without re-implementing flexbox each time.
|
|
11
13
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
+
* **When to use**
|
|
15
|
+
* - Comment threads (avatar + name + body).
|
|
16
|
+
* - Compact list items (icon + label + secondary text).
|
|
17
|
+
* - Notification rows.
|
|
18
|
+
* - Feature lists, profile cards, attachment previews.
|
|
14
19
|
*
|
|
15
|
-
*
|
|
20
|
+
* **When not to use**
|
|
21
|
+
* - For complex multi-region layouts — reach for {@link https://mantle.ngrok.com/components/card Card} or build a bespoke flex/grid.
|
|
22
|
+
* - When the media is purely decorative and adds no information — drop it
|
|
23
|
+
* and use a plain block.
|
|
16
24
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
25
|
+
* **Spacing & alignment.** Default gap is `gap-4`; override by passing a
|
|
26
|
+
* different `gap-*` class to `MediaObject.Root`. Use standard flex
|
|
27
|
+
* utilities (`items-start`, `items-center`, etc.) to align media and
|
|
28
|
+
* content vertically.
|
|
29
|
+
*
|
|
30
|
+
* **Polymorphism.** Each part accepts `asChild` for swapping the rendered
|
|
31
|
+
* element (e.g. render `Root` as an `<a>` to make the whole row clickable).
|
|
19
32
|
*
|
|
20
33
|
* @see https://mantle.ngrok.com/components/media-object
|
|
21
34
|
*
|
|
@@ -29,12 +42,15 @@ type Props = ComponentProps<"div"> & WithAsChild;
|
|
|
29
42
|
*
|
|
30
43
|
* @example
|
|
31
44
|
* ```tsx
|
|
45
|
+
* import { MediaObject } from "@ngrok/mantle/media-object";
|
|
46
|
+
*
|
|
32
47
|
* <MediaObject.Root>
|
|
33
48
|
* <MediaObject.Media>
|
|
34
|
-
* <
|
|
49
|
+
* <Avatar src={user.avatarUrl} alt="" />
|
|
35
50
|
* </MediaObject.Media>
|
|
36
51
|
* <MediaObject.Content>
|
|
37
|
-
* <p>
|
|
52
|
+
* <p className="font-medium">{user.name}</p>
|
|
53
|
+
* <p className="text-muted text-sm">{comment}</p>
|
|
38
54
|
* </MediaObject.Content>
|
|
39
55
|
* </MediaObject.Root>
|
|
40
56
|
* ```
|
package/dist/media-object.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-object.js","names":[],"sources":["../src/components/media-object/media-object.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Slot } from \"../slot/index.js\";\n\ntype Props = ComponentProps<\"div\"> & WithAsChild;\n\n/**\n * The media object is an image/icon (media) to the left, with descriptive\n * content (title and subtitle/description) to the right. This is the root\n * component of the media object.\n */\nconst Root = forwardRef<HTMLDivElement, Props>(\n\t({ asChild = false, className, children, style }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"media-object\"\n\t\t\t\tclassName={cx(\"flex gap-4\", className)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nRoot.displayName = \"MediaObject\";\n\n/**\n * The container for an image or icon to display in the media slot of the media object.\n */\nconst Media = forwardRef<HTMLDivElement, Props>(\n\t({ asChild = false, className, children, style }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"media-object-media\"\n\t\t\t\tclassName={cx(\"shrink-0 leading-none\", className)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nMedia.displayName = \"MediaObjectMedia\";\n\n/**\n * The container for the content slot of a media object.\n */\nconst Content = forwardRef<HTMLDivElement, Props>(\n\t({ asChild = false, className, children, style }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"media-object-content\"\n\t\t\t\tclassName={cx(\"min-w-0 flex-1\", className)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nContent.displayName = \"MediaObject.Content\";\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"media-object.js","names":[],"sources":["../src/components/media-object/media-object.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\";\nimport { forwardRef } from \"react\";\nimport type { WithAsChild } from \"../../types/as-child.js\";\nimport { cx } from \"../../utils/cx/cx.js\";\nimport { Slot } from \"../slot/index.js\";\n\ntype Props = ComponentProps<\"div\"> & WithAsChild;\n\n/**\n * The media object is an image/icon (media) to the left, with descriptive\n * content (title and subtitle/description) to the right. This is the root\n * component of the media object.\n */\nconst Root = forwardRef<HTMLDivElement, Props>(\n\t({ asChild = false, className, children, style }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"media-object\"\n\t\t\t\tclassName={cx(\"flex gap-4\", className)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nRoot.displayName = \"MediaObject\";\n\n/**\n * The container for an image or icon to display in the media slot of the media object.\n */\nconst Media = forwardRef<HTMLDivElement, Props>(\n\t({ asChild = false, className, children, style }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"media-object-media\"\n\t\t\t\tclassName={cx(\"shrink-0 leading-none\", className)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nMedia.displayName = \"MediaObjectMedia\";\n\n/**\n * The container for the content slot of a media object.\n */\nconst Content = forwardRef<HTMLDivElement, Props>(\n\t({ asChild = false, className, children, style }, ref) => {\n\t\tconst Component = asChild ? Slot : \"div\";\n\n\t\treturn (\n\t\t\t<Component\n\t\t\t\tref={ref}\n\t\t\t\tdata-slot=\"media-object-content\"\n\t\t\t\tclassName={cx(\"min-w-0 flex-1\", className)}\n\t\t\t\tstyle={style}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</Component>\n\t\t);\n\t},\n);\nContent.displayName = \"MediaObject.Content\";\n\n/**\n * A small, reusable layout primitive for \"image/icon on one side,\n * descriptive content on the other\" — the foundational\n * {@link https://www.stubbornella.org/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/ \"media object\" pattern}.\n * Use it to compose avatars-with-text, icons-with-copy, thumbnails-with-titles,\n * and similar two-up rows without re-implementing flexbox each time.\n *\n * **When to use**\n * - Comment threads (avatar + name + body).\n * - Compact list items (icon + label + secondary text).\n * - Notification rows.\n * - Feature lists, profile cards, attachment previews.\n *\n * **When not to use**\n * - For complex multi-region layouts — reach for {@link https://mantle.ngrok.com/components/card Card} or build a bespoke flex/grid.\n * - When the media is purely decorative and adds no information — drop it\n * and use a plain block.\n *\n * **Spacing & alignment.** Default gap is `gap-4`; override by passing a\n * different `gap-*` class to `MediaObject.Root`. Use standard flex\n * utilities (`items-start`, `items-center`, etc.) to align media and\n * content vertically.\n *\n * **Polymorphism.** Each part accepts `asChild` for swapping the rendered\n * element (e.g. render `Root` as an `<a>` to make the whole row clickable).\n *\n * @see https://mantle.ngrok.com/components/media-object\n *\n * @example\n * Composition:\n * ```\n * MediaObject.Root\n * ├── MediaObject.Media\n * └── MediaObject.Content\n * ```\n *\n * @example\n * ```tsx\n * import { MediaObject } from \"@ngrok/mantle/media-object\";\n *\n * <MediaObject.Root>\n * <MediaObject.Media>\n * <Avatar src={user.avatarUrl} alt=\"\" />\n * </MediaObject.Media>\n * <MediaObject.Content>\n * <p className=\"font-medium\">{user.name}</p>\n * <p className=\"text-muted text-sm\">{comment}</p>\n * </MediaObject.Content>\n * </MediaObject.Root>\n * ```\n */\nconst MediaObject = {\n\t/**\n\t * The media object is an image/icon (media) to the left, with descriptive\n\t * content (title and subtitle/description) to the right. This is the root\n\t * component of the media object.\n\t *\n\t * Change the spacing between the media and content by passing a `gap-*` class.\n\t * The default gap is `gap-4`.\n\t *\n\t * Use flexbox utilities to change the alignment of the media and content.\n\t *\n\t * Compose the media object with the `MediaObject.Media` and `MediaObject.Content`\n\t * components as direct children.\n\t *\n\t * @see https://mantle.ngrok.com/components/media-object#mediaobjectroot\n\t *\n\t * @example\n\t * ```tsx\n\t * <MediaObject.Root>\n\t * <MediaObject.Media>\n\t * <ExampleMedia />\n\t * </MediaObject.Media>\n\t * <MediaObject.Content>\n\t * <p>Ea culpa id id ea minim labore.</p>\n\t * </MediaObject.Content>\n\t * </MediaObject.Root>\n\t * ```\n\t */\n\tRoot,\n\t/**\n\t * The container for an image or icon to display in the media slot of the media object.\n\t *\n\t * @see https://mantle.ngrok.com/components/media-object#mediaobjectmedia\n\t *\n\t * @example\n\t * ```tsx\n\t * <MediaObject.Root>\n\t * <MediaObject.Media>\n\t * <ExampleMedia />\n\t * </MediaObject.Media>\n\t * <MediaObject.Content>\n\t * <p>Ea culpa id id ea minim labore.</p>\n\t * </MediaObject.Content>\n\t * </MediaObject.Root>\n\t * ```\n\t */\n\tMedia,\n\t/**\n\t * The container for the content slot of a media object.\n\t *\n\t * @see https://mantle.ngrok.com/components/media-object#mediaobjectcontent\n\t *\n\t * @example\n\t * ```tsx\n\t * <MediaObject.Root>\n\t * <MediaObject.Media>\n\t * <ExampleMedia />\n\t * </MediaObject.Media>\n\t * <MediaObject.Content>\n\t * <p>Ea culpa id id ea minim labore.</p>\n\t * </MediaObject.Content>\n\t * </MediaObject.Root>\n\t * ```\n\t */\n\tContent,\n} as const;\n\nexport {\n\t//,\n\tMediaObject,\n};\n"],"mappings":"kJAaA,MAAM,EAAO,GACX,CAAE,UAAU,GAAO,YAAW,WAAU,SAAS,IAIhD,EAHiB,EAAU,EAAO,MAGlC,CACM,MACL,YAAU,eACV,UAAW,EAAG,aAAc,EAAU,CAC/B,QAEN,WACU,CAAA,CAGd,CACD,EAAK,YAAc,cAKnB,MAAM,EAAQ,GACZ,CAAE,UAAU,GAAO,YAAW,WAAU,SAAS,IAIhD,EAHiB,EAAU,EAAO,MAGlC,CACM,MACL,YAAU,qBACV,UAAW,EAAG,wBAAyB,EAAU,CAC1C,QAEN,WACU,CAAA,CAGd,CACD,EAAM,YAAc,mBAKpB,MAAM,EAAU,GACd,CAAE,UAAU,GAAO,YAAW,WAAU,SAAS,IAIhD,EAHiB,EAAU,EAAO,MAGlC,CACM,MACL,YAAU,uBACV,UAAW,EAAG,iBAAkB,EAAU,CACnC,QAEN,WACU,CAAA,CAGd,CACD,EAAQ,YAAc,sBAqDtB,MAAM,EAAc,CA4BnB,OAkBA,QAkBA,UACA"}
|
package/dist/multi-select.d.ts
CHANGED
|
@@ -80,6 +80,11 @@ type MultiSelectGroupLabelProps = Omit<Primitive.ComboboxGroupLabelProps, "rende
|
|
|
80
80
|
* Built on top of Ariakit's Combobox primitives with full keyboard support
|
|
81
81
|
* and WAI-ARIA compliance.
|
|
82
82
|
*
|
|
83
|
+
* Use MultiSelect when the user can choose multiple values from a list, with selected
|
|
84
|
+
* items rendered as removable tags/chips. For single selection, use Combobox (with search)
|
|
85
|
+
* or Select (without).
|
|
86
|
+
*
|
|
87
|
+
* @see https://mantle.ngrok.com/components/multi-select
|
|
83
88
|
* @see https://www.w3.org/WAI/ARIA/apg/patterns/combobox/
|
|
84
89
|
* @see https://ariakit.org/components/combobox
|
|
85
90
|
*
|
|
@@ -120,6 +125,12 @@ declare const MultiSelect: {
|
|
|
120
125
|
* Root component for a multi-select combobox. Provides state management for
|
|
121
126
|
* selecting multiple values with typeahead filtering.
|
|
122
127
|
*
|
|
128
|
+
* Use MultiSelect when the user can choose multiple values from a list, with selected
|
|
129
|
+
* items rendered as removable tags/chips. For single selection, use Combobox (with search)
|
|
130
|
+
* or Select (without).
|
|
131
|
+
*
|
|
132
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectroot
|
|
133
|
+
*
|
|
123
134
|
* @example
|
|
124
135
|
* ```tsx
|
|
125
136
|
* <MultiSelect.Root>
|
|
@@ -145,12 +156,19 @@ declare const MultiSelect: {
|
|
|
145
156
|
* The trigger container for the multi-select. Wraps the tags and input
|
|
146
157
|
* in a styled container.
|
|
147
158
|
*
|
|
159
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselecttrigger
|
|
160
|
+
*
|
|
148
161
|
* @example
|
|
149
162
|
* ```tsx
|
|
150
|
-
* <MultiSelect.
|
|
151
|
-
* <MultiSelect.
|
|
152
|
-
*
|
|
153
|
-
*
|
|
163
|
+
* <MultiSelect.Root>
|
|
164
|
+
* <MultiSelect.Trigger>
|
|
165
|
+
* <MultiSelect.TagValues />
|
|
166
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
167
|
+
* </MultiSelect.Trigger>
|
|
168
|
+
* <MultiSelect.Content>
|
|
169
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
170
|
+
* </MultiSelect.Content>
|
|
171
|
+
* </MultiSelect.Root>
|
|
154
172
|
* ```
|
|
155
173
|
*/
|
|
156
174
|
readonly Trigger: _$react.ForwardRefExoticComponent<Omit<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & WithValidation & _$react.RefAttributes<HTMLDivElement>>;
|
|
@@ -161,17 +179,35 @@ declare const MultiSelect: {
|
|
|
161
179
|
* Use `lockedValues` to prevent specific tags from being removed. Locked tags
|
|
162
180
|
* have their remove button disabled and shake when Backspace is pressed.
|
|
163
181
|
*
|
|
182
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselecttagvalues
|
|
183
|
+
*
|
|
164
184
|
* @example
|
|
165
185
|
* ```tsx
|
|
166
|
-
*
|
|
167
|
-
*
|
|
186
|
+
* <MultiSelect.Root>
|
|
187
|
+
* <MultiSelect.Trigger>
|
|
188
|
+
* <MultiSelect.TagValues lockedValues={["global"]} />
|
|
189
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
190
|
+
* </MultiSelect.Trigger>
|
|
191
|
+
* <MultiSelect.Content>
|
|
192
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
193
|
+
* </MultiSelect.Content>
|
|
194
|
+
* </MultiSelect.Root>
|
|
195
|
+
* ```
|
|
168
196
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
197
|
+
* @example
|
|
198
|
+
* Custom tags via children render function — `locked` is forwarded via props.
|
|
199
|
+
* ```tsx
|
|
200
|
+
* <MultiSelect.Root>
|
|
201
|
+
* <MultiSelect.Trigger>
|
|
202
|
+
* <MultiSelect.TagValues lockedValues={["global"]}>
|
|
203
|
+
* {(props) => <MultiSelect.Tag key={props.value} {...props} />}
|
|
204
|
+
* </MultiSelect.TagValues>
|
|
205
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
206
|
+
* </MultiSelect.Trigger>
|
|
207
|
+
* <MultiSelect.Content>
|
|
208
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
209
|
+
* </MultiSelect.Content>
|
|
210
|
+
* </MultiSelect.Root>
|
|
175
211
|
* ```
|
|
176
212
|
*/
|
|
177
213
|
readonly TagValues: {
|
|
@@ -185,9 +221,19 @@ declare const MultiSelect: {
|
|
|
185
221
|
* The combobox input for filtering items. Place this inside
|
|
186
222
|
* `MultiSelect.Trigger`, after `MultiSelect.TagValues`.
|
|
187
223
|
*
|
|
224
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectinput
|
|
225
|
+
*
|
|
188
226
|
* @example
|
|
189
227
|
* ```tsx
|
|
190
|
-
* <MultiSelect.
|
|
228
|
+
* <MultiSelect.Root>
|
|
229
|
+
* <MultiSelect.Trigger>
|
|
230
|
+
* <MultiSelect.TagValues />
|
|
231
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
232
|
+
* </MultiSelect.Trigger>
|
|
233
|
+
* <MultiSelect.Content>
|
|
234
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
235
|
+
* </MultiSelect.Content>
|
|
236
|
+
* </MultiSelect.Root>
|
|
191
237
|
* ```
|
|
192
238
|
*/
|
|
193
239
|
readonly Input: _$react.ForwardRefExoticComponent<Omit<MultiSelectInputProps, "ref"> & _$react.RefAttributes<HTMLInputElement>>;
|
|
@@ -195,23 +241,41 @@ declare const MultiSelect: {
|
|
|
195
241
|
* The default tag rendered inside `MultiSelect.TagValues` for each selected value.
|
|
196
242
|
* Displays the value label with a remove button and keyboard navigation support.
|
|
197
243
|
*
|
|
244
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselecttag
|
|
245
|
+
*
|
|
198
246
|
* @example
|
|
199
247
|
* ```tsx
|
|
200
|
-
* <MultiSelect.
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
* />
|
|
248
|
+
* <MultiSelect.Root>
|
|
249
|
+
* <MultiSelect.Trigger>
|
|
250
|
+
* <MultiSelect.TagValues>
|
|
251
|
+
* {(props) => <MultiSelect.Tag key={props.value} {...props} />}
|
|
252
|
+
* </MultiSelect.TagValues>
|
|
253
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
254
|
+
* </MultiSelect.Trigger>
|
|
255
|
+
* <MultiSelect.Content>
|
|
256
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
257
|
+
* </MultiSelect.Content>
|
|
258
|
+
* </MultiSelect.Root>
|
|
204
259
|
* ```
|
|
205
260
|
*/
|
|
206
261
|
readonly Tag: _$react.ForwardRefExoticComponent<Omit<TagProps, "ref"> & _$react.RefAttributes<HTMLSpanElement>>;
|
|
207
262
|
/**
|
|
208
263
|
* Renders a popover that contains multi-select content.
|
|
209
264
|
*
|
|
265
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectcontent
|
|
266
|
+
*
|
|
210
267
|
* @example
|
|
211
268
|
* ```tsx
|
|
212
|
-
* <MultiSelect.
|
|
213
|
-
* <MultiSelect.
|
|
214
|
-
*
|
|
269
|
+
* <MultiSelect.Root>
|
|
270
|
+
* <MultiSelect.Trigger>
|
|
271
|
+
* <MultiSelect.TagValues />
|
|
272
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
273
|
+
* </MultiSelect.Trigger>
|
|
274
|
+
* <MultiSelect.Content>
|
|
275
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
276
|
+
* <MultiSelect.Item value="banana">Banana</MultiSelect.Item>
|
|
277
|
+
* </MultiSelect.Content>
|
|
278
|
+
* </MultiSelect.Root>
|
|
215
279
|
* ```
|
|
216
280
|
*/
|
|
217
281
|
readonly Content: _$react.ForwardRefExoticComponent<Omit<MultiSelectContentProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
|
|
@@ -219,61 +283,136 @@ declare const MultiSelect: {
|
|
|
219
283
|
* Renders a sticky footer pinned to the bottom inside `MultiSelect.Content`,
|
|
220
284
|
* with a separator border at the top.
|
|
221
285
|
*
|
|
286
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectcontentfooter
|
|
287
|
+
*
|
|
222
288
|
* @example
|
|
223
289
|
* ```tsx
|
|
224
|
-
* <MultiSelect.
|
|
225
|
-
* <
|
|
226
|
-
*
|
|
290
|
+
* <MultiSelect.Root>
|
|
291
|
+
* <MultiSelect.Trigger>
|
|
292
|
+
* <MultiSelect.TagValues />
|
|
293
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
294
|
+
* </MultiSelect.Trigger>
|
|
295
|
+
* <MultiSelect.Content>
|
|
296
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
297
|
+
* <MultiSelect.ContentFooter>
|
|
298
|
+
* <p>Upgrade to unlock more options.</p>
|
|
299
|
+
* </MultiSelect.ContentFooter>
|
|
300
|
+
* </MultiSelect.Content>
|
|
301
|
+
* </MultiSelect.Root>
|
|
227
302
|
* ```
|
|
228
303
|
*/
|
|
229
304
|
readonly ContentFooter: _$react.ForwardRefExoticComponent<Omit<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
|
|
230
305
|
/**
|
|
231
306
|
* Renders a selectable item with a checkbox indicator inside a `MultiSelect.Content`.
|
|
232
307
|
*
|
|
308
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectitem
|
|
309
|
+
*
|
|
233
310
|
* @example
|
|
234
311
|
* ```tsx
|
|
235
|
-
* <MultiSelect.
|
|
312
|
+
* <MultiSelect.Root>
|
|
313
|
+
* <MultiSelect.Trigger>
|
|
314
|
+
* <MultiSelect.TagValues />
|
|
315
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
316
|
+
* </MultiSelect.Trigger>
|
|
317
|
+
* <MultiSelect.Content>
|
|
318
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
319
|
+
* <MultiSelect.Item value="banana">Banana</MultiSelect.Item>
|
|
320
|
+
* </MultiSelect.Content>
|
|
321
|
+
* </MultiSelect.Root>
|
|
236
322
|
* ```
|
|
237
323
|
*/
|
|
238
324
|
readonly Item: _$react.ForwardRefExoticComponent<Omit<MultiSelectItemProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
|
|
239
325
|
/**
|
|
240
326
|
* Renders a group for MultiSelect.Item elements.
|
|
241
327
|
*
|
|
328
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectgroup
|
|
329
|
+
*
|
|
242
330
|
* @example
|
|
243
331
|
* ```tsx
|
|
244
|
-
* <MultiSelect.
|
|
245
|
-
* <MultiSelect.
|
|
246
|
-
*
|
|
247
|
-
*
|
|
332
|
+
* <MultiSelect.Root>
|
|
333
|
+
* <MultiSelect.Trigger>
|
|
334
|
+
* <MultiSelect.TagValues />
|
|
335
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
336
|
+
* </MultiSelect.Trigger>
|
|
337
|
+
* <MultiSelect.Content>
|
|
338
|
+
* <MultiSelect.Group>
|
|
339
|
+
* <MultiSelect.GroupLabel>Fruits</MultiSelect.GroupLabel>
|
|
340
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
341
|
+
* </MultiSelect.Group>
|
|
342
|
+
* </MultiSelect.Content>
|
|
343
|
+
* </MultiSelect.Root>
|
|
248
344
|
* ```
|
|
249
345
|
*/
|
|
250
346
|
readonly Group: _$react.ForwardRefExoticComponent<Omit<MultiSelectGroupProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
|
|
251
347
|
/**
|
|
252
348
|
* Renders a label in a multi-select group.
|
|
253
349
|
*
|
|
350
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectgrouplabel
|
|
351
|
+
*
|
|
254
352
|
* @example
|
|
255
353
|
* ```tsx
|
|
256
|
-
* <MultiSelect.
|
|
354
|
+
* <MultiSelect.Root>
|
|
355
|
+
* <MultiSelect.Trigger>
|
|
356
|
+
* <MultiSelect.TagValues />
|
|
357
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
358
|
+
* </MultiSelect.Trigger>
|
|
359
|
+
* <MultiSelect.Content>
|
|
360
|
+
* <MultiSelect.Group>
|
|
361
|
+
* <MultiSelect.GroupLabel>Fruits</MultiSelect.GroupLabel>
|
|
362
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
363
|
+
* </MultiSelect.Group>
|
|
364
|
+
* </MultiSelect.Content>
|
|
365
|
+
* </MultiSelect.Root>
|
|
257
366
|
* ```
|
|
258
367
|
*/
|
|
259
368
|
readonly GroupLabel: _$react.ForwardRefExoticComponent<Omit<MultiSelectGroupLabelProps, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
|
|
260
369
|
/**
|
|
261
370
|
* Renders a description below a `MultiSelect.GroupLabel` inside a `MultiSelect.Group`.
|
|
262
371
|
*
|
|
372
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectgroupdescription
|
|
373
|
+
*
|
|
263
374
|
* @example
|
|
264
375
|
* ```tsx
|
|
265
|
-
* <MultiSelect.
|
|
266
|
-
*
|
|
267
|
-
*
|
|
376
|
+
* <MultiSelect.Root>
|
|
377
|
+
* <MultiSelect.Trigger>
|
|
378
|
+
* <MultiSelect.TagValues />
|
|
379
|
+
* <MultiSelect.Input placeholder="Select regions..." />
|
|
380
|
+
* </MultiSelect.Trigger>
|
|
381
|
+
* <MultiSelect.Content>
|
|
382
|
+
* <MultiSelect.Group>
|
|
383
|
+
* <MultiSelect.GroupLabel>Regional Aliases</MultiSelect.GroupLabel>
|
|
384
|
+
* <MultiSelect.GroupDescription>
|
|
385
|
+
* Include all points of presence within the region.
|
|
386
|
+
* </MultiSelect.GroupDescription>
|
|
387
|
+
* <MultiSelect.Item value="global">global</MultiSelect.Item>
|
|
388
|
+
* </MultiSelect.Group>
|
|
389
|
+
* </MultiSelect.Content>
|
|
390
|
+
* </MultiSelect.Root>
|
|
268
391
|
* ```
|
|
269
392
|
*/
|
|
270
393
|
readonly GroupDescription: _$react.ForwardRefExoticComponent<Omit<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & _$react.RefAttributes<HTMLParagraphElement>>;
|
|
271
394
|
/**
|
|
272
395
|
* Renders a separator between items or groups.
|
|
273
396
|
*
|
|
397
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectseparator
|
|
398
|
+
*
|
|
274
399
|
* @example
|
|
275
400
|
* ```tsx
|
|
276
|
-
* <MultiSelect.
|
|
401
|
+
* <MultiSelect.Root>
|
|
402
|
+
* <MultiSelect.Trigger>
|
|
403
|
+
* <MultiSelect.TagValues />
|
|
404
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
405
|
+
* </MultiSelect.Trigger>
|
|
406
|
+
* <MultiSelect.Content>
|
|
407
|
+
* <MultiSelect.Group>
|
|
408
|
+
* <MultiSelect.Item value="apple">Apple</MultiSelect.Item>
|
|
409
|
+
* </MultiSelect.Group>
|
|
410
|
+
* <MultiSelect.Separator />
|
|
411
|
+
* <MultiSelect.Group>
|
|
412
|
+
* <MultiSelect.Item value="carrot">Carrot</MultiSelect.Item>
|
|
413
|
+
* </MultiSelect.Group>
|
|
414
|
+
* </MultiSelect.Content>
|
|
415
|
+
* </MultiSelect.Root>
|
|
277
416
|
* ```
|
|
278
417
|
*/
|
|
279
418
|
readonly Separator: _$react.ForwardRefExoticComponent<Omit<Omit<_$react.ClassAttributes<HTMLDivElement> & _$react.HTMLAttributes<HTMLDivElement> & WithAsChild & {
|
|
@@ -283,9 +422,21 @@ declare const MultiSelect: {
|
|
|
283
422
|
/**
|
|
284
423
|
* Renders a message when no items match the current filter.
|
|
285
424
|
*
|
|
425
|
+
* @see https://mantle.ngrok.com/components/multi-select#multiselectempty
|
|
426
|
+
*
|
|
286
427
|
* @example
|
|
287
428
|
* ```tsx
|
|
288
|
-
* <MultiSelect.
|
|
429
|
+
* <MultiSelect.Root>
|
|
430
|
+
* <MultiSelect.Trigger>
|
|
431
|
+
* <MultiSelect.TagValues />
|
|
432
|
+
* <MultiSelect.Input placeholder="Select items..." />
|
|
433
|
+
* </MultiSelect.Trigger>
|
|
434
|
+
* <MultiSelect.Content>
|
|
435
|
+
* {matches.length === 0 && (
|
|
436
|
+
* <MultiSelect.Empty>No results found</MultiSelect.Empty>
|
|
437
|
+
* )}
|
|
438
|
+
* </MultiSelect.Content>
|
|
439
|
+
* </MultiSelect.Root>
|
|
289
440
|
* ```
|
|
290
441
|
*/
|
|
291
442
|
readonly Empty: _$react.ForwardRefExoticComponent<Omit<_$react.DetailedHTMLProps<_$react.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & _$react.RefAttributes<HTMLDivElement>>;
|