@gears-frontx/ui-kit 0.3.0-alpha.1 → 0.3.0-alpha.3
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 +15 -0
- package/dist/badge.js +40 -19
- package/dist/badge.js.map +1 -1
- package/dist/button.js +40 -40
- package/dist/button.js.map +1 -1
- package/dist/checkbox.js +5 -5
- package/dist/chunks/badge.BcdxDzJ7.css +1 -0
- package/dist/chunks/button.DNo8DTR3.css +1 -0
- package/dist/chunks/checkbox.D3kdAalh.css +1 -0
- package/dist/chunks/input.C8RDCC-a.css +1 -0
- package/dist/chunks/radio-group.zAFY9yCF.css +1 -0
- package/dist/chunks/select.Dt0diN4P.css +1 -0
- package/dist/chunks/switch.CsaIRnCA.css +1 -0
- package/dist/chunks/{table.r8ppNt1W.css → table.BuWHXL6e.css} +1 -1
- package/dist/chunks/tabs.KEksCAxN.css +1 -0
- package/dist/chunks/{textarea.BKWvs6fD.css → textarea.N3iiWUuz.css} +1 -1
- package/dist/chunks/toast.DMUpK07T.css +1 -0
- package/dist/components/badge/badge.d.ts +14 -2
- package/dist/components/badge/badge.d.ts.map +1 -1
- package/dist/components/button/button.d.ts.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/components/input/input.d.ts +17 -1
- package/dist/components/input/input.d.ts.map +1 -1
- package/dist/components/select/select.d.ts +2 -2
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/toast/toast.d.ts.map +1 -1
- package/dist/docs/badge.md +22 -8
- package/dist/docs/button.md +43 -8
- package/dist/docs/input.md +32 -6
- package/dist/docs/select.md +13 -9
- package/dist/dropdown-menu.js +42 -41
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/input.js +27 -21
- package/dist/input.js.map +1 -1
- package/dist/radio-group.js +8 -8
- package/dist/select.js +57 -65
- package/dist/select.js.map +1 -1
- package/dist/switch.js +8 -8
- package/dist/table.js +33 -33
- package/dist/tabs.js +20 -20
- package/dist/textarea.js +4 -4
- package/dist/theme.css +31 -6
- package/dist/toast.js +61 -60
- package/dist/toast.js.map +1 -1
- package/llms.txt +32 -17
- package/package.json +2 -1
- package/dist/chunks/badge.ej-3-Xs4.css +0 -1
- package/dist/chunks/button.CKfALaMe.css +0 -1
- package/dist/chunks/checkbox.Dd6YDr20.css +0 -1
- package/dist/chunks/input.CrRQ0OAn.css +0 -1
- package/dist/chunks/radio-group.1Y6B0lXt.css +0 -1
- package/dist/chunks/select.BmyP2S2q.css +0 -1
- package/dist/chunks/switch.B_ebMSxR.css +0 -1
- package/dist/chunks/tabs.DqJE9cX3.css +0 -1
- package/dist/chunks/toast.DMl31Mq4.css +0 -1
package/dist/docs/badge.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Badge
|
|
2
2
|
|
|
3
|
-
A status label:
|
|
4
|
-
pill or a bare
|
|
3
|
+
A status label: an intent-colored caption with an optional status dot or
|
|
4
|
+
icon, as a soft pill or a bare label. Badge has no Base UI primitive — it's a
|
|
5
5
|
styled `span`, plus a `render` prop (via Base UI's `useRender`/`mergeProps`
|
|
6
6
|
utilities) for the one case that needs it: rendering as a link.
|
|
7
7
|
|
|
@@ -19,10 +19,11 @@ orange is a misuse, not a style choice.
|
|
|
19
19
|
`beta`/`new` → `info`, anything neutral (`draft`, `archived`, a count,
|
|
20
20
|
a category) → `muted`.
|
|
21
21
|
- `shape="pill"` (default) on busy surfaces where the label needs its own
|
|
22
|
-
soft fill; `shape="
|
|
23
|
-
would be noise
|
|
22
|
+
soft fill; `shape="plain"` inline with text or in dense tables where a
|
|
23
|
+
fill would be noise. Add `dot` when the state deserves a colored marker,
|
|
24
|
+
or pass `icon` for a more specific one — neither renders by default.
|
|
24
25
|
- A clickable status filter — pass `render={<a href="..." />}`. The pill's
|
|
25
|
-
fill deepens on hover and the
|
|
26
|
+
fill deepens on hover and the plain shape underlines, but only when actually
|
|
26
27
|
rendered as a link; a plain badge stays visually inert and never looks
|
|
27
28
|
clickable when it isn't. The kit's focus ring appears automatically once
|
|
28
29
|
the anchor receives keyboard focus. Give it discernible text — a badge
|
|
@@ -41,7 +42,9 @@ orange is a misuse, not a style choice.
|
|
|
41
42
|
| Prop | Type | Default |
|
|
42
43
|
|------|------|---------|
|
|
43
44
|
| `variant` | `success` \| `warning` \| `info` \| `danger` \| `muted` | `muted` |
|
|
44
|
-
| `shape` | `pill` \| `
|
|
45
|
+
| `shape` | `pill` \| `plain` | `pill` |
|
|
46
|
+
| `dot` | `boolean` — show the status dot in the variant's accent color; ignored when `icon` is set | `false` |
|
|
47
|
+
| `icon` | `ReactNode` — leading icon, decorative (`aria-hidden`), 12px, accent-colored; replaces the dot | — |
|
|
45
48
|
| `render` | `ReactElement` — replaces the root `span`, e.g. with an `<a>` | — |
|
|
46
49
|
| `className` | `string` — merged after the variant/shape classes | — |
|
|
47
50
|
|
|
@@ -61,8 +64,14 @@ import { Badge } from '@gears-frontx/ui-kit';
|
|
|
61
64
|
<Badge variant="info">Beta</Badge>
|
|
62
65
|
<Badge>Draft</Badge> // muted is the default variant
|
|
63
66
|
|
|
64
|
-
//
|
|
65
|
-
<Badge variant="success"
|
|
67
|
+
// Status dot is opt-in
|
|
68
|
+
<Badge variant="success" dot>Running</Badge>
|
|
69
|
+
|
|
70
|
+
// Bare label for dense/inline placements (dot optional there too)
|
|
71
|
+
<Badge variant="success" shape="plain" dot>Online</Badge>
|
|
72
|
+
|
|
73
|
+
// A custom marker instead of the dot
|
|
74
|
+
<Badge variant="info" icon={<BetaIcon />}>Beta</Badge>
|
|
66
75
|
|
|
67
76
|
// A badge that is actually a link — hover feedback only applies here
|
|
68
77
|
<Badge variant="info" render={<a href="/filters/open" />}>
|
|
@@ -80,3 +89,8 @@ import { Badge } from '@gears-frontx/ui-kit';
|
|
|
80
89
|
appears when the badge actually renders as a link via `render`.
|
|
81
90
|
- Do not nest interactive controls inside a Badge — it is a label, not a
|
|
82
91
|
container.
|
|
92
|
+
- Do not pass both `icon` and `dot` expecting both to render — `icon`
|
|
93
|
+
replaces the dot by design.
|
|
94
|
+
- Do not drop an icon into Badge's children (`<Badge><Icon />label</Badge>`)
|
|
95
|
+
— the kit no longer sizes a bare svg child; use the `icon` prop, which is
|
|
96
|
+
sized and accent-colored automatically.
|
package/dist/docs/button.md
CHANGED
|
@@ -36,6 +36,42 @@ polymorphism, correct disabled/focus behavior, `type="button"` by default
|
|
|
36
36
|
All other props are native `<button>` props (`onClick`, `disabled`, `type`,
|
|
37
37
|
`aria-*`, ...) and are forwarded as-is.
|
|
38
38
|
|
|
39
|
+
## Custom colors
|
|
40
|
+
|
|
41
|
+
Variant colors are consumed through CSS custom properties, so a one-off
|
|
42
|
+
brand/status button is a consumer class away — no new variant needed:
|
|
43
|
+
|
|
44
|
+
| Property | Drives |
|
|
45
|
+
|----------|--------|
|
|
46
|
+
| `--button-bg` / `--button-fg` | fill / text at rest |
|
|
47
|
+
| `--button-bg-hover` / `--button-fg-hover` | fill / text on hover |
|
|
48
|
+
| `--button-border` | border color on every variant (transparent by default outside `outline`) |
|
|
49
|
+
|
|
50
|
+
```css
|
|
51
|
+
.buy { --button-bg: var(--success); --button-bg-hover: color-mix(in oklab, var(--success) 90%, var(--foreground) 10%); --button-fg: var(--primary-foreground); }
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```tsx
|
|
55
|
+
<Button className={styles.buy}>Buy now</Button>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Setting only `--button-bg` keeps the button that color in EVERY state
|
|
59
|
+
(hover falls back to your rest color, never back to the variant's token);
|
|
60
|
+
add `--button-bg-hover` to restore hover feedback. Contrast is yours to
|
|
61
|
+
keep once you override: check your pairs against WCAG like the kit does
|
|
62
|
+
for its own variants, and give the focus ring the same care via
|
|
63
|
+
`--button-focus-ring` (see Anti-patterns) — it is drawn outside the button
|
|
64
|
+
as an `outline`, so only one tone is needed; it only ever borders the page
|
|
65
|
+
background, never your custom fill.
|
|
66
|
+
|
|
67
|
+
These properties are inherited custom properties and `.button` never resets
|
|
68
|
+
them, so where you set them matters: on the button's own class (`.buy`
|
|
69
|
+
above) it recolors that one button; on a container it themes every Button
|
|
70
|
+
underneath, including ones you didn't mean to touch — a clear button
|
|
71
|
+
sitting in an Input's `end` slot inside that container, for instance. Use
|
|
72
|
+
container-level scoping deliberately, or scope to the button itself to
|
|
73
|
+
avoid the surprise.
|
|
74
|
+
|
|
39
75
|
Icon-only is derived, not a size: `icon` with no children renders a square
|
|
40
76
|
button of the current `size`. There is no `size="icon"`.
|
|
41
77
|
|
|
@@ -83,14 +119,13 @@ import { Button } from '@gears-frontx/ui-kit';
|
|
|
83
119
|
|
|
84
120
|
## Anti-patterns
|
|
85
121
|
|
|
86
|
-
- Do not restyle via inline `style` or ad-hoc CSS
|
|
87
|
-
the theme tokens (`theme.css`
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
properties together when rebranding either variant's ring.
|
|
122
|
+
- Do not restyle via inline `style` or ad-hoc CSS rules against the kit's
|
|
123
|
+
classes — kit-wide brand changes belong in the theme tokens (`theme.css`
|
|
124
|
+
CSS variables), one-off button colors in the `--button-*` properties
|
|
125
|
+
above. If you rebrand the focus ring specifically via
|
|
126
|
+
`--button-focus-ring`, check your color against WCAG 1.4.11's 3:1 floor
|
|
127
|
+
on `--background` — the only surface the ring touches, since it is drawn
|
|
128
|
+
outside the button as an `outline` rather than on its edge.
|
|
94
129
|
- Do not put an icon in `children` next to text — it lands in the `icon`
|
|
95
130
|
slot, which is what sizes it, spaces it, hides it during `loading`, and
|
|
96
131
|
keeps it out of the accessible name.
|
package/dist/docs/input.md
CHANGED
|
@@ -23,16 +23,34 @@ error, validation state) when rendered inside one.
|
|
|
23
23
|
|------|------|---------|
|
|
24
24
|
| `value` / `defaultValue` | controlled / uncontrolled value | — |
|
|
25
25
|
| `onValueChange` | `(value: string, eventDetails) => void` — fires on every change | — |
|
|
26
|
+
| `icon` | `ReactNode` — leading icon slot, decorative (`aria-hidden`, no pointer events); pair with the right native `type` for semantics | — |
|
|
27
|
+
| `end` | `ReactNode` — trailing slot for live content (icon-button, adornment); rendered after the input, sized for an icon or a compact `size="sm"` icon-only Button | — |
|
|
26
28
|
| `className` | `string` — merged after the kit class | — |
|
|
27
29
|
|
|
28
30
|
All other props are native `<input>` props (`type`, `placeholder`,
|
|
29
31
|
`disabled`, `required`, `aria-invalid`, ...) and are forwarded as-is.
|
|
30
32
|
`aria-invalid` switches the border and ring to the destructive color.
|
|
31
33
|
|
|
32
|
-
`
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
Icons are explicit: `icon` draws a leading icon inside the field (via a
|
|
35
|
+
presentational wrapper the component adds only when a slot is present),
|
|
36
|
+
`end` overlays trailing content such as a clear button. Semantics still
|
|
37
|
+
come from the native `type` — a search field is `type="search"` (searchbox
|
|
38
|
+
role) plus a magnifier passed to `icon`; nothing renders automatically.
|
|
39
|
+
A disabled input dims its `icon` and `end` slots too (0.42 opacity) — a
|
|
40
|
+
clear button left in `end` doesn't stay visually live just because it isn't
|
|
41
|
+
the native control. That dimming fires regardless of *why* the input is
|
|
42
|
+
disabled (the direct `disabled` prop or a `<Field disabled>` ancestor both
|
|
43
|
+
land on the real `<input>`). Removing `end`'s tab stop is a separate fix
|
|
44
|
+
and only covers the direct prop: passing `disabled` straight to `Input`
|
|
45
|
+
also sets `inert` on the `end` wrapper, which drops it from the tab order
|
|
46
|
+
and blocks activation — the actual fix for a keyboard user, since dimming
|
|
47
|
+
alone (`pointer-events: none`) only disarms the mouse. A field disabled
|
|
48
|
+
through `<Field disabled>`'s context still dims `end`, but Input has no way
|
|
49
|
+
to observe that context-driven disable from its own props, so it cannot set
|
|
50
|
+
`inert` for that path — an interactive `end` slot under a `Field`-disabled
|
|
51
|
+
input stays dim yet still tabbable and clickable via keyboard activation.
|
|
52
|
+
Consumers composing `end` from a `Field` should disable their own
|
|
53
|
+
interactive `end` content directly rather than relying on this.
|
|
36
54
|
|
|
37
55
|
## Examples
|
|
38
56
|
|
|
@@ -42,8 +60,14 @@ import { Input } from '@gears-frontx/ui-kit';
|
|
|
42
60
|
// Uncontrolled with placeholder
|
|
43
61
|
<Input placeholder="Project name" />
|
|
44
62
|
|
|
45
|
-
// Search field
|
|
46
|
-
|
|
63
|
+
// Search field: the native type brings the searchbox role, the icon slot
|
|
64
|
+
// brings the magnifier, and `end` can hold a clear button
|
|
65
|
+
<Input
|
|
66
|
+
type="search"
|
|
67
|
+
placeholder="Search projects…"
|
|
68
|
+
icon={<MagnifierIcon />}
|
|
69
|
+
end={<Button variant="ghost" size="sm" icon={<CrossIcon />} aria-label="Clear" />}
|
|
70
|
+
/>
|
|
47
71
|
|
|
48
72
|
// Controlled
|
|
49
73
|
<Input value={email} onValueChange={setEmail} type="email" />
|
|
@@ -63,3 +87,5 @@ import { Input } from '@gears-frontx/ui-kit';
|
|
|
63
87
|
containers, colors to theme tokens.
|
|
64
88
|
- Do not build a labelled input by hand — the `Field` composition handles
|
|
65
89
|
label/error/description wiring.
|
|
90
|
+
- Do not put an interactive control in `icon` — that slot is aria-hidden
|
|
91
|
+
and pointer-transparent; live content goes in `end`.
|
package/dist/docs/select.md
CHANGED
|
@@ -6,7 +6,10 @@ form submission (hidden native input on the root) come from Base UI.
|
|
|
6
6
|
|
|
7
7
|
Composition: `Select` (root, holds the value) → `SelectTrigger` (+
|
|
8
8
|
`SelectValue` for the current label) → `SelectContent` → `SelectGroup` /
|
|
9
|
-
`SelectLabel` / `SelectItem` / `SelectSeparator`.
|
|
9
|
+
`SelectLabel` / `SelectItem` / `SelectSeparator`. `SelectGroup` is only for
|
|
10
|
+
labelled sections — it is optional; the dropdown's inner padding lives on
|
|
11
|
+
the list itself, not on the group, so items placed directly under
|
|
12
|
+
`SelectContent` are padded the same either way.
|
|
10
13
|
|
|
11
14
|
## When to use
|
|
12
15
|
|
|
@@ -35,12 +38,15 @@ raw value instead of the label until the popup has been opened once.
|
|
|
35
38
|
| `className` | `string` — merged after the kit class | — |
|
|
36
39
|
|
|
37
40
|
`SelectValue`: renders the selected item's label. Pass `placeholder`
|
|
38
|
-
directly to `SelectValue` (see example). `SelectContent`
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
directly to `SelectValue` (see example). `SelectContent` always opens the
|
|
42
|
+
list on its `side` (below the trigger by default) — it never overlays the
|
|
43
|
+
trigger the way a native `<select>` does. With no value selected the list
|
|
44
|
+
starts scrolled to the top; when the selected option is beyond the fold,
|
|
45
|
+
it is scrolled into view on open. `SelectContent` accepts positioning
|
|
46
|
+
props (`side`, `sideOffset`, `align`, `alignOffset`, plus the escape
|
|
47
|
+
hatch for triggers inside a `transform`/`filter` container:
|
|
48
|
+
`positionMethod="fixed"`, `collisionBoundary`, `collisionPadding`) and
|
|
49
|
+
`container` — the popup portals to `<body>`
|
|
44
50
|
by default, so if your theme lives on a subtree (`data-theme` on a
|
|
45
51
|
section instead of `<html>`), pass that section as `container` or the
|
|
46
52
|
popup renders with the root theme. `SelectItem` takes `value` (required) and
|
|
@@ -92,8 +98,6 @@ const REGIONS = [
|
|
|
92
98
|
|
|
93
99
|
## Anti-patterns
|
|
94
100
|
|
|
95
|
-
- Do not put items directly under `SelectContent` without a `SelectGroup`
|
|
96
|
-
— the group carries the list padding.
|
|
97
101
|
- Do not use a select for navigation — that is a menu/link pattern.
|
|
98
102
|
- Do not omit a placeholder or default value — an empty trigger gives the
|
|
99
103
|
user (and the agent) nothing to read.
|
package/dist/dropdown-menu.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
3
|
import { Menu as r } from "@base-ui/react/menu";
|
|
3
4
|
import { cx as a, cva as v } from "class-variance-authority";
|
|
4
5
|
import { useContext as x, createContext as D } from "react";
|
|
@@ -18,9 +19,9 @@ import './chunks/dropdown-menu.DmDZc5gB.css';const M = "_positioner_14fxt_6", k
|
|
|
18
19
|
subTrigger: B,
|
|
19
20
|
subTriggerIcon: V,
|
|
20
21
|
svgIcon: W
|
|
21
|
-
},
|
|
22
|
-
function
|
|
23
|
-
return /* @__PURE__ */
|
|
22
|
+
}, l = D(void 0);
|
|
23
|
+
function m({ className: t }) {
|
|
24
|
+
return /* @__PURE__ */ o(
|
|
24
25
|
"svg",
|
|
25
26
|
{
|
|
26
27
|
className: a(n.svgIcon, t),
|
|
@@ -31,12 +32,12 @@ function l({ className: t }) {
|
|
|
31
32
|
strokeLinecap: "round",
|
|
32
33
|
strokeLinejoin: "round",
|
|
33
34
|
"aria-hidden": "true",
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
+
children: /* @__PURE__ */ o("path", { d: "M20 6 9 17l-5-5" })
|
|
35
36
|
}
|
|
36
37
|
);
|
|
37
38
|
}
|
|
38
39
|
function y({ className: t }) {
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
+
return /* @__PURE__ */ o(
|
|
40
41
|
"svg",
|
|
41
42
|
{
|
|
42
43
|
className: a(n.svgIcon, t),
|
|
@@ -47,17 +48,17 @@ function y({ className: t }) {
|
|
|
47
48
|
strokeLinecap: "round",
|
|
48
49
|
strokeLinejoin: "round",
|
|
49
50
|
"aria-hidden": "true",
|
|
50
|
-
children: /* @__PURE__ */
|
|
51
|
+
children: /* @__PURE__ */ o("path", { d: "m9 18 6-6-6-6" })
|
|
51
52
|
}
|
|
52
53
|
);
|
|
53
54
|
}
|
|
54
55
|
const J = r.Root;
|
|
55
|
-
function K({ className: t, ...
|
|
56
|
-
return /* @__PURE__ */
|
|
56
|
+
function K({ className: t, ...e }) {
|
|
57
|
+
return /* @__PURE__ */ o(r.Trigger, { className: t, ...e });
|
|
57
58
|
}
|
|
58
59
|
function q({
|
|
59
60
|
className: t,
|
|
60
|
-
children:
|
|
61
|
+
children: e,
|
|
61
62
|
container: i,
|
|
62
63
|
side: c = "bottom",
|
|
63
64
|
sideOffset: s = 4,
|
|
@@ -68,8 +69,8 @@ function q({
|
|
|
68
69
|
collisionPadding: g,
|
|
69
70
|
...h
|
|
70
71
|
}) {
|
|
71
|
-
const b = x(
|
|
72
|
-
return /* @__PURE__ */
|
|
72
|
+
const b = x(l), d = i ?? b;
|
|
73
|
+
return /* @__PURE__ */ o(l.Provider, { value: d, children: /* @__PURE__ */ o(r.Portal, { container: d, children: /* @__PURE__ */ o(
|
|
73
74
|
r.Positioner,
|
|
74
75
|
{
|
|
75
76
|
side: c,
|
|
@@ -80,15 +81,15 @@ function q({
|
|
|
80
81
|
collisionBoundary: I,
|
|
81
82
|
collisionPadding: g,
|
|
82
83
|
className: n.positioner,
|
|
83
|
-
children: /* @__PURE__ */
|
|
84
|
+
children: /* @__PURE__ */ o(r.Popup, { className: a(n.popup, t), ...h, children: e })
|
|
84
85
|
}
|
|
85
86
|
) }) });
|
|
86
87
|
}
|
|
87
|
-
function O({ className: t, ...
|
|
88
|
-
return /* @__PURE__ */
|
|
88
|
+
function O({ className: t, ...e }) {
|
|
89
|
+
return /* @__PURE__ */ o(r.Group, { className: t, ...e });
|
|
89
90
|
}
|
|
90
|
-
function Q({ className: t, ...
|
|
91
|
-
return /* @__PURE__ */
|
|
91
|
+
function Q({ className: t, ...e }) {
|
|
92
|
+
return /* @__PURE__ */ o(r.GroupLabel, { className: a(n.label, t), ...e });
|
|
92
93
|
}
|
|
93
94
|
const z = v(n.item, {
|
|
94
95
|
variants: {
|
|
@@ -101,62 +102,62 @@ const z = v(n.item, {
|
|
|
101
102
|
variant: "default"
|
|
102
103
|
}
|
|
103
104
|
});
|
|
104
|
-
function U({ className: t, variant:
|
|
105
|
-
return /* @__PURE__ */
|
|
105
|
+
function U({ className: t, variant: e, ...i }) {
|
|
106
|
+
return /* @__PURE__ */ o(r.Item, { className: z({ variant: e, className: t }), ...i });
|
|
106
107
|
}
|
|
107
108
|
function X({
|
|
108
109
|
className: t,
|
|
109
|
-
children:
|
|
110
|
+
children: e,
|
|
110
111
|
...i
|
|
111
112
|
}) {
|
|
112
113
|
return /* @__PURE__ */ p(r.CheckboxItem, { className: a(n.checkboxItem, t), ...i, children: [
|
|
113
|
-
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
e,
|
|
115
|
+
/* @__PURE__ */ o(r.CheckboxItemIndicator, { className: n.itemIndicator, children: /* @__PURE__ */ o(m, {}) })
|
|
115
116
|
] });
|
|
116
117
|
}
|
|
117
|
-
function Y({ className: t, ...
|
|
118
|
-
return /* @__PURE__ */
|
|
118
|
+
function Y({ className: t, ...e }) {
|
|
119
|
+
return /* @__PURE__ */ o(r.RadioGroup, { className: t, ...e });
|
|
119
120
|
}
|
|
120
121
|
function Z({
|
|
121
122
|
className: t,
|
|
122
|
-
children:
|
|
123
|
+
children: e,
|
|
123
124
|
...i
|
|
124
125
|
}) {
|
|
125
126
|
return /* @__PURE__ */ p(r.RadioItem, { className: a(n.radioItem, t), ...i, children: [
|
|
126
|
-
|
|
127
|
-
/* @__PURE__ */
|
|
127
|
+
e,
|
|
128
|
+
/* @__PURE__ */ o(r.RadioItemIndicator, { className: n.itemIndicator, children: /* @__PURE__ */ o(m, {}) })
|
|
128
129
|
] });
|
|
129
130
|
}
|
|
130
|
-
function $({ className: t, ...
|
|
131
|
-
return /* @__PURE__ */
|
|
131
|
+
function $({ className: t, ...e }) {
|
|
132
|
+
return /* @__PURE__ */ o(r.Separator, { className: a(n.separator, t), ...e });
|
|
132
133
|
}
|
|
133
|
-
function tt({ className: t, ...
|
|
134
|
-
return /* @__PURE__ */
|
|
134
|
+
function tt({ className: t, ...e }) {
|
|
135
|
+
return /* @__PURE__ */ o("span", { className: a(n.shortcut, t), ...e });
|
|
135
136
|
}
|
|
136
|
-
const
|
|
137
|
-
function
|
|
137
|
+
const et = r.SubmenuRoot;
|
|
138
|
+
function ot({
|
|
138
139
|
className: t,
|
|
139
|
-
children:
|
|
140
|
+
children: e,
|
|
140
141
|
...i
|
|
141
142
|
}) {
|
|
142
143
|
return /* @__PURE__ */ p(r.SubmenuTrigger, { className: a(n.subTrigger, t), ...i, children: [
|
|
143
|
-
|
|
144
|
-
/* @__PURE__ */
|
|
144
|
+
e,
|
|
145
|
+
/* @__PURE__ */ o(y, { className: n.subTriggerIcon })
|
|
145
146
|
] });
|
|
146
147
|
}
|
|
147
148
|
function nt({
|
|
148
149
|
className: t,
|
|
149
|
-
side:
|
|
150
|
+
side: e = "right",
|
|
150
151
|
align: i = "start",
|
|
151
152
|
sideOffset: c = 0,
|
|
152
153
|
alignOffset: s = -3,
|
|
153
154
|
...u
|
|
154
155
|
}) {
|
|
155
|
-
return /* @__PURE__ */
|
|
156
|
+
return /* @__PURE__ */ o(
|
|
156
157
|
q,
|
|
157
158
|
{
|
|
158
159
|
className: a(n.subPopup, t),
|
|
159
|
-
side:
|
|
160
|
+
side: e,
|
|
160
161
|
align: i,
|
|
161
162
|
sideOffset: c,
|
|
162
163
|
alignOffset: s,
|
|
@@ -175,9 +176,9 @@ export {
|
|
|
175
176
|
Z as DropdownMenuRadioItem,
|
|
176
177
|
$ as DropdownMenuSeparator,
|
|
177
178
|
tt as DropdownMenuShortcut,
|
|
178
|
-
|
|
179
|
+
et as DropdownMenuSub,
|
|
179
180
|
nt as DropdownMenuSubContent,
|
|
180
|
-
|
|
181
|
+
ot as DropdownMenuSubTrigger,
|
|
181
182
|
K as DropdownMenuTrigger
|
|
182
183
|
};
|
|
183
184
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","sources":["../src/components/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { Menu as MenuPrimitive } from '@base-ui/react/menu';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport { type ComponentProps, createContext, useContext } from 'react';\n\nimport styles from './dropdown-menu.module.css';\n\n/*\n * Carries DropdownMenuContent's effective portal container down to nested\n * submenus, so a theme scoped to a subtree holds one level deep without the\n * consumer repeating `container` on every DropdownMenuSubContent. An\n * explicit `container` on the submenu still wins.\n */\nconst MenuContainerContext = createContext<MenuPrimitive.Portal.Props['container']>(undefined);\n\n/* Inline lucide paths (ISC) — the kit carries no icon dependency. */\nfunction CheckIcon({ className }: { className?: string }) {\n return (\n <svg\n className={cx(styles.svgIcon, className)}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\nfunction ChevronRightIcon({ className }: { className?: string }) {\n return (\n <svg\n className={cx(styles.svgIcon, className)}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\nexport const DropdownMenu = MenuPrimitive.Root;\n/**\n * The root is a Base UI pass-through, but its props type is still exported:\n * a consumer writing a typed wrapper imports it from this kit — Base UI is\n * this package's dependency, not necessarily theirs. Same idiom as\n * TooltipProviderProps.\n */\nexport type DropdownMenuProps = MenuPrimitive.Root.Props;\n\nexport interface DropdownMenuTriggerProps extends Omit<MenuPrimitive.Trigger.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuTrigger({ className, ...props }: DropdownMenuTriggerProps) {\n return <MenuPrimitive.Trigger className={className} {...props} />;\n}\n\nexport interface DropdownMenuContentProps\n extends Omit<MenuPrimitive.Popup.Props, 'className'>,\n Pick<\n MenuPrimitive.Positioner.Props,\n // positionMethod/collision*: the escape hatch for popups anchored\n // inside a transform/filter container (an animated panel is the usual\n // case), where the default absolute positioning resolves against the\n // wrong containing block — positionMethod=\"fixed\" is the standard\n // fix, and it must be reachable without bypassing the kit.\n | 'align'\n | 'alignOffset'\n | 'side'\n | 'sideOffset'\n | 'positionMethod'\n | 'collisionBoundary'\n | 'collisionPadding'\n > {\n className?: string;\n /**\n * Where to portal the popup. Defaults to <body>. Pass a themed container\n * when the theme is scoped to a subtree (data-theme on a container that\n * isn't at document root) so the popup inherits its tokens and font.\n * Inherited by nested DropdownMenuSubContent unless it passes its own.\n */\n container?: MenuPrimitive.Portal.Props['container'];\n}\n\nexport function DropdownMenuContent({\n className,\n children,\n container,\n side = 'bottom',\n sideOffset = 4,\n align = 'start',\n alignOffset = 0,\n positionMethod,\n collisionBoundary,\n collisionPadding,\n ...props\n}: DropdownMenuContentProps) {\n const inheritedContainer = useContext(MenuContainerContext);\n const effectiveContainer = container ?? inheritedContainer;\n return (\n <MenuContainerContext.Provider value={effectiveContainer}>\n <MenuPrimitive.Portal container={effectiveContainer}>\n <MenuPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n positionMethod={positionMethod}\n collisionBoundary={collisionBoundary}\n collisionPadding={collisionPadding}\n className={styles.positioner}\n >\n <MenuPrimitive.Popup className={cx(styles.popup, className)} {...props}>\n {children}\n </MenuPrimitive.Popup>\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n </MenuContainerContext.Provider>\n );\n}\n\nexport interface DropdownMenuGroupProps extends Omit<MenuPrimitive.Group.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuGroup({ className, ...props }: DropdownMenuGroupProps) {\n return <MenuPrimitive.Group className={className} {...props} />;\n}\n\nexport interface DropdownMenuLabelProps extends Omit<MenuPrimitive.GroupLabel.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuLabel({ className, ...props }: DropdownMenuLabelProps) {\n return <MenuPrimitive.GroupLabel className={cx(styles.label, className)} {...props} />;\n}\n\nconst itemVariants = cva(styles.item, {\n variants: {\n variant: {\n default: styles.variantDefault,\n destructive: styles.variantDestructive,\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nexport interface DropdownMenuItemProps\n extends Omit<MenuPrimitive.Item.Props, 'className'>, VariantProps<typeof itemVariants> {\n className?: string;\n}\n\nexport function DropdownMenuItem({ className, variant, ...props }: DropdownMenuItemProps) {\n return <MenuPrimitive.Item className={itemVariants({ variant, className })} {...props} />;\n}\n\nexport interface DropdownMenuCheckboxItemProps\n extends Omit<MenuPrimitive.CheckboxItem.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuCheckboxItem({\n className,\n children,\n ...props\n}: DropdownMenuCheckboxItemProps) {\n return (\n <MenuPrimitive.CheckboxItem className={cx(styles.checkboxItem, className)} {...props}>\n {children}\n <MenuPrimitive.CheckboxItemIndicator className={styles.itemIndicator}>\n <CheckIcon />\n </MenuPrimitive.CheckboxItemIndicator>\n </MenuPrimitive.CheckboxItem>\n );\n}\n\nexport interface DropdownMenuRadioGroupProps\n extends Omit<MenuPrimitive.RadioGroup.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuRadioGroup({ className, ...props }: DropdownMenuRadioGroupProps) {\n return <MenuPrimitive.RadioGroup className={className} {...props} />;\n}\n\nexport interface DropdownMenuRadioItemProps\n extends Omit<MenuPrimitive.RadioItem.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: DropdownMenuRadioItemProps) {\n return (\n <MenuPrimitive.RadioItem className={cx(styles.radioItem, className)} {...props}>\n {children}\n <MenuPrimitive.RadioItemIndicator className={styles.itemIndicator}>\n <CheckIcon />\n </MenuPrimitive.RadioItemIndicator>\n </MenuPrimitive.RadioItem>\n );\n}\n\nexport interface DropdownMenuSeparatorProps\n extends Omit<MenuPrimitive.Separator.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps) {\n return <MenuPrimitive.Separator className={cx(styles.separator, className)} {...props} />;\n}\n\nexport type DropdownMenuShortcutProps = ComponentProps<'span'>;\n\nexport function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps) {\n return <span className={cx(styles.shortcut, className)} {...props} />;\n}\n\nexport const DropdownMenuSub = MenuPrimitive.SubmenuRoot;\n/** Pass-through props type — see DropdownMenuProps. */\nexport type DropdownMenuSubProps = MenuPrimitive.SubmenuRoot.Props;\n\nexport interface DropdownMenuSubTriggerProps\n extends Omit<MenuPrimitive.SubmenuTrigger.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuSubTrigger({\n className,\n children,\n ...props\n}: DropdownMenuSubTriggerProps) {\n return (\n <MenuPrimitive.SubmenuTrigger className={cx(styles.subTrigger, className)} {...props}>\n {children}\n <ChevronRightIcon className={styles.subTriggerIcon} />\n </MenuPrimitive.SubmenuTrigger>\n );\n}\n\nexport type DropdownMenuSubContentProps = DropdownMenuContentProps;\n\nexport function DropdownMenuSubContent({\n className,\n side = 'right',\n align = 'start',\n sideOffset = 0,\n alignOffset = -3,\n ...props\n}: DropdownMenuSubContentProps) {\n return (\n <DropdownMenuContent\n className={cx(styles.subPopup, className)}\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n {...props}\n />\n );\n}\n"],"names":["MenuContainerContext","createContext","CheckIcon","className","jsx","cx","styles","ChevronRightIcon","DropdownMenu","MenuPrimitive","DropdownMenuTrigger","props","DropdownMenuContent","children","container","side","sideOffset","align","alignOffset","positionMethod","collisionBoundary","collisionPadding","inheritedContainer","useContext","effectiveContainer","DropdownMenuGroup","DropdownMenuLabel","itemVariants","cva","DropdownMenuItem","variant","DropdownMenuCheckboxItem","jsxs","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"],"mappings":";;;;;;;;;;;;;;;;;;;;GAYMA,IAAuBC,EAAuD,MAAS;AAG7F,SAASC,EAAU,EAAE,WAAAC,KAAqC;AACxD,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAGC,EAAO,SAASH,CAAS;AAAA,MACvC,SAAQ;AAAA,MAC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AIO,SAASiC,GAAuB;AAAA,EACrC,WAAApC;AAAA,EACA,MAAAY,IAAO;AAAA,EACP,OAAAE,IAAQ;AAAA,EACR,YAAAD,IAAa;AAAA,EACb,aAAAE,IAAc;AAAA,EACd,GAAGP;AACL,GAAgC;AAC9B,SACE,gBAAAP;AAAA,IAACQ;AAAA,IAAA;AAAA,MACC,WAAWP,EAAGC,EAAO,UAAUH,CAAS;AAAA,MACxC,MAAAY;AAAA,MACA,OAAAE;AAAA,MACA,YAAAD;AAAA,MACA,aAAAE;AAAA,MACC,GAAGP;AAAA,IAAA;AAAA,EAAA;AAGV;"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","sources":["../src/components/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["// Load-bearing: DropdownMenuContent calls useContext directly, so this\n// can't be dropped. Coupled to CLIENT_COMPONENTS in\n// scripts/verify-consumer.sh — keep both in sync if this ever changes.\n'use client';\n\nimport { Menu as MenuPrimitive } from '@base-ui/react/menu';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport { type ComponentProps, createContext, useContext } from 'react';\n\nimport styles from './dropdown-menu.module.css';\n\n/*\n * Carries DropdownMenuContent's effective portal container down to nested\n * submenus, so a theme scoped to a subtree holds one level deep without the\n * consumer repeating `container` on every DropdownMenuSubContent. An\n * explicit `container` on the submenu still wins.\n */\nconst MenuContainerContext = createContext<MenuPrimitive.Portal.Props['container']>(undefined);\n\n/* Inline lucide paths (ISC) — the kit carries no icon dependency. */\nfunction CheckIcon({ className }: { className?: string }) {\n return (\n <svg\n className={cx(styles.svgIcon, className)}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 6 9 17l-5-5\" />\n </svg>\n );\n}\n\nfunction ChevronRightIcon({ className }: { className?: string }) {\n return (\n <svg\n className={cx(styles.svgIcon, className)}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m9 18 6-6-6-6\" />\n </svg>\n );\n}\n\nexport const DropdownMenu = MenuPrimitive.Root;\n/**\n * The root is a Base UI pass-through, but its props type is still exported:\n * a consumer writing a typed wrapper imports it from this kit — Base UI is\n * this package's dependency, not necessarily theirs. Same idiom as\n * TooltipProviderProps.\n */\nexport type DropdownMenuProps = MenuPrimitive.Root.Props;\n\nexport interface DropdownMenuTriggerProps extends Omit<MenuPrimitive.Trigger.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuTrigger({ className, ...props }: DropdownMenuTriggerProps) {\n return <MenuPrimitive.Trigger className={className} {...props} />;\n}\n\nexport interface DropdownMenuContentProps\n extends Omit<MenuPrimitive.Popup.Props, 'className'>,\n Pick<\n MenuPrimitive.Positioner.Props,\n // positionMethod/collision*: the escape hatch for popups anchored\n // inside a transform/filter container (an animated panel is the usual\n // case), where the default absolute positioning resolves against the\n // wrong containing block — positionMethod=\"fixed\" is the standard\n // fix, and it must be reachable without bypassing the kit.\n | 'align'\n | 'alignOffset'\n | 'side'\n | 'sideOffset'\n | 'positionMethod'\n | 'collisionBoundary'\n | 'collisionPadding'\n > {\n className?: string;\n /**\n * Where to portal the popup. Defaults to <body>. Pass a themed container\n * when the theme is scoped to a subtree (data-theme on a container that\n * isn't at document root) so the popup inherits its tokens and font.\n * Inherited by nested DropdownMenuSubContent unless it passes its own.\n */\n container?: MenuPrimitive.Portal.Props['container'];\n}\n\nexport function DropdownMenuContent({\n className,\n children,\n container,\n side = 'bottom',\n sideOffset = 4,\n align = 'start',\n alignOffset = 0,\n positionMethod,\n collisionBoundary,\n collisionPadding,\n ...props\n}: DropdownMenuContentProps) {\n const inheritedContainer = useContext(MenuContainerContext);\n const effectiveContainer = container ?? inheritedContainer;\n return (\n <MenuContainerContext.Provider value={effectiveContainer}>\n <MenuPrimitive.Portal container={effectiveContainer}>\n <MenuPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n positionMethod={positionMethod}\n collisionBoundary={collisionBoundary}\n collisionPadding={collisionPadding}\n className={styles.positioner}\n >\n <MenuPrimitive.Popup className={cx(styles.popup, className)} {...props}>\n {children}\n </MenuPrimitive.Popup>\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n </MenuContainerContext.Provider>\n );\n}\n\nexport interface DropdownMenuGroupProps extends Omit<MenuPrimitive.Group.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuGroup({ className, ...props }: DropdownMenuGroupProps) {\n return <MenuPrimitive.Group className={className} {...props} />;\n}\n\nexport interface DropdownMenuLabelProps extends Omit<MenuPrimitive.GroupLabel.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuLabel({ className, ...props }: DropdownMenuLabelProps) {\n return <MenuPrimitive.GroupLabel className={cx(styles.label, className)} {...props} />;\n}\n\nconst itemVariants = cva(styles.item, {\n variants: {\n variant: {\n default: styles.variantDefault,\n destructive: styles.variantDestructive,\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n});\n\nexport interface DropdownMenuItemProps\n extends Omit<MenuPrimitive.Item.Props, 'className'>, VariantProps<typeof itemVariants> {\n className?: string;\n}\n\nexport function DropdownMenuItem({ className, variant, ...props }: DropdownMenuItemProps) {\n return <MenuPrimitive.Item className={itemVariants({ variant, className })} {...props} />;\n}\n\nexport interface DropdownMenuCheckboxItemProps\n extends Omit<MenuPrimitive.CheckboxItem.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuCheckboxItem({\n className,\n children,\n ...props\n}: DropdownMenuCheckboxItemProps) {\n return (\n <MenuPrimitive.CheckboxItem className={cx(styles.checkboxItem, className)} {...props}>\n {children}\n <MenuPrimitive.CheckboxItemIndicator className={styles.itemIndicator}>\n <CheckIcon />\n </MenuPrimitive.CheckboxItemIndicator>\n </MenuPrimitive.CheckboxItem>\n );\n}\n\nexport interface DropdownMenuRadioGroupProps\n extends Omit<MenuPrimitive.RadioGroup.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuRadioGroup({ className, ...props }: DropdownMenuRadioGroupProps) {\n return <MenuPrimitive.RadioGroup className={className} {...props} />;\n}\n\nexport interface DropdownMenuRadioItemProps\n extends Omit<MenuPrimitive.RadioItem.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: DropdownMenuRadioItemProps) {\n return (\n <MenuPrimitive.RadioItem className={cx(styles.radioItem, className)} {...props}>\n {children}\n <MenuPrimitive.RadioItemIndicator className={styles.itemIndicator}>\n <CheckIcon />\n </MenuPrimitive.RadioItemIndicator>\n </MenuPrimitive.RadioItem>\n );\n}\n\nexport interface DropdownMenuSeparatorProps\n extends Omit<MenuPrimitive.Separator.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuSeparator({ className, ...props }: DropdownMenuSeparatorProps) {\n return <MenuPrimitive.Separator className={cx(styles.separator, className)} {...props} />;\n}\n\nexport type DropdownMenuShortcutProps = ComponentProps<'span'>;\n\nexport function DropdownMenuShortcut({ className, ...props }: DropdownMenuShortcutProps) {\n return <span className={cx(styles.shortcut, className)} {...props} />;\n}\n\nexport const DropdownMenuSub = MenuPrimitive.SubmenuRoot;\n/** Pass-through props type — see DropdownMenuProps. */\nexport type DropdownMenuSubProps = MenuPrimitive.SubmenuRoot.Props;\n\nexport interface DropdownMenuSubTriggerProps\n extends Omit<MenuPrimitive.SubmenuTrigger.Props, 'className'> {\n className?: string;\n}\n\nexport function DropdownMenuSubTrigger({\n className,\n children,\n ...props\n}: DropdownMenuSubTriggerProps) {\n return (\n <MenuPrimitive.SubmenuTrigger className={cx(styles.subTrigger, className)} {...props}>\n {children}\n <ChevronRightIcon className={styles.subTriggerIcon} />\n </MenuPrimitive.SubmenuTrigger>\n );\n}\n\nexport type DropdownMenuSubContentProps = DropdownMenuContentProps;\n\nexport function DropdownMenuSubContent({\n className,\n side = 'right',\n align = 'start',\n sideOffset = 0,\n alignOffset = -3,\n ...props\n}: DropdownMenuSubContentProps) {\n return (\n <DropdownMenuContent\n className={cx(styles.subPopup, className)}\n side={side}\n align={align}\n sideOffset={sideOffset}\n alignOffset={alignOffset}\n {...props}\n />\n );\n}\n"],"names":["MenuContainerContext","createContext","CheckIcon","className","jsx","cx","styles","ChevronRightIcon","DropdownMenu","MenuPrimitive","DropdownMenuTrigger","props","DropdownMenuContent","children","container","side","sideOffset","align","alignOffset","positionMethod","collisionBoundary","collisionPadding","inheritedContainer","useContext","effectiveContainer","DropdownMenuGroup","DropdownMenuLabel","itemVariants","cva","DropdownMenuItem","variant","DropdownMenuCheckboxItem","jsxs","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuShortcut","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent"],"mappings":";;;;;;;;;;;;;;;;;;;;;GAiBMA,IAAuBC,EAAuD,MAAS;AAG7F,SAASC,EAAU,EAAE,WAAAC,KAAqC;AACxD,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAGC,EAAO,SAASH,CAAS;AAAA,MACvC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,eAAY;AAAA,MAEZ,UAAA,gBAAAC,EAAC,QAAA,EAAK,GAAE,kBAAA,CAAkB;AAAA,IAAA;AAAA,EAAA;AAGhC;AAEA,SAASG,EAAiB,EAAE,WAAAJ,KAAqC;AAC/D,SACE,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC,EAAGC,EAAO,SAASH,CAAS;AAAA,MACvC,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,QAAO;AAAA,MACP,aAAY;AAAA,MACZ,eAAc;AAAA,MACd,gBAAe;AAAA,MACf,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import { jsx as
|
|
2
|
-
import { Input as
|
|
3
|
-
import { cx as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsx as a, jsxs as m } from "react/jsx-runtime";
|
|
2
|
+
import { Input as d } from "@base-ui/react/input";
|
|
3
|
+
import { cx as u } from "class-variance-authority";
|
|
4
|
+
import { Children as e } from "react";
|
|
5
|
+
import './chunks/input.C8RDCC-a.css';const l = "_input_1v93o_6", I = "_wrap_1v93o_122", f = "_icon_1v93o_128", v = "_end_1v93o_143", E = "_hasIcon_1v93o_172", w = "_hasEnd_1v93o_178", n = {
|
|
6
|
+
input: l,
|
|
7
|
+
wrap: I,
|
|
8
|
+
icon: f,
|
|
9
|
+
end: v,
|
|
10
|
+
hasIcon: E,
|
|
11
|
+
hasEnd: w
|
|
9
12
|
};
|
|
10
|
-
function
|
|
11
|
-
const c = /* @__PURE__ */
|
|
12
|
-
|
|
13
|
+
function A({ className: _, icon: r, end: c, disabled: i, ...h }) {
|
|
14
|
+
const o = e.toArray(r).some((t) => t !== ""), s = e.toArray(c).some((t) => t !== ""), p = /* @__PURE__ */ a(
|
|
15
|
+
d,
|
|
13
16
|
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
className: u(
|
|
18
|
+
n.input,
|
|
19
|
+
o && n.hasIcon,
|
|
20
|
+
s && n.hasEnd,
|
|
21
|
+
_
|
|
22
|
+
),
|
|
23
|
+
disabled: i,
|
|
24
|
+
...h
|
|
17
25
|
}
|
|
18
26
|
);
|
|
19
|
-
return
|
|
20
|
-
/* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
] }),
|
|
24
|
-
c
|
|
27
|
+
return !o && !s ? p : /* @__PURE__ */ m("span", { className: n.wrap, children: [
|
|
28
|
+
o && /* @__PURE__ */ a("span", { className: n.icon, "aria-hidden": "true", children: r }),
|
|
29
|
+
p,
|
|
30
|
+
s && /* @__PURE__ */ a("span", { className: n.end, inert: i, children: c })
|
|
25
31
|
] });
|
|
26
32
|
}
|
|
27
33
|
export {
|
|
28
|
-
|
|
34
|
+
A as Input
|
|
29
35
|
};
|
|
30
36
|
//# sourceMappingURL=input.js.map
|
package/dist/input.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sources":["../src/components/input/input.tsx"],"sourcesContent":["import { Input as InputPrimitive } from '@base-ui/react/input';\nimport { cx } from 'class-variance-authority';\n\nimport styles from './input.module.css';\n\nexport interface InputProps extends Omit<InputPrimitive.Props, 'className'> {\n className?: string;\n
|
|
1
|
+
{"version":3,"file":"input.js","sources":["../src/components/input/input.tsx"],"sourcesContent":["import { Input as InputPrimitive } from '@base-ui/react/input';\nimport { cx } from 'class-variance-authority';\nimport { Children, type ReactNode } from 'react';\n\nimport styles from './input.module.css';\n\nexport interface InputProps extends Omit<InputPrimitive.Props, 'className'> {\n className?: string;\n /**\n * Leading icon slot — decorative only: rendered aria-hidden with pointer\n * events off, so it never carries the field's name or steals a click.\n * Semantics stay on the input itself — a search field is `type=\"search\"`\n * plus a magnifier passed here.\n */\n icon?: ReactNode;\n /**\n * Trailing slot for live content — an icon-button (clear, reveal\n * password) or a small static adornment. Rendered after the <input> in\n * the DOM, so tab order is field first, then slot. The input clears a\n * compact icon-button's width (32px, size=\"sm\") of end padding; anything\n * wider is the consumer's padding to extend.\n */\n end?: ReactNode;\n}\n\n/*\n * An <input> is a replaced element — no ::before to draw into, and a\n * background-image can't read the theme's color tokens — so the slots need\n * a presentational wrapper. Only a slotted input pays for it: with neither\n * prop this stays a bare <input>, and the consumer className stays on the\n * input either way, so styling targets the same element regardless. Field\n * wiring is unaffected — the primitive is still the control Field talks to.\n */\nexport function Input({ className, icon, end, disabled, ...props }: InputProps) {\n // `icon != null`/`end != null` are true for `icon={false}`/`end={false}` —\n // a valid ReactNode that renders nothing — which is exactly what\n // `icon={cond && <Icon/>}` passes when `cond` is false. Same predicate as\n // Button's `hasLabel`, applied to a slot instead of children: it answers\n // \"is this renderable\" rather than \"is this set\".\n const hasIcon = Children.toArray(icon).some((child) => child !== '');\n const hasEnd = Children.toArray(end).some((child) => child !== '');\n const input = (\n <InputPrimitive\n className={cx(\n styles.input,\n hasIcon && styles.hasIcon,\n hasEnd && styles.hasEnd,\n className,\n )}\n disabled={disabled}\n {...props}\n />\n );\n if (!hasIcon && !hasEnd) {\n return input;\n }\n return (\n <span className={styles.wrap}>\n {hasIcon && (\n <span className={styles.icon} aria-hidden=\"true\">\n {icon}\n </span>\n )}\n {input}\n {/*\n * `inert` removes `end` from the tab order and blocks activation —\n * dimming alone (see input.module.css) stops nothing for a keyboard\n * user, since a Button inside `end` keeps its tab stop and still\n * fires on Enter/Space. Only wired from this direct `disabled` prop:\n * a Field-driven disable (`<Field disabled>`) reaches the rendered\n * <input> through Base UI's own FieldControl, deeper than this\n * component's props, so it can't be observed here — see input.md.\n */}\n {hasEnd && (\n <span className={styles.end} inert={disabled}>\n {end}\n </span>\n )}\n </span>\n );\n}\n"],"names":["Input","className","icon","end","disabled","props","hasIcon","Children","child","hasEnd","input","jsx","InputPrimitive","cx","styles","jsxs"],"mappings":";;;;;;;;;;;;AAiCO,SAASA,EAAM,EAAE,WAAAC,GAAW,MAAAC,GAAM,KAAAC,GAAK,UAAAC,GAAU,GAAGC,KAAqB;AAM9E,QAAMC,IAAUC,EAAS,QAAQL,CAAI,EAAE,KAAK,CAACM,MAAUA,MAAU,EAAE,GAC7DC,IAASF,EAAS,QAAQJ,CAAG,EAAE,KAAK,CAACK,MAAUA,MAAU,EAAE,GAC3DE,IACJ,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACTC,EAAO;AAAA,QACPR,KAAWQ,EAAO;AAAA,QAClBL,KAAUK,EAAO;AAAA,QACjBb;AAAA,MAAA;AAAA,MAEF,UAAAG;AAAA,MACC,GAAGC;AAAA,IAAA;AAAA,EAAA;AAGR,SAAI,CAACC,KAAW,CAACG,IACRC,IAGP,gBAAAK,EAAC,QAAA,EAAK,WAAWD,EAAO,MACrB,UAAA;AAAA,IAAAR,uBACE,QAAA,EAAK,WAAWQ,EAAO,MAAM,eAAY,QACvC,UAAAZ,EAAA,CACH;AAAA,IAEDQ;AAAA,IAUAD,uBACE,QAAA,EAAK,WAAWK,EAAO,KAAK,OAAOV,GACjC,UAAAD,EAAA,CACH;AAAA,EAAA,GAEJ;AAEJ;"}
|
package/dist/radio-group.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Radio as
|
|
3
|
-
import { RadioGroup as
|
|
4
|
-
import { cx as
|
|
5
|
-
import './chunks/radio-group.
|
|
2
|
+
import { Radio as n } from "@base-ui/react/radio";
|
|
3
|
+
import { RadioGroup as c } from "@base-ui/react/radio-group";
|
|
4
|
+
import { cx as a } from "class-variance-authority";
|
|
5
|
+
import './chunks/radio-group.zAFY9yCF.css';const s = "_group_19jni_6", m = "_item_19jni_12", d = "_indicator_19jni_93", e = "_dot_19jni_101", i = {
|
|
6
6
|
group: s,
|
|
7
7
|
item: m,
|
|
8
8
|
indicator: d,
|
|
9
9
|
dot: e
|
|
10
10
|
};
|
|
11
|
-
function f({ className:
|
|
12
|
-
return /* @__PURE__ */ o(
|
|
11
|
+
function f({ className: t, ...r }) {
|
|
12
|
+
return /* @__PURE__ */ o(c, { className: a(i.group, t), ...r });
|
|
13
13
|
}
|
|
14
|
-
function R({ className:
|
|
15
|
-
return /* @__PURE__ */ o(
|
|
14
|
+
function R({ className: t, ...r }) {
|
|
15
|
+
return /* @__PURE__ */ o(n.Root, { className: a(i.item, t), ...r, children: /* @__PURE__ */ o(n.Indicator, { className: i.indicator, children: /* @__PURE__ */ o("span", { className: i.dot }) }) });
|
|
16
16
|
}
|
|
17
17
|
export {
|
|
18
18
|
f as RadioGroup,
|