@gears-frontx/ui-kit 0.3.0-alpha.1 → 0.3.0-alpha.2

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.
Files changed (49) hide show
  1. package/dist/badge.js +39 -19
  2. package/dist/badge.js.map +1 -1
  3. package/dist/button.js +40 -40
  4. package/dist/button.js.map +1 -1
  5. package/dist/checkbox.js +5 -5
  6. package/dist/chunks/badge.BcdxDzJ7.css +1 -0
  7. package/dist/chunks/button.DNo8DTR3.css +1 -0
  8. package/dist/chunks/checkbox.D3kdAalh.css +1 -0
  9. package/dist/chunks/input.C8RDCC-a.css +1 -0
  10. package/dist/chunks/radio-group.zAFY9yCF.css +1 -0
  11. package/dist/chunks/select.Dt0diN4P.css +1 -0
  12. package/dist/chunks/switch.CsaIRnCA.css +1 -0
  13. package/dist/chunks/{table.r8ppNt1W.css → table.BuWHXL6e.css} +1 -1
  14. package/dist/chunks/tabs.KEksCAxN.css +1 -0
  15. package/dist/chunks/{textarea.BKWvs6fD.css → textarea.N3iiWUuz.css} +1 -1
  16. package/dist/chunks/toast.DMUpK07T.css +1 -0
  17. package/dist/components/badge/badge.d.ts +14 -2
  18. package/dist/components/badge/badge.d.ts.map +1 -1
  19. package/dist/components/button/button.d.ts.map +1 -1
  20. package/dist/components/input/input.d.ts +17 -1
  21. package/dist/components/input/input.d.ts.map +1 -1
  22. package/dist/components/select/select.d.ts +2 -2
  23. package/dist/components/select/select.d.ts.map +1 -1
  24. package/dist/docs/badge.md +22 -8
  25. package/dist/docs/button.md +43 -8
  26. package/dist/docs/input.md +32 -6
  27. package/dist/docs/select.md +13 -9
  28. package/dist/input.js +27 -21
  29. package/dist/input.js.map +1 -1
  30. package/dist/radio-group.js +8 -8
  31. package/dist/select.js +57 -65
  32. package/dist/select.js.map +1 -1
  33. package/dist/switch.js +8 -8
  34. package/dist/table.js +33 -33
  35. package/dist/tabs.js +20 -20
  36. package/dist/textarea.js +4 -4
  37. package/dist/theme.css +31 -6
  38. package/dist/toast.js +60 -60
  39. package/llms.txt +26 -17
  40. package/package.json +1 -1
  41. package/dist/chunks/badge.ej-3-Xs4.css +0 -1
  42. package/dist/chunks/button.CKfALaMe.css +0 -1
  43. package/dist/chunks/checkbox.Dd6YDr20.css +0 -1
  44. package/dist/chunks/input.CrRQ0OAn.css +0 -1
  45. package/dist/chunks/radio-group.1Y6B0lXt.css +0 -1
  46. package/dist/chunks/select.BmyP2S2q.css +0 -1
  47. package/dist/chunks/switch.B_ebMSxR.css +0 -1
  48. package/dist/chunks/tabs.DqJE9cX3.css +0 -1
  49. package/dist/chunks/toast.DMl31Mq4.css +0 -1
@@ -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 — brand changes belong in
87
- the theme tokens (`theme.css` CSS variables). If you rebrand the focus
88
- ring specifically via `--button-focus-ring`, note that the `default` and
89
- `destructive` variants also set an explicit `--button-focus-ring-inner`
90
- of their own (a two-tone ring, needed to clear WCAG contrast against
91
- their own fill) — overriding only `--button-focus-ring` on those two
92
- leaves the old inner color in place instead of following it; set both
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.
@@ -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
- `type="search"` upgrades the field visually as well as semantically: a
33
- leading magnifier icon (decorative, `aria-hidden`) renders inside the
34
- field via a presentational wrapper element, and the input announces as a
35
- searchbox. No prop needed — the native type is the switch.
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 — the native type brings the magnifier and searchbox role
46
- <Input type="search" placeholder="Search projects…" />
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`.
@@ -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
- accepts positioning props (`side`, `sideOffset`, `align`, `alignOffset`,
40
- `alignItemWithTrigger`, plus the escape hatch for triggers inside a
41
- `transform`/`filter` container: `positionMethod="fixed"`,
42
- `collisionBoundary`, `collisionPadding`) and `container` — the popup
43
- portals to `<body>`
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/input.js CHANGED
@@ -1,30 +1,36 @@
1
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
2
- import { Input as o } from "@base-ui/react/input";
3
- import { cx as h } from "class-variance-authority";
4
- import './chunks/input.CrRQ0OAn.css';const p = "_input_1y6th_6", i = "_searchWrap_1y6th_120", u = "_searchIcon_1y6th_126", _ = "_searchInput_1y6th_137", r = {
5
- input: p,
6
- searchWrap: i,
7
- searchIcon: u,
8
- searchInput: _
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 d({ className: e, type: s, ...a }) {
11
- const c = /* @__PURE__ */ t(
12
- o,
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
- type: s,
15
- className: h(r.input, s === "search" && r.searchInput, e),
16
- ...a
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 s !== "search" ? c : /* @__PURE__ */ n("span", { className: r.searchWrap, children: [
20
- /* @__PURE__ */ n("svg", { className: r.searchIcon, "aria-hidden": "true", viewBox: "0 0 16 16", fill: "none", children: [
21
- /* @__PURE__ */ t("circle", { cx: "7", cy: "7", r: "4.5", stroke: "currentColor", strokeWidth: "1.5" }),
22
- /* @__PURE__ */ t("path", { d: "m10.5 10.5 3 3", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" })
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
- d as Input
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}\n\nexport function Input({ className, type, ...props }: InputProps) {\n const input = (\n <InputPrimitive\n type={type}\n className={cx(styles.input, type === 'search' && styles.searchInput, className)}\n {...props}\n />\n );\n if (type !== 'search') {\n return input;\n }\n /*\n * The mockups' Field/search type (Figma frame 193:433) is the same field\n * with a leading magnifier. An <input> is a replaced element — no\n * ::before to draw into, and a background-image can't read the theme's\n * color tokens — so the icon needs this presentational wrapper. Only\n * type=\"search\" pays for it: every other type stays a bare <input>, and\n * the consumer className stays on the input either way, so styling\n * targets the same element regardless of type. Field wiring is\n * unaffected — the primitive is still the control Field talks to.\n */\n return (\n <span className={styles.searchWrap}>\n <svg className={styles.searchIcon} aria-hidden=\"true\" viewBox=\"0 0 16 16\" fill=\"none\">\n <circle cx=\"7\" cy=\"7\" r=\"4.5\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"m10.5 10.5 3 3\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" />\n </svg>\n {input}\n </span>\n );\n}\n"],"names":["Input","className","type","props","input","jsx","InputPrimitive","cx","styles","jsxs"],"mappings":";;;;;;;;;AASO,SAASA,EAAM,EAAE,WAAAC,GAAW,MAAAC,GAAM,GAAGC,KAAqB;AAC/D,QAAMC,IACJ,gBAAAC;AAAA,IAACC;AAAAA,IAAA;AAAA,MACC,MAAAJ;AAAA,MACA,WAAWK,EAAGC,EAAO,OAAON,MAAS,YAAYM,EAAO,aAAaP,CAAS;AAAA,MAC7E,GAAGE;AAAA,IAAA;AAAA,EAAA;AAGR,SAAID,MAAS,WACJE,IAaP,gBAAAK,EAAC,QAAA,EAAK,WAAWD,EAAO,YACtB,UAAA;AAAA,IAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWD,EAAO,YAAY,eAAY,QAAO,SAAQ,aAAY,MAAK,QAC7E,UAAA;AAAA,MAAA,gBAAAH,EAAC,UAAA,EAAO,IAAG,KAAI,IAAG,KAAI,GAAE,OAAM,QAAO,gBAAe,aAAY,MAAA,CAAM;AAAA,MACtE,gBAAAA,EAAC,UAAK,GAAE,kBAAiB,QAAO,gBAAe,aAAY,OAAM,eAAc,QAAA,CAAQ;AAAA,IAAA,GACzF;AAAA,IACCD;AAAA,EAAA,GACH;AAEJ;"}
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;"}
@@ -1,18 +1,18 @@
1
1
  import { jsx as o } from "react/jsx-runtime";
2
- import { Radio as a } from "@base-ui/react/radio";
3
- import { RadioGroup as n } from "@base-ui/react/radio-group";
4
- import { cx as c } from "class-variance-authority";
5
- import './chunks/radio-group.1Y6B0lXt.css';const s = "_group_4704v_6", m = "_item_4704v_12", d = "_indicator_4704v_90", e = "_dot_4704v_98", t = {
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: r, ...i }) {
12
- return /* @__PURE__ */ o(n, { className: c(t.group, r), ...i });
11
+ function f({ className: t, ...r }) {
12
+ return /* @__PURE__ */ o(c, { className: a(i.group, t), ...r });
13
13
  }
14
- function R({ className: r, ...i }) {
15
- return /* @__PURE__ */ o(a.Root, { className: c(t.item, r), ...i, children: /* @__PURE__ */ o(a.Indicator, { className: t.indicator, children: /* @__PURE__ */ o("span", { className: t.dot }) }) });
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,
package/dist/select.js CHANGED
@@ -1,32 +1,33 @@
1
- import { jsx as r, jsxs as l } from "react/jsx-runtime";
1
+ import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
2
  import { Select as n } from "@base-ui/react/select";
3
- import { cx as a, cva as v } from "class-variance-authority";
4
- import './chunks/select.BmyP2S2q.css';const w = "_trigger_982bm_6", S = "_sizeDefault_982bm_9", I = "_sizeSm_982bm_9", h = "_variantDefault_982bm_100", A = "_variantFilter_982bm_109", N = "_triggerIcon_982bm_114", D = "_value_982bm_120", x = "_positioner_982bm_130", L = "_popup_982bm_135", z = "_group_982bm_193", k = "_groupLabel_982bm_198", T = "_item_982bm_205", U = "_itemText_982bm_248", j = "_itemIndicator_982bm_211", B = "_separator_982bm_267", C = "_scrollArrow_982bm_274", F = "_scrollArrowUp_982bm_285", V = "_scrollArrowDown_982bm_289", G = "_svgIcon_982bm_293", e = {
5
- trigger: w,
6
- sizeDefault: S,
7
- sizeSm: I,
8
- variantDefault: h,
9
- variantFilter: A,
10
- triggerIcon: N,
11
- value: D,
12
- positioner: x,
13
- popup: L,
14
- group: z,
3
+ import { cx as i, cva as f } from "class-variance-authority";
4
+ import './chunks/select.Dt0diN4P.css';const z = "_trigger_15wyz_6", v = "_sizeDefault_15wyz_9", S = "_sizeSm_15wyz_9", y = "_variantDefault_15wyz_102", I = "_variantFilter_15wyz_111", h = "_triggerIcon_15wyz_116", N = "_value_15wyz_122", A = "_positioner_15wyz_132", D = "_popup_15wyz_137", x = "_list_15wyz_151", L = "_group_15wyz_252", k = "_groupLabel_15wyz_256", T = "_item_15wyz_263", b = "_itemText_15wyz_306", U = "_itemIndicator_15wyz_269", j = "_separator_15wyz_337", B = "_scrollArrow_15wyz_151", C = "_scrollArrowUp_15wyz_377", F = "_scrollArrowDown_15wyz_381", V = "_svgIcon_15wyz_385", e = {
5
+ trigger: z,
6
+ sizeDefault: v,
7
+ sizeSm: S,
8
+ variantDefault: y,
9
+ variantFilter: I,
10
+ triggerIcon: h,
11
+ value: N,
12
+ positioner: A,
13
+ popup: D,
14
+ list: x,
15
+ group: L,
15
16
  groupLabel: k,
16
17
  item: T,
17
- itemText: U,
18
- itemIndicator: j,
19
- separator: B,
20
- scrollArrow: C,
21
- scrollArrowUp: F,
22
- scrollArrowDown: V,
23
- svgIcon: G
18
+ itemText: b,
19
+ itemIndicator: U,
20
+ separator: j,
21
+ scrollArrow: B,
22
+ scrollArrowUp: C,
23
+ scrollArrowDown: F,
24
+ svgIcon: V
24
25
  };
25
26
  function u({ direction: t, className: o }) {
26
27
  return /* @__PURE__ */ r(
27
28
  "svg",
28
29
  {
29
- className: a(e.svgIcon, o),
30
+ className: i(e.svgIcon, o),
30
31
  viewBox: "0 0 24 24",
31
32
  fill: "none",
32
33
  stroke: "currentColor",
@@ -40,9 +41,9 @@ function u({ direction: t, className: o }) {
40
41
  }
41
42
  const q = n.Root;
42
43
  function E({ className: t, ...o }) {
43
- return /* @__PURE__ */ r(n.Value, { className: a(e.value, t), ...o });
44
+ return /* @__PURE__ */ r(n.Value, { className: i(e.value, t), ...o });
44
45
  }
45
- const P = v(e.trigger, {
46
+ const G = f(e.trigger, {
46
47
  variants: {
47
48
  size: {
48
49
  default: e.sizeDefault,
@@ -64,62 +65,53 @@ const P = v(e.trigger, {
64
65
  variant: "default"
65
66
  }
66
67
  });
67
- function H({ className: t, size: o, variant: c, children: i, ...s }) {
68
- return /* @__PURE__ */ l(n.Trigger, { className: P({ size: o, variant: c, className: t }), ...s, children: [
69
- i,
68
+ function H({ className: t, size: o, variant: s, children: l, ...a }) {
69
+ return /* @__PURE__ */ c(n.Trigger, { className: G({ size: o, variant: s, className: t }), ...a, children: [
70
+ l,
70
71
  /* @__PURE__ */ r(n.Icon, { render: /* @__PURE__ */ r(u, { direction: "down", className: e.triggerIcon }) })
71
72
  ] });
72
73
  }
73
74
  function J({
74
75
  className: t,
75
76
  children: o,
76
- container: c,
77
- side: i = "bottom",
78
- sideOffset: s = 4,
77
+ container: s,
78
+ side: l = "bottom",
79
+ sideOffset: a = 4,
79
80
  align: _ = "center",
80
81
  alignOffset: p = 0,
81
- alignItemWithTrigger: m = !0,
82
- positionMethod: d,
83
- collisionBoundary: g,
84
- collisionPadding: f,
85
- ...b
82
+ positionMethod: m,
83
+ collisionBoundary: w,
84
+ collisionPadding: d,
85
+ ...g
86
86
  }) {
87
- return /* @__PURE__ */ r(n.Portal, { container: c, children: /* @__PURE__ */ r(
87
+ return /* @__PURE__ */ r(n.Portal, { container: s, children: /* @__PURE__ */ r(
88
88
  n.Positioner,
89
89
  {
90
- side: i,
91
- sideOffset: s,
90
+ side: l,
91
+ sideOffset: a,
92
92
  align: _,
93
93
  alignOffset: p,
94
- alignItemWithTrigger: m,
95
- positionMethod: d,
96
- collisionBoundary: g,
97
- collisionPadding: f,
94
+ alignItemWithTrigger: !1,
95
+ positionMethod: m,
96
+ collisionBoundary: w,
97
+ collisionPadding: d,
98
98
  className: e.positioner,
99
- children: /* @__PURE__ */ l(
100
- n.Popup,
101
- {
102
- "data-align-trigger": m,
103
- className: a(e.popup, t),
104
- ...b,
105
- children: [
106
- /* @__PURE__ */ r(y, {}),
107
- /* @__PURE__ */ r(n.List, { children: o }),
108
- /* @__PURE__ */ r(M, {})
109
- ]
110
- }
111
- )
99
+ children: /* @__PURE__ */ c(n.Popup, { className: i(e.popup, t), ...g, children: [
100
+ /* @__PURE__ */ r(P, {}),
101
+ /* @__PURE__ */ r(n.List, { className: e.list, children: o }),
102
+ /* @__PURE__ */ r(W, {})
103
+ ] })
112
104
  }
113
105
  ) });
114
106
  }
115
107
  function K({ className: t, ...o }) {
116
- return /* @__PURE__ */ r(n.Group, { className: a(e.group, t), ...o });
108
+ return /* @__PURE__ */ r(n.Group, { className: i(e.group, t), ...o });
117
109
  }
118
110
  function O({ className: t, ...o }) {
119
- return /* @__PURE__ */ r(n.GroupLabel, { className: a(e.groupLabel, t), ...o });
111
+ return /* @__PURE__ */ r(n.GroupLabel, { className: i(e.groupLabel, t), ...o });
120
112
  }
121
- function Q({ className: t, children: o, ...c }) {
122
- return /* @__PURE__ */ l(n.Item, { className: a(e.item, t), ...c, children: [
113
+ function Q({ className: t, children: o, ...s }) {
114
+ return /* @__PURE__ */ c(n.Item, { className: i(e.item, t), ...s, children: [
123
115
  /* @__PURE__ */ r(n.ItemText, { className: e.itemText, children: o }),
124
116
  /* @__PURE__ */ r(n.ItemIndicator, { render: /* @__PURE__ */ r("span", { className: e.itemIndicator }), children: /* @__PURE__ */ r(
125
117
  "svg",
@@ -138,23 +130,23 @@ function Q({ className: t, children: o, ...c }) {
138
130
  ] });
139
131
  }
140
132
  function X({ className: t, ...o }) {
141
- return /* @__PURE__ */ r(n.Separator, { className: a(e.separator, t), ...o });
133
+ return /* @__PURE__ */ r(n.Separator, { className: i(e.separator, t), ...o });
142
134
  }
143
- function y({ className: t, ...o }) {
135
+ function P({ className: t, ...o }) {
144
136
  return /* @__PURE__ */ r(
145
137
  n.ScrollUpArrow,
146
138
  {
147
- className: a(e.scrollArrow, e.scrollArrowUp, t),
139
+ className: i(e.scrollArrow, e.scrollArrowUp, t),
148
140
  ...o,
149
141
  children: /* @__PURE__ */ r(u, { direction: "up" })
150
142
  }
151
143
  );
152
144
  }
153
- function M({ className: t, ...o }) {
145
+ function W({ className: t, ...o }) {
154
146
  return /* @__PURE__ */ r(
155
147
  n.ScrollDownArrow,
156
148
  {
157
- className: a(e.scrollArrow, e.scrollArrowDown, t),
149
+ className: i(e.scrollArrow, e.scrollArrowDown, t),
158
150
  ...o,
159
151
  children: /* @__PURE__ */ r(u, { direction: "down" })
160
152
  }
@@ -166,8 +158,8 @@ export {
166
158
  K as SelectGroup,
167
159
  Q as SelectItem,
168
160
  O as SelectLabel,
169
- M as SelectScrollDownButton,
170
- y as SelectScrollUpButton,
161
+ W as SelectScrollDownButton,
162
+ P as SelectScrollUpButton,
171
163
  X as SelectSeparator,
172
164
  H as SelectTrigger,
173
165
  E as SelectValue
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sources":["../src/components/select/select.tsx"],"sourcesContent":["import { Select as SelectPrimitive } from '@base-ui/react/select';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport styles from './select.module.css';\n\n/* Inline lucide paths (ISC) — the kit carries no icon dependency. */\nfunction Chevron({ direction, className }: { direction: 'up' | 'down'; 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={direction === 'down' ? 'm6 9 6 6 6-6' : 'm18 15-6-6-6 6'} />\n </svg>\n );\n}\n\nexport const Select = SelectPrimitive.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. Generic like the root\n * itself: `Value` is the selected value's type, `Multiple` widens `value`/\n * `onValueChange` to arrays when true.\n */\nexport type SelectProps<\n Value,\n Multiple extends boolean | undefined = false,\n> = SelectPrimitive.Root.Props<Value, Multiple>;\n\nexport interface SelectValueProps extends Omit<SelectPrimitive.Value.Props, 'className'> {\n className?: string;\n}\n\nexport function SelectValue({ className, ...props }: SelectValueProps) {\n return <SelectPrimitive.Value className={cx(styles.value, className)} {...props} />;\n}\n\nconst triggerVariants = cva(styles.trigger, {\n variants: {\n size: {\n default: styles.sizeDefault,\n sm: styles.sizeSm,\n },\n /*\n * `filter` is the mockups' Field/filter type (Figma frame 193:433): the\n * same select, compacted into a toolbar filter chip — 36px, label in\n * --muted-foreground even with a value chosen, because in a filter the\n * enduring message is \"this narrows the list\", not the picked value.\n */\n variant: {\n default: styles.variantDefault,\n filter: styles.variantFilter,\n },\n },\n defaultVariants: {\n size: 'default',\n variant: 'default',\n },\n});\n\nexport interface SelectTriggerProps\n extends Omit<SelectPrimitive.Trigger.Props, 'className'>, VariantProps<typeof triggerVariants> {\n className?: string;\n}\n\nexport function SelectTrigger({ className, size, variant, children, ...props }: SelectTriggerProps) {\n return (\n <SelectPrimitive.Trigger className={triggerVariants({ size, variant, className })} {...props}>\n {children}\n <SelectPrimitive.Icon render={<Chevron direction=\"down\" className={styles.triggerIcon} />} />\n </SelectPrimitive.Trigger>\n );\n}\n\nexport interface SelectContentProps\n extends Omit<SelectPrimitive.Popup.Props, 'className'>,\n Pick<\n SelectPrimitive.Positioner.Props,\n // positionMethod/collision*: see dropdown-menu.tsx — the escape hatch\n // for anchors inside a transform/filter container.\n | 'align'\n | 'alignOffset'\n | 'side'\n | 'sideOffset'\n | 'alignItemWithTrigger'\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 section rather\n * than <html>) so the popup inherits its tokens and font.\n */\n container?: SelectPrimitive.Portal.Props['container'];\n}\n\nexport function SelectContent({\n className,\n children,\n container,\n side = 'bottom',\n sideOffset = 4,\n align = 'center',\n alignOffset = 0,\n alignItemWithTrigger = true,\n positionMethod,\n collisionBoundary,\n collisionPadding,\n ...props\n}: SelectContentProps) {\n return (\n <SelectPrimitive.Portal container={container}>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n positionMethod={positionMethod}\n collisionBoundary={collisionBoundary}\n collisionPadding={collisionPadding}\n className={styles.positioner}\n >\n <SelectPrimitive.Popup\n data-align-trigger={alignItemWithTrigger}\n className={cx(styles.popup, className)}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.List>{children}</SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n );\n}\n\nexport interface SelectGroupProps extends Omit<SelectPrimitive.Group.Props, 'className'> {\n className?: string;\n}\n\nexport function SelectGroup({ className, ...props }: SelectGroupProps) {\n return <SelectPrimitive.Group className={cx(styles.group, className)} {...props} />;\n}\n\nexport interface SelectLabelProps extends Omit<SelectPrimitive.GroupLabel.Props, 'className'> {\n className?: string;\n}\n\nexport function SelectLabel({ className, ...props }: SelectLabelProps) {\n return <SelectPrimitive.GroupLabel className={cx(styles.groupLabel, className)} {...props} />;\n}\n\nexport interface SelectItemProps extends Omit<SelectPrimitive.Item.Props, 'className'> {\n className?: string;\n children?: ReactNode;\n}\n\nexport function SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item className={cx(styles.item, className)} {...props}>\n <SelectPrimitive.ItemText className={styles.itemText}>{children}</SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator render={<span className={styles.itemIndicator} />}>\n <svg\n className={styles.svgIcon}\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 </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n}\n\nexport interface SelectSeparatorProps extends Omit<SelectPrimitive.Separator.Props, 'className'> {\n className?: string;\n}\n\nexport function SelectSeparator({ className, ...props }: SelectSeparatorProps) {\n return <SelectPrimitive.Separator className={cx(styles.separator, className)} {...props} />;\n}\n\nexport interface SelectScrollUpButtonProps\n extends Omit<ComponentProps<typeof SelectPrimitive.ScrollUpArrow>, 'className'> {\n className?: string;\n}\n\nexport function SelectScrollUpButton({ className, ...props }: SelectScrollUpButtonProps) {\n return (\n <SelectPrimitive.ScrollUpArrow\n className={cx(styles.scrollArrow, styles.scrollArrowUp, className)}\n {...props}\n >\n <Chevron direction=\"up\" />\n </SelectPrimitive.ScrollUpArrow>\n );\n}\n\nexport interface SelectScrollDownButtonProps\n extends Omit<ComponentProps<typeof SelectPrimitive.ScrollDownArrow>, 'className'> {\n className?: string;\n}\n\nexport function SelectScrollDownButton({ className, ...props }: SelectScrollDownButtonProps) {\n return (\n <SelectPrimitive.ScrollDownArrow\n className={cx(styles.scrollArrow, styles.scrollArrowDown, className)}\n {...props}\n >\n <Chevron direction=\"down\" />\n </SelectPrimitive.ScrollDownArrow>\n );\n}\n"],"names":["Chevron","direction","className","jsx","cx","styles","Select","SelectPrimitive","SelectValue","props","triggerVariants","cva","SelectTrigger","size","variant","children","jsxs","SelectContent","container","side","sideOffset","align","alignOffset","alignItemWithTrigger","positionMethod","collisionBoundary","collisionPadding","SelectScrollUpButton","SelectScrollDownButton","SelectGroup","SelectLabel","SelectItem","SelectSeparator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAASA,EAAQ,EAAE,WAAAC,GAAW,WAAAC,KAA+D;AAC3F,SACE,gBA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AGO,KAAsC;AAC3F,SACE,gBAAAN;AAAA,IAACI,EAAgB;AAAA,IAAhB;AAAA,MACC,WAAWH,EAAGC,EAAO,aAAaA,EAAO,iBAAiBH,CAAS;AAAA,MAClE,GAAGO;AAAA,MAEJ,UAAA,gBAAAN,EAACH,GAAA,EAAQ,WAAU,OAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGhC;"}
1
+ {"version":3,"file":"select.js","sources":["../src/components/select/select.tsx"],"sourcesContent":["import { Select as SelectPrimitive } from '@base-ui/react/select';\nimport { cva, cx, type VariantProps } from 'class-variance-authority';\nimport type { ComponentProps, ReactNode } from 'react';\n\nimport styles from './select.module.css';\n\n/* Inline lucide paths (ISC) — the kit carries no icon dependency. */\nfunction Chevron({ direction, className }: { direction: 'up' | 'down'; 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={direction === 'down' ? 'm6 9 6 6 6-6' : 'm18 15-6-6-6 6'} />\n </svg>\n );\n}\n\nexport const Select = SelectPrimitive.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. Generic like the root\n * itself: `Value` is the selected value's type, `Multiple` widens `value`/\n * `onValueChange` to arrays when true.\n */\nexport type SelectProps<\n Value,\n Multiple extends boolean | undefined = false,\n> = SelectPrimitive.Root.Props<Value, Multiple>;\n\nexport interface SelectValueProps extends Omit<SelectPrimitive.Value.Props, 'className'> {\n className?: string;\n}\n\nexport function SelectValue({ className, ...props }: SelectValueProps) {\n return <SelectPrimitive.Value className={cx(styles.value, className)} {...props} />;\n}\n\nconst triggerVariants = cva(styles.trigger, {\n variants: {\n size: {\n default: styles.sizeDefault,\n sm: styles.sizeSm,\n },\n /*\n * `filter` is the mockups' Field/filter type (Figma frame 193:433): the\n * same select, compacted into a toolbar filter chip — 36px, label in\n * --muted-foreground even with a value chosen, because in a filter the\n * enduring message is \"this narrows the list\", not the picked value.\n */\n variant: {\n default: styles.variantDefault,\n filter: styles.variantFilter,\n },\n },\n defaultVariants: {\n size: 'default',\n variant: 'default',\n },\n});\n\nexport interface SelectTriggerProps\n extends Omit<SelectPrimitive.Trigger.Props, 'className'>, VariantProps<typeof triggerVariants> {\n className?: string;\n}\n\nexport function SelectTrigger({ className, size, variant, children, ...props }: SelectTriggerProps) {\n return (\n <SelectPrimitive.Trigger className={triggerVariants({ size, variant, className })} {...props}>\n {children}\n <SelectPrimitive.Icon render={<Chevron direction=\"down\" className={styles.triggerIcon} />} />\n </SelectPrimitive.Trigger>\n );\n}\n\nexport interface SelectContentProps\n extends Omit<SelectPrimitive.Popup.Props, 'className'>,\n Pick<\n SelectPrimitive.Positioner.Props,\n // positionMethod/collision*: see dropdown-menu.tsx — the escape hatch\n // for anchors inside a transform/filter container.\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 section rather\n * than <html>) so the popup inherits its tokens and font.\n */\n container?: SelectPrimitive.Portal.Props['container'];\n}\n\nexport function SelectContent({\n className,\n children,\n container,\n side = 'bottom',\n sideOffset = 4,\n align = 'center',\n alignOffset = 0,\n positionMethod,\n collisionBoundary,\n collisionPadding,\n ...props\n}: SelectContentProps) {\n return (\n <SelectPrimitive.Portal container={container}>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n /*\n * Never the Base UI default overlay mode (selected item aligned over\n * the trigger): the popup always opens on `side`, below by default.\n * With nothing selected the list starts at the top; a selected item\n * beyond the fold is scrolled into view natively on open — Floating\n * UI's useListNavigation calls scrollIntoView({block: 'nearest'})\n * when a selectedIndex exists (verified against @base-ui/react 1.6.0\n * sources), so no scroll code of ours is needed.\n */\n alignItemWithTrigger={false}\n positionMethod={positionMethod}\n collisionBoundary={collisionBoundary}\n collisionPadding={collisionPadding}\n className={styles.positioner}\n >\n <SelectPrimitive.Popup className={cx(styles.popup, className)} {...props}>\n <SelectScrollUpButton />\n <SelectPrimitive.List className={styles.list}>{children}</SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n );\n}\n\nexport interface SelectGroupProps extends Omit<SelectPrimitive.Group.Props, 'className'> {\n className?: string;\n}\n\nexport function SelectGroup({ className, ...props }: SelectGroupProps) {\n return <SelectPrimitive.Group className={cx(styles.group, className)} {...props} />;\n}\n\nexport interface SelectLabelProps extends Omit<SelectPrimitive.GroupLabel.Props, 'className'> {\n className?: string;\n}\n\nexport function SelectLabel({ className, ...props }: SelectLabelProps) {\n return <SelectPrimitive.GroupLabel className={cx(styles.groupLabel, className)} {...props} />;\n}\n\nexport interface SelectItemProps extends Omit<SelectPrimitive.Item.Props, 'className'> {\n className?: string;\n children?: ReactNode;\n}\n\nexport function SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item className={cx(styles.item, className)} {...props}>\n <SelectPrimitive.ItemText className={styles.itemText}>{children}</SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator render={<span className={styles.itemIndicator} />}>\n <svg\n className={styles.svgIcon}\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 </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n );\n}\n\nexport interface SelectSeparatorProps extends Omit<SelectPrimitive.Separator.Props, 'className'> {\n className?: string;\n}\n\nexport function SelectSeparator({ className, ...props }: SelectSeparatorProps) {\n return <SelectPrimitive.Separator className={cx(styles.separator, className)} {...props} />;\n}\n\nexport interface SelectScrollUpButtonProps\n extends Omit<ComponentProps<typeof SelectPrimitive.ScrollUpArrow>, 'className'> {\n className?: string;\n}\n\nexport function SelectScrollUpButton({ className, ...props }: SelectScrollUpButtonProps) {\n return (\n <SelectPrimitive.ScrollUpArrow\n className={cx(styles.scrollArrow, styles.scrollArrowUp, className)}\n {...props}\n >\n <Chevron direction=\"up\" />\n </SelectPrimitive.ScrollUpArrow>\n );\n}\n\nexport interface SelectScrollDownButtonProps\n extends Omit<ComponentProps<typeof SelectPrimitive.ScrollDownArrow>, 'className'> {\n className?: string;\n}\n\nexport function SelectScrollDownButton({ className, ...props }: SelectScrollDownButtonProps) {\n return (\n <SelectPrimitive.ScrollDownArrow\n className={cx(styles.scrollArrow, styles.scrollArrowDown, className)}\n {...props}\n >\n <Chevron direction=\"down\" />\n </SelectPrimitive.ScrollDownArrow>\n );\n}\n"],"names":["Chevron","direction","className","jsx","cx","styles","Select","SelectPrimitive","SelectValue","props","triggerVariants","cva","SelectTrigger","size","variant","children","jsxs","SelectContent","container","side","sideOffset","align","alignOffset","positionMethod","collisionBoundary","collisionPadding","SelectScrollUpButton","SelectScrollDownButton","SelectGroup","SelectLabel","SelectItem","SelectSeparator"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAOA,SAASA,EAAQ,EAAE,WAAAC,GAAW,WAAAC,KAA+D;AAC3F,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,4BAAC,QAAA,EAAK,GAAGD,MAAc,SAAS,iBAAiB,iBAAA,CAAkB;AAAA,IAAA;AAAA,EAAA;AAGzE;AAEO,M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WF,EAAO,eAAe,GAC5E,UAAA,gBAAAF;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWE,EAAO;AAAA,QAClB,SAAQ;AAAA,QACR,MAAK;AAAA,QACL,QAAO;AAAA,QACP,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,gBAAe;AAAA,QACf,eAAY;AAAA,QAEZ,UAAA,gBAAAF,EAAC,QAAA,EAAK,GAAE,kBAAA,CAAkB;AAAA,MAAA;AAAA,IAAA,EAC5B,CACF;AAAA,EAAA,GACF;AAEJ;AAMO,SAAS4B,EAAgB,EAAE,WAAA7B,GAAW,GAAGO,KAA+B;AAC7E,SAAO,gBAAAN,EAACI,EAAgB,WAAhB,EAA0B,WAAWH,EAAGC,EAAO,WAAWH,CAAS,GAAI,GAAGO,EAAA,CAAO;AAC3F;AAOO,SAASiB,EAAqB,EAAE,WAAAxB,GAAW,GAAGO,KAAoC;AACvF,SACE,gBAAAN;AAAA,IAACI,EAAgB;AAAA,IAAhB;AAAA,MACC,WAAWH,EAAGC,EAAO,aAAaA,EAAO,eAAeH,CAAS;AAAA,MAChE,GAAGO;AAAA,MAEJ,UAAA,gBAAAN,EAACH,GAAA,EAAQ,WAAU,KAAA,CAAK;AAAA,IAAA;AAAA,EAAA;AAG9B;AAOO,SAAS2B,EAAuB,EAAE,WAAAzB,GAAW,GAAGO,KAAsC;AAC3F,SACE,gBAAAN;AAAA,IAACI,EAAgB;AAAA,IAAhB;AAAA,MACC,WAAWH,EAAGC,EAAO,aAAaA,EAAO,iBAAiBH,CAAS;AAAA,MAClE,GAAGO;AAAA,MAEJ,UAAA,gBAAAN,EAACH,GAAA,EAAQ,WAAU,OAAA,CAAO;AAAA,IAAA;AAAA,EAAA;AAGhC;"}
package/dist/switch.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
2
  import { Switch as i } from "@base-ui/react/switch";
3
3
  import { cva as c } from "class-variance-authority";
4
- import './chunks/switch.B_ebMSxR.css';const n = "_sizeDefault_n8bm9_10", o = "_sizeSm_n8bm9_10", u = "_thumb_n8bm9_84", t = {
5
- switch: "_switch_n8bm9_6",
6
- sizeDefault: n,
7
- sizeSm: o,
8
- thumb: u
4
+ import './chunks/switch.CsaIRnCA.css';const o = "_sizeDefault_1baz9_10", u = "_sizeSm_1baz9_10", z = "_thumb_1baz9_87", t = {
5
+ switch: "_switch_1baz9_6",
6
+ sizeDefault: o,
7
+ sizeSm: u,
8
+ thumb: z
9
9
  }, h = c(t.switch, {
10
10
  variants: {
11
11
  size: {
@@ -17,10 +17,10 @@ import './chunks/switch.B_ebMSxR.css';const n = "_sizeDefault_n8bm9_10", o = "_s
17
17
  size: "default"
18
18
  }
19
19
  });
20
- function l({ className: e, size: m, ...a }) {
21
- return /* @__PURE__ */ s(i.Root, { className: h({ size: m, className: e }), ...a, children: /* @__PURE__ */ s(i.Thumb, { className: t.thumb }) });
20
+ function f({ className: a, size: e, ...m }) {
21
+ return /* @__PURE__ */ s(i.Root, { className: h({ size: e, className: a }), ...m, children: /* @__PURE__ */ s(i.Thumb, { className: t.thumb }) });
22
22
  }
23
23
  export {
24
- l as Switch
24
+ f as Switch
25
25
  };
26
26
  //# sourceMappingURL=switch.js.map