@salemcobalt/ui 0.1.0 → 0.2.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,24 +1,40 @@
1
1
  # @salemcobalt/ui
2
2
 
3
- React 19 components for the Salem Cobalt design system: `Button`, `Badge`, `Card`, `Stack`, `Inline`, `Kbd`, `Dialog`. Requires `@salemcobalt/tokens`.
3
+ React 19 components for the Salem Cobalt design system: `Button`, `IconButton`, `Icon` and a shipped icon set, `Badge`, `Card`, `Stack`, `Inline`, `Kbd`, `Dialog`, `Tooltip`, `Menu`. Requires `@salemcobalt/tokens`.
4
4
 
5
5
  ```ts
6
6
  import '@salemcobalt/tokens/css'; // custom properties, light + dark
7
7
  import '@salemcobalt/ui/fonts'; // self-hosted IBM Plex Sans (variable) and Plex Mono, optional
8
8
  import '@salemcobalt/ui/styles.css'; // the components, inside @layer sc
9
- import { Button, Badge, Card, Stack, Inline, Kbd, Dialog } from '@salemcobalt/ui';
9
+ import {
10
+ Button,
11
+ IconButton,
12
+ Badge,
13
+ Card,
14
+ Stack,
15
+ Inline,
16
+ Kbd,
17
+ Dialog,
18
+ Tooltip,
19
+ Menu,
20
+ PlusIcon,
21
+ } from '@salemcobalt/ui';
10
22
  ```
11
23
 
12
- Styles ship as one stylesheet inside `@layer sc`, so an app's unlayered CSS always wins. Every value in it is a token custom property; theme with `data-theme="light|dark"` on `<html>` and density with `data-density="compact"` on any ancestor. Interactive behaviour (Dialog focus management, `render` composition) comes from Base UI; see `docs/adr/0001-headless-primitives.md`.
24
+ Styles ship as one stylesheet inside `@layer sc`, so an app's unlayered CSS always wins. Every value in it is a token custom property; theme with `data-theme="light|dark"` on `<html>` and density with `data-density="compact"` on any ancestor. Interactive behaviour (Dialog, Tooltip and Menu focus and keyboard handling, `render` composition) comes from Base UI; see `docs/adr/0001-headless-primitives.md`.
13
25
 
14
- | Component | Notes |
15
- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
16
- | `Button` | `variant` primary · secondary · ghost · danger; `size` sm · md · lg; `iconStart`/`iconEnd`; `loading` (keeps width, `aria-busy`); `fullWidth`. |
17
- | `Badge` | `tone` neutral · accent · success · warning · danger · info; `variant` soft · solid · outline; `size` sm · md; `dot`. Text only. |
18
- | `Card` | `variant` outlined · elevated · filled; `padding` none · sm · md · lg; `interactive`; `selected`; `as` or `render` to make it an `a`/`button`/`li`. |
19
- | `Stack`, `Inline` | `gap` from the spacing scale (`none` … `4xl`); `align`; `justify`; `as`. `Inline` wraps unless `wrap={false}`. |
20
- | `Kbd` | One key per `Kbd`; `Kbd.Group label="Command K"` groups a shortcut with a `+` (or `separator="space"`). |
21
- | `Dialog` | `Root` (`open`, `defaultOpen`, `onOpenChange`, `dismissible`), `Trigger`, `Content` (`size` sm · md · lg), `Title`, `Description`, `Body`, `Actions`, `Close`. |
26
+ | Component | Notes |
27
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
28
+ | `Button` | `variant` primary · secondary · ghost · danger; `size` sm · md · lg; `iconStart`/`iconEnd`; `loading` (keeps width, `aria-busy`); `fullWidth`. |
29
+ | `IconButton` | Square Button for one icon. Required `label` (the accessible name); `variant` ghost (default) · secondary · primary · danger; `size`; `tooltip` (`true` shows `label`, or a string); `tooltipSide`; `round`; `loading`. |
30
+ | `Icon`, `*Icon` | 47 outline icons on a 16px grid in `currentColor`, one component each (`PlayIcon`, `ChevronDownIcon` …, listed in `iconNames`); `size` xs 12 · sm 14 · md 16 · lg 20 · xl 24 · em; decorative unless `title` is given. `Icon` wraps your own paths. |
31
+ | `Badge` | `tone` neutral · accent · success · warning · danger · info; `variant` soft · solid · outline; `size` sm · md; `dot`. Text only. |
32
+ | `Card` | `variant` outlined · elevated · filled; `padding` none · sm · md · lg; `interactive`; `selected`; `as` or `render` to make it an `a`/`button`/`li`. |
33
+ | `Stack`, `Inline` | `gap` from the spacing scale (`none` … `4xl`); `align`; `justify`; `as`. `Inline` wraps unless `wrap={false}`. |
34
+ | `Kbd` | One key per `Kbd`; `Kbd.Group label="Command K"` groups a shortcut with a `+` (or `separator="space"`). |
35
+ | `Dialog` | `Root` (`open`, `defaultOpen`, `onOpenChange`, `dismissible`), `Trigger`, `Content` (`size` sm · md · lg), `Title`, `Description`, `Body`, `Actions`, `Close`. |
36
+ | `Tooltip` | `content`; `children` is the trigger (an `IconButton`, `Button` or focusable `Badge`); `side` top · bottom · left · right; `align`; `delay` (300ms); `open`/`onOpenChange`; `disabled`. `Tooltip.Provider` around a row skips the delay between siblings. |
37
+ | `Menu` | `Root` (`open`, `onOpenChange`, `modal`), `Trigger` (secondary Button with a chevron, or `render={<IconButton label="More" />}`), `Content` (`side`, `align`), `Item` (`icon`, `trailing`, `tone="danger"`, `disabled`), `LinkItem` (`href`), `CheckboxItem` (`checked`, `onCheckedChange`), `RadioGroup` (`value`, `onValueChange`, `label`) + `RadioItem`, `Group` (`label`), `Separator`. Arrow keys, Home/End, type-ahead, Esc and focus return come from Base UI. |
22
38
 
23
39
  ```tsx
24
40
  <Dialog.Root>
@@ -35,4 +51,33 @@ Styles ship as one stylesheet inside `@layer sc`, so an app's unlayered CSS alwa
35
51
  </Dialog.Root>
36
52
  ```
37
53
 
38
- Accessibility baseline: native elements, one focus ring on `:focus-visible`, WCAG AA text on every fill in both themes, 44px touch targets on coarse pointers, `prefers-reduced-motion` honoured, logical properties throughout, and Dialog traps focus, closes on Esc and returns focus to its trigger.
54
+ ```tsx
55
+ <Tooltip.Provider>
56
+ <Inline gap="2xs">
57
+ <IconButton label="Pause my sweeps" tooltip>
58
+ <PauseIcon />
59
+ </IconButton>
60
+ <Menu.Root>
61
+ <Menu.Trigger render={<IconButton label="More actions" tooltip />}>
62
+ <MoreHorizontalIcon />
63
+ </Menu.Trigger>
64
+ <Menu.Content align="end">
65
+ <Menu.Item icon={<ClockIcon />} onClick={snooze}>
66
+ Snooze
67
+ </Menu.Item>
68
+ <Menu.CheckboxItem checked={stale} onCheckedChange={setStale}>
69
+ Show stale
70
+ </Menu.CheckboxItem>
71
+ <Menu.Separator />
72
+ <Menu.Item tone="danger" onClick={remove}>
73
+ Delete
74
+ </Menu.Item>
75
+ </Menu.Content>
76
+ </Menu.Root>
77
+ </Inline>
78
+ </Tooltip.Provider>
79
+ ```
80
+
81
+ Icons are generated from `src/icons/svg/*.svg` by `scripts/build-icons.mjs` (run by `pnpm build`): the folder is the manifest, every fill and stroke must be `currentColor` or `none`, and the output is committed. The package has no side effects besides CSS, so a bundler keeps only the icons an app imports.
82
+
83
+ Accessibility baseline: native elements, one focus ring on `:focus-visible`, WCAG AA text on every fill in both themes, 44px touch targets on coarse pointers, `prefers-reduced-motion` honoured, logical properties throughout, Dialog traps focus, closes on Esc and returns focus to its trigger, Menu is fully keyboard operable, and every IconButton is named. Tooltips are hints only: they never open on touch and the trigger must already carry its own name.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import * as react from 'react';
2
- import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { ComponentPropsWithRef, ReactNode, ReactElement } from 'react';
3
3
  import { useRender } from '@base-ui/react/use-render';
4
4
  import { Dialog as Dialog$1 } from '@base-ui/react/dialog';
5
+ import * as _base_ui_react from '@base-ui/react';
6
+ import { Menu as Menu$1 } from '@base-ui/react/menu';
5
7
 
6
8
  type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
7
9
  type ButtonSize = 'sm' | 'md' | 'lg';
@@ -700,14 +702,14 @@ interface DialogRootProps {
700
702
  children?: ReactNode | undefined;
701
703
  }
702
704
  /** Owns the open state. Wrap a `Dialog.Trigger` and a `Dialog.Content`. */
703
- declare function Root({ dismissible, onOpenChange, open, defaultOpen, children }: DialogRootProps): react.JSX.Element;
705
+ declare function Root$1({ dismissible, onOpenChange, open, defaultOpen, children }: DialogRootProps): react.JSX.Element;
704
706
  interface DialogContentProps extends Omit<Dialog$1.Popup.Props, 'className'> {
705
707
  /** `sm` 400px for yes/no, `md` 560px (default) for a short form, `lg` 720px rarely. */
706
708
  size?: DialogSize | undefined;
707
709
  className?: string | undefined;
708
710
  }
709
711
  /** Portal, backdrop and the popup. Focus moves inside on open and returns to the trigger on close. */
710
- declare function Content({ size, className, children, ...rest }: DialogContentProps): react.JSX.Element;
712
+ declare function Content$1({ size, className, children, ...rest }: DialogContentProps): react.JSX.Element;
711
713
  interface DialogTitleProps extends Omit<Dialog$1.Title.Props, 'className'> {
712
714
  className?: string | undefined;
713
715
  }
@@ -731,9 +733,9 @@ interface DialogCloseProps extends Omit<Dialog$1.Close.Props, 'className'> {
731
733
  declare function Close({ className, children, render, ...rest }: DialogCloseProps): react.JSX.Element;
732
734
  /** A modal that interrupts for a decision or a short form. Built on Base UI's Dialog. */
733
735
  declare const Dialog: {
734
- Root: typeof Root;
736
+ Root: typeof Root$1;
735
737
  Trigger: Dialog$1.Trigger;
736
- Content: typeof Content;
738
+ Content: typeof Content$1;
737
739
  Title: typeof Title;
738
740
  Description: typeof Description;
739
741
  Body: typeof Body;
@@ -741,7 +743,289 @@ declare const Dialog: {
741
743
  Close: typeof Close;
742
744
  };
743
745
 
744
- declare const version = "0.1.0";
746
+ type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'em';
747
+ interface IconProps extends Omit<ComponentPropsWithRef<'svg'>, 'children'> {
748
+ /** `xs` 12, `sm` 14, `md` 16 (default), `lg` 20, `xl` 24, or `em` to follow the surrounding font size. */
749
+ size?: IconSize | undefined;
750
+ /** Gives the icon an accessible name (`role="img"`). Without it the icon is decorative and hidden from assistive tech. */
751
+ title?: string | undefined;
752
+ /** The glyph: `<path>`, `<circle>` … on a 16×16 grid, stroke `currentColor`. */
753
+ children: ReactNode;
754
+ }
755
+ /** Props of a shipped icon such as `PlayIcon`: everything `Icon` takes except the glyph. */
756
+ type IconGlyphProps = Omit<IconProps, 'children'>;
757
+ /**
758
+ * The frame every icon renders in: a 16×16 outline in `currentColor`, sized by `size`, decorative unless
759
+ * `title` is given. Use the shipped `<Name>Icon` components, or wrap your own paths.
760
+ */
761
+ declare function Icon({ size, title, className, children, ...rest }: IconProps): react.JSX.Element;
762
+
763
+ /** `archive` */
764
+ declare function ArchiveIcon(props: IconGlyphProps): react.JSX.Element;
765
+ /** `arrow-left` */
766
+ declare function ArrowLeftIcon(props: IconGlyphProps): react.JSX.Element;
767
+ /** `arrow-right` */
768
+ declare function ArrowRightIcon(props: IconGlyphProps): react.JSX.Element;
769
+ /** `bell` */
770
+ declare function BellIcon(props: IconGlyphProps): react.JSX.Element;
771
+ /** `briefcase` */
772
+ declare function BriefcaseIcon(props: IconGlyphProps): react.JSX.Element;
773
+ /** `calendar` */
774
+ declare function CalendarIcon(props: IconGlyphProps): react.JSX.Element;
775
+ /** `check` */
776
+ declare function CheckIcon(props: IconGlyphProps): react.JSX.Element;
777
+ /** `chevron-down` */
778
+ declare function ChevronDownIcon(props: IconGlyphProps): react.JSX.Element;
779
+ /** `chevron-left` */
780
+ declare function ChevronLeftIcon(props: IconGlyphProps): react.JSX.Element;
781
+ /** `chevron-right` */
782
+ declare function ChevronRightIcon(props: IconGlyphProps): react.JSX.Element;
783
+ /** `chevron-up` */
784
+ declare function ChevronUpIcon(props: IconGlyphProps): react.JSX.Element;
785
+ /** `circle-check` */
786
+ declare function CircleCheckIcon(props: IconGlyphProps): react.JSX.Element;
787
+ /** `circle-x` */
788
+ declare function CircleXIcon(props: IconGlyphProps): react.JSX.Element;
789
+ /** `clock` */
790
+ declare function ClockIcon(props: IconGlyphProps): react.JSX.Element;
791
+ /** `copy` */
792
+ declare function CopyIcon(props: IconGlyphProps): react.JSX.Element;
793
+ /** `document` */
794
+ declare function DocumentIcon(props: IconGlyphProps): react.JSX.Element;
795
+ /** `download` */
796
+ declare function DownloadIcon(props: IconGlyphProps): react.JSX.Element;
797
+ /** `edit` */
798
+ declare function EditIcon(props: IconGlyphProps): react.JSX.Element;
799
+ /** `external-link` */
800
+ declare function ExternalLinkIcon(props: IconGlyphProps): react.JSX.Element;
801
+ /** `eye` */
802
+ declare function EyeIcon(props: IconGlyphProps): react.JSX.Element;
803
+ /** `filter` */
804
+ declare function FilterIcon(props: IconGlyphProps): react.JSX.Element;
805
+ /** `flag` */
806
+ declare function FlagIcon(props: IconGlyphProps): react.JSX.Element;
807
+ /** `inbox` */
808
+ declare function InboxIcon(props: IconGlyphProps): react.JSX.Element;
809
+ /** `info` */
810
+ declare function InfoIcon(props: IconGlyphProps): react.JSX.Element;
811
+ /** `link` */
812
+ declare function LinkIcon(props: IconGlyphProps): react.JSX.Element;
813
+ /** `mail` */
814
+ declare function MailIcon(props: IconGlyphProps): react.JSX.Element;
815
+ /** `map-pin` */
816
+ declare function MapPinIcon(props: IconGlyphProps): react.JSX.Element;
817
+ /** `menu` */
818
+ declare function MenuIcon(props: IconGlyphProps): react.JSX.Element;
819
+ /** `minus` */
820
+ declare function MinusIcon(props: IconGlyphProps): react.JSX.Element;
821
+ /** `moon` */
822
+ declare function MoonIcon(props: IconGlyphProps): react.JSX.Element;
823
+ /** `more-horizontal` */
824
+ declare function MoreHorizontalIcon(props: IconGlyphProps): react.JSX.Element;
825
+ /** `more-vertical` */
826
+ declare function MoreVerticalIcon(props: IconGlyphProps): react.JSX.Element;
827
+ /** `pause` */
828
+ declare function PauseIcon(props: IconGlyphProps): react.JSX.Element;
829
+ /** `play` */
830
+ declare function PlayIcon(props: IconGlyphProps): react.JSX.Element;
831
+ /** `plus` */
832
+ declare function PlusIcon(props: IconGlyphProps): react.JSX.Element;
833
+ /** `refresh` */
834
+ declare function RefreshIcon(props: IconGlyphProps): react.JSX.Element;
835
+ /** `search` */
836
+ declare function SearchIcon(props: IconGlyphProps): react.JSX.Element;
837
+ /** `settings` */
838
+ declare function SettingsIcon(props: IconGlyphProps): react.JSX.Element;
839
+ /** `star` */
840
+ declare function StarIcon(props: IconGlyphProps): react.JSX.Element;
841
+ /** `sun` */
842
+ declare function SunIcon(props: IconGlyphProps): react.JSX.Element;
843
+ /** `thumbs-down` */
844
+ declare function ThumbsDownIcon(props: IconGlyphProps): react.JSX.Element;
845
+ /** `thumbs-up` */
846
+ declare function ThumbsUpIcon(props: IconGlyphProps): react.JSX.Element;
847
+ /** `trash` */
848
+ declare function TrashIcon(props: IconGlyphProps): react.JSX.Element;
849
+ /** `undo` */
850
+ declare function UndoIcon(props: IconGlyphProps): react.JSX.Element;
851
+ /** `user` */
852
+ declare function UserIcon(props: IconGlyphProps): react.JSX.Element;
853
+ /** `warning` */
854
+ declare function WarningIcon(props: IconGlyphProps): react.JSX.Element;
855
+ /** `x` */
856
+ declare function XIcon(props: IconGlyphProps): react.JSX.Element;
857
+
858
+ /** Every icon shipped by this package, as `<Name>Icon` components. */
859
+ declare const iconNames: readonly ["archive", "arrow-left", "arrow-right", "bell", "briefcase", "calendar", "check", "chevron-down", "chevron-left", "chevron-right", "chevron-up", "circle-check", "circle-x", "clock", "copy", "document", "download", "edit", "external-link", "eye", "filter", "flag", "inbox", "info", "link", "mail", "map-pin", "menu", "minus", "moon", "more-horizontal", "more-vertical", "pause", "play", "plus", "refresh", "search", "settings", "star", "sun", "thumbs-down", "thumbs-up", "trash", "undo", "user", "warning", "x"];
860
+ type IconName = (typeof iconNames)[number];
861
+
862
+ type TooltipSide = 'top' | 'bottom' | 'left' | 'right';
863
+ type TooltipAlign = 'start' | 'center' | 'end';
864
+ interface TooltipProps {
865
+ /** The hint. Short text; never anything the user cannot do without. */
866
+ content: ReactNode;
867
+ /** The trigger: one element that takes a ref and spreads props, such as `IconButton`, `Button` or `Badge`. */
868
+ children: ReactElement;
869
+ /** Which side of the trigger the hint opens on; flips when there is no room. Default `top`. */
870
+ side?: TooltipSide | undefined;
871
+ /** Alignment along that side. Default `center`. */
872
+ align?: TooltipAlign | undefined;
873
+ /** Hover delay in ms before opening. Default 300; inside `Tooltip.Provider` sibling tooltips open instantly once one is open. */
874
+ delay?: number | undefined;
875
+ /** Delay in ms before closing. Default 0. */
876
+ closeDelay?: number | undefined;
877
+ /** Controlled open state. */
878
+ open?: boolean | undefined;
879
+ /** Initial open state when uncontrolled. */
880
+ defaultOpen?: boolean | undefined;
881
+ /** Called when the hint opens or closes. */
882
+ onOpenChange?: ((open: boolean) => void) | undefined;
883
+ /** Never opens. */
884
+ disabled?: boolean | undefined;
885
+ className?: string | undefined;
886
+ }
887
+ /**
888
+ * A hint that opens on hover and keyboard focus. Supplementary only: touch devices never see it and
889
+ * screen readers hear the trigger's own name, so the trigger must already be labelled.
890
+ */
891
+ declare function TooltipBase({ content, children, side, align, delay, closeDelay, open, defaultOpen, onOpenChange, disabled, className, }: TooltipProps): react.JSX.Element;
892
+ declare const Tooltip: typeof TooltipBase & {
893
+ Provider: react.FC<_base_ui_react.TooltipProviderProps>;
894
+ };
895
+
896
+ interface IconButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'children' | 'aria-label'> {
897
+ /** Required. The accessible name, and the tooltip text when `tooltip` is `true`. */
898
+ label: string;
899
+ /** The icon, usually a shipped `<Name>Icon`. It is decorative; `label` names the button. Optional only so a popup trigger can supply it through `render`. */
900
+ children?: ReactNode | undefined;
901
+ /** `ghost` (default) in toolbars and rows, `secondary` when it must read as a button, `primary` and `danger` rarely. */
902
+ variant?: ButtonVariant | undefined;
903
+ /** Square: 32, 40 or 48px. Compact density shrinks each by one step. */
904
+ size?: ButtonSize | undefined;
905
+ /** `true` shows `label` as a tooltip on hover and focus; a string shows that text instead. */
906
+ tooltip?: boolean | string | undefined;
907
+ /** Side the tooltip opens on. Default `top`. */
908
+ tooltipSide?: TooltipSide | undefined;
909
+ /** Fully round, for avatars and floating actions. */
910
+ round?: boolean | undefined;
911
+ /** Shows a spinner, sets `aria-busy` and ignores clicks. */
912
+ loading?: boolean | undefined;
913
+ }
914
+ /** A square Button for one icon. Always named by `label`; use `tooltip` to show that name on hover. */
915
+ declare function IconButton({ label, children, variant, size, tooltip, tooltipSide, round, loading, type, className, onClick, ...rest }: IconButtonProps): react.JSX.Element;
916
+
917
+ type MenuSide = 'top' | 'bottom' | 'left' | 'right';
918
+ type MenuAlign = 'start' | 'center' | 'end';
919
+ type MenuItemTone = 'default' | 'danger';
920
+ interface MenuRootProps {
921
+ /** Controlled open state. */
922
+ open?: boolean | undefined;
923
+ /** Initial open state when uncontrolled. */
924
+ defaultOpen?: boolean | undefined;
925
+ /** Called when the menu opens or closes. */
926
+ onOpenChange?: ((open: boolean) => void) | undefined;
927
+ /** Disables the trigger. */
928
+ disabled?: boolean | undefined;
929
+ /** Default `true`: the page behind the menu is inert until it closes. */
930
+ modal?: boolean | undefined;
931
+ children?: ReactNode | undefined;
932
+ }
933
+ /** Owns the open state. Wrap a `Menu.Trigger` and a `Menu.Content`. */
934
+ declare function Root({ open, defaultOpen, onOpenChange, disabled, modal, children }: MenuRootProps): react.JSX.Element;
935
+ interface MenuTriggerProps extends Omit<Menu$1.Trigger.Props, 'className'> {
936
+ className?: string | undefined;
937
+ }
938
+ /**
939
+ * Opens the menu. With no `render` it is a secondary Button with a chevron; pass any Button or
940
+ * IconButton through `render`: `<Menu.Trigger render={<IconButton label="More" />}><MoreHorizontalIcon /></Menu.Trigger>`.
941
+ */
942
+ declare function Trigger({ render, className, children, ...rest }: MenuTriggerProps): react.JSX.Element;
943
+ interface MenuContentProps extends Omit<Menu$1.Popup.Props, 'className'> {
944
+ /** Side of the trigger the menu opens on; flips when there is no room. Default `bottom`. */
945
+ side?: MenuSide | undefined;
946
+ /** Alignment along that side. Default `start`. */
947
+ align?: MenuAlign | undefined;
948
+ /** Distance from the trigger in px. Default 4. */
949
+ sideOffset?: number | undefined;
950
+ className?: string | undefined;
951
+ }
952
+ /** Portal, positioner and the popup. Items go inside. */
953
+ declare function Content({ side, align, sideOffset, className, children, ...rest }: MenuContentProps): react.JSX.Element;
954
+ interface ItemSlots {
955
+ /** A 16px icon before the label. */
956
+ icon?: ReactNode | undefined;
957
+ /** Muted text at the end: a shortcut (`<Kbd>`) or a count. */
958
+ trailing?: ReactNode | undefined;
959
+ /** `danger` for destructive actions; put them last, after a separator. */
960
+ tone?: MenuItemTone | undefined;
961
+ }
962
+ interface MenuItemProps extends Omit<Menu$1.Item.Props, 'className'>, ItemSlots {
963
+ className?: string | undefined;
964
+ }
965
+ /** One action. Closes the menu when activated. */
966
+ declare function Item({ icon, trailing, tone, className, children, ...rest }: MenuItemProps): react.JSX.Element;
967
+ interface MenuLinkItemProps extends Omit<Menu$1.LinkItem.Props, 'className'>, ItemSlots {
968
+ className?: string | undefined;
969
+ }
970
+ /** An item that navigates: renders an `<a href>`. */
971
+ declare function LinkItem({ icon, trailing, tone, className, children, ...rest }: MenuLinkItemProps): react.JSX.Element;
972
+ interface MenuCheckboxItemProps extends Omit<Menu$1.CheckboxItem.Props, 'className' | 'onCheckedChange'> {
973
+ /** Called with the next checked state. */
974
+ onCheckedChange?: ((checked: boolean) => void) | undefined;
975
+ /** Muted text at the end. */
976
+ trailing?: ReactNode | undefined;
977
+ className?: string | undefined;
978
+ }
979
+ /** A toggle. Stays open when activated so several can be flipped at once; pass `closeOnClick` to close. */
980
+ declare function CheckboxItem({ trailing, onCheckedChange, className, children, ...rest }: MenuCheckboxItemProps): react.JSX.Element;
981
+ interface MenuRadioGroupProps<Value extends string = string> extends Omit<Menu$1.RadioGroup.Props, 'className' | 'value' | 'defaultValue' | 'onValueChange'> {
982
+ /** Controlled selected value. */
983
+ value?: Value | undefined;
984
+ /** Initial value when uncontrolled. */
985
+ defaultValue?: Value | undefined;
986
+ /** Called with the next selected value. */
987
+ onValueChange?: ((value: Value) => void) | undefined;
988
+ /** A heading for the group, rendered above the items. */
989
+ label?: ReactNode | undefined;
990
+ className?: string | undefined;
991
+ }
992
+ /** A set of `Menu.RadioItem`s where exactly one is selected. */
993
+ declare function RadioGroup<Value extends string = string>({ label, onValueChange, className, children, ...rest }: MenuRadioGroupProps<Value>): react.JSX.Element;
994
+ interface MenuRadioItemProps extends Omit<Menu$1.RadioItem.Props, 'className' | 'value'> {
995
+ value: string;
996
+ /** Muted text at the end. */
997
+ trailing?: ReactNode | undefined;
998
+ className?: string | undefined;
999
+ }
1000
+ /** One choice in a `Menu.RadioGroup`. Stays open when chosen; pass `closeOnClick` to close. */
1001
+ declare function RadioItem({ trailing, className, children, ...rest }: MenuRadioItemProps): react.JSX.Element;
1002
+ interface MenuGroupProps extends Omit<Menu$1.Group.Props, 'className'> {
1003
+ /** A heading for the group, rendered above the items. */
1004
+ label?: ReactNode | undefined;
1005
+ className?: string | undefined;
1006
+ }
1007
+ /** Labels a run of items. */
1008
+ declare function Group({ label, className, children, ...rest }: MenuGroupProps): react.JSX.Element;
1009
+ interface MenuSeparatorProps extends Omit<Menu$1.Separator.Props, 'className'> {
1010
+ className?: string | undefined;
1011
+ }
1012
+ /** A hairline between runs of items. */
1013
+ declare function Separator({ className, ...rest }: MenuSeparatorProps): react.JSX.Element;
1014
+ /** A dropdown of actions on a trigger, with full keyboard support. Built on Base UI's Menu. */
1015
+ declare const Menu: {
1016
+ Root: typeof Root;
1017
+ Trigger: typeof Trigger;
1018
+ Content: typeof Content;
1019
+ Item: typeof Item;
1020
+ LinkItem: typeof LinkItem;
1021
+ CheckboxItem: typeof CheckboxItem;
1022
+ RadioGroup: typeof RadioGroup;
1023
+ RadioItem: typeof RadioItem;
1024
+ Group: typeof Group;
1025
+ Separator: typeof Separator;
1026
+ };
1027
+
1028
+ declare const version = "0.1.1";
745
1029
 
746
- export { Badge, Button, Card, Dialog, Inline, Kbd, Stack, version };
747
- export type { BadgeProps, BadgeSize, BadgeTone, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, CardElement, CardPadding, CardProps, CardVariant, DialogActionsProps, DialogBodyProps, DialogCloseProps, DialogContentProps, DialogDescriptionProps, DialogRootProps, DialogSize, DialogTitleProps, InlineAlign, InlineElement, InlineJustify, InlineProps, KbdGroupProps, KbdProps, SpacingSize, StackAlign, StackElement, StackJustify, StackProps };
1030
+ export { ArchiveIcon, ArrowLeftIcon, ArrowRightIcon, Badge, BellIcon, BriefcaseIcon, Button, CalendarIcon, Card, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleCheckIcon, CircleXIcon, ClockIcon, CopyIcon, Dialog, DocumentIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, FilterIcon, FlagIcon, Icon, IconButton, InboxIcon, InfoIcon, Inline, Kbd, LinkIcon, MailIcon, MapPinIcon, Menu, MenuIcon, MinusIcon, MoonIcon, MoreHorizontalIcon, MoreVerticalIcon, PauseIcon, PlayIcon, PlusIcon, RefreshIcon, SearchIcon, SettingsIcon, Stack, StarIcon, SunIcon, ThumbsDownIcon, ThumbsUpIcon, Tooltip, TrashIcon, UndoIcon, UserIcon, WarningIcon, XIcon, iconNames, version };
1031
+ export type { BadgeProps, BadgeSize, BadgeTone, BadgeVariant, ButtonProps, ButtonSize, ButtonVariant, CardElement, CardPadding, CardProps, CardVariant, DialogActionsProps, DialogBodyProps, DialogCloseProps, DialogContentProps, DialogDescriptionProps, DialogRootProps, DialogSize, DialogTitleProps, IconButtonProps, IconGlyphProps, IconName, IconProps, IconSize, InlineAlign, InlineElement, InlineJustify, InlineProps, KbdGroupProps, KbdProps, MenuAlign, MenuCheckboxItemProps, MenuContentProps, MenuGroupProps, MenuItemProps, MenuItemTone, MenuLinkItemProps, MenuRadioGroupProps, MenuRadioItemProps, MenuRootProps, MenuSeparatorProps, MenuSide, MenuTriggerProps, SpacingSize, StackAlign, StackElement, StackJustify, StackProps, TooltipAlign, TooltipProps, TooltipSide };