@calcifer-design/ui 0.2.1 → 0.4.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.
Files changed (75) hide show
  1. package/dist/components/Alert/Alert.js +4 -15
  2. package/dist/components/Alert/Alert.module.js +1 -2
  3. package/dist/components/Alert/Alert_module.css +0 -12
  4. package/dist/components/Avatar/Avatar.js +2 -1
  5. package/dist/components/Avatar/Avatar.module.js +1 -2
  6. package/dist/components/Avatar/Avatar_module.css +0 -12
  7. package/dist/components/Checkbox/Checkbox.d.ts +23 -0
  8. package/dist/components/Checkbox/Checkbox.js +33 -0
  9. package/dist/components/Checkbox/Checkbox.module.js +6 -0
  10. package/dist/components/Checkbox/Checkbox_module.css +16 -0
  11. package/dist/components/DataTable/DataTable.js +7 -2
  12. package/dist/components/DataTable/DataTable_module.css +0 -16
  13. package/dist/components/Dialog/Dialog.d.ts +44 -0
  14. package/dist/components/Dialog/Dialog.js +82 -0
  15. package/dist/components/Dialog/Dialog.module.js +10 -0
  16. package/dist/components/Dialog/Dialog_module.css +51 -0
  17. package/dist/components/Field/Field.d.ts +118 -0
  18. package/dist/components/Field/Field.js +84 -0
  19. package/dist/components/LiveRegion/LiveRegion.js +2 -2
  20. package/dist/components/Menu/Menu.d.ts +35 -0
  21. package/dist/components/Menu/Menu.js +44 -0
  22. package/dist/components/Menu/Menu.module.js +6 -0
  23. package/dist/components/Menu/Menu_module.css +29 -0
  24. package/dist/components/NavMenu/NavMenu.js +4 -2
  25. package/dist/components/NavMenu/NavMenu.module.js +0 -2
  26. package/dist/components/NavMenu/NavMenu_module.css +0 -15
  27. package/dist/components/Popover/Popover.d.ts +42 -0
  28. package/dist/components/Popover/Popover.js +61 -0
  29. package/dist/components/Popover/Popover.module.js +6 -0
  30. package/dist/components/Popover/Popover_module.css +13 -0
  31. package/dist/components/RadioGroup/RadioGroup.d.ts +35 -0
  32. package/dist/components/RadioGroup/RadioGroup.js +64 -0
  33. package/dist/components/RadioGroup/RadioGroup.module.js +6 -0
  34. package/dist/components/RadioGroup/RadioGroup_module.css +13 -0
  35. package/dist/components/Select/Select.d.ts +42 -0
  36. package/dist/components/Select/Select.js +90 -0
  37. package/dist/components/Select/Select.module.js +9 -0
  38. package/dist/components/Select/Select_module.css +70 -0
  39. package/dist/components/Spinner/Spinner.js +2 -1
  40. package/dist/components/Spinner/Spinner.module.js +1 -2
  41. package/dist/components/Spinner/Spinner_module.css +0 -12
  42. package/dist/components/StatusDot/StatusDot.js +6 -1
  43. package/dist/components/StatusDot/StatusDot_module.css +0 -12
  44. package/dist/components/Switch/Switch.d.ts +23 -0
  45. package/dist/components/Switch/Switch.js +25 -0
  46. package/dist/components/Switch/Switch.module.js +6 -0
  47. package/dist/components/Switch/Switch_module.css +41 -0
  48. package/dist/components/TextInput/TextInput.d.ts +17 -0
  49. package/dist/components/TextInput/TextInput.js +18 -0
  50. package/dist/components/ToastRegion/ToastRegion.d.ts +72 -0
  51. package/dist/components/ToastRegion/ToastRegion.js +85 -0
  52. package/dist/components/ToastRegion/ToastRegion.module.js +10 -0
  53. package/dist/components/ToastRegion/ToastRegion_module.css +104 -0
  54. package/dist/components/Tooltip/Tooltip.d.ts +33 -0
  55. package/dist/components/Tooltip/Tooltip.js +28 -0
  56. package/dist/components/Tooltip/TooltipProvider.d.ts +24 -0
  57. package/dist/components/Tooltip/TooltipProvider.js +11 -0
  58. package/dist/icons/CheckIcon.d.ts +6 -0
  59. package/dist/icons/CheckIcon.js +17 -0
  60. package/dist/icons/ChevronDownIcon.d.ts +6 -0
  61. package/dist/icons/ChevronDownIcon.js +17 -0
  62. package/dist/icons/CloseIcon.d.ts +10 -0
  63. package/dist/icons/CloseIcon.js +21 -0
  64. package/dist/icons/MinusIcon.d.ts +5 -0
  65. package/dist/icons/MinusIcon.js +16 -0
  66. package/dist/index.d.ts +24 -0
  67. package/dist/index.js +12 -0
  68. package/dist/styles/a11y.module.js +5 -0
  69. package/dist/{components/LiveRegion/LiveRegion_module.css → styles/a11y_module.css} +1 -1
  70. package/dist/styles/field.module.js +15 -0
  71. package/dist/styles/field_module.css +133 -0
  72. package/dist/styles/popup.module.js +9 -0
  73. package/dist/styles/popup_module.css +109 -0
  74. package/package.json +2 -2
  75. package/dist/components/LiveRegion/LiveRegion.module.js +0 -5
@@ -1,4 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
+ import a11y_module from "../../styles/a11y.module.js";
2
3
  import Spinner_module from "./Spinner.module.js";
3
4
  function Spinner({ size = 'md', label }) {
4
5
  const ring = /*#__PURE__*/ jsx("span", {
@@ -14,7 +15,7 @@ function Spinner({ size = 'md', label }) {
14
15
  children: [
15
16
  ring,
16
17
  /*#__PURE__*/ jsx("span", {
17
- className: Spinner_module.label,
18
+ className: a11y_module.visuallyHidden,
18
19
  children: label
19
20
  })
20
21
  ]
@@ -2,7 +2,6 @@ import "./Spinner_module.css";
2
2
  const Spinner_module = {
3
3
  root: "root-txP67",
4
4
  spin: "spin-yXQPz",
5
- wrapper: "wrapper-xbqhl",
6
- label: "label-RTZW7"
5
+ wrapper: "wrapper-xbqhl"
7
6
  };
8
7
  export default Spinner_module;
@@ -30,18 +30,6 @@
30
30
  display: inline-flex;
31
31
  }
32
32
 
33
- .label-RTZW7 {
34
- clip-path: inset(50%);
35
- white-space: nowrap;
36
- border: 0;
37
- width: 1px;
38
- height: 1px;
39
- margin: -1px;
40
- padding: 0;
41
- position: absolute;
42
- overflow: hidden;
43
- }
44
-
45
33
  @keyframes spin-yXQPz {
46
34
  to {
47
35
  transform: rotate(360deg);
@@ -1,6 +1,11 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
+ import a11y_module from "../../styles/a11y.module.js";
2
3
  import StatusDot_module from "./StatusDot.module.js";
3
4
  function StatusDot({ status, label, labelStyle = 'mono', showLabel = true }) {
5
+ const labelClassName = [
6
+ StatusDot_module.label,
7
+ showLabel ? null : a11y_module.visuallyHidden
8
+ ].filter(Boolean).join(' ');
4
9
  return /*#__PURE__*/ jsxs("span", {
5
10
  className: StatusDot_module.root,
6
11
  "data-status": status,
@@ -12,7 +17,7 @@ function StatusDot({ status, label, labelStyle = 'mono', showLabel = true }) {
12
17
  "aria-hidden": "true"
13
18
  }),
14
19
  /*#__PURE__*/ jsx("span", {
15
- className: StatusDot_module.label,
20
+ className: labelClassName,
16
21
  "data-hidden": showLabel ? void 0 : '',
17
22
  children: label
18
23
  }),
@@ -35,18 +35,6 @@
35
35
  overflow: hidden;
36
36
  }
37
37
 
38
- .label-m8svl[data-hidden] {
39
- clip-path: inset(50%);
40
- white-space: nowrap;
41
- border: 0;
42
- width: 1px;
43
- height: 1px;
44
- margin: -1px;
45
- padding: 0;
46
- position: absolute;
47
- overflow: hidden;
48
- }
49
-
50
38
  .root-tgMEi[data-label-style="text"] .label-m8svl {
51
39
  font-family: var(--font-sans);
52
40
  color: var(--color-text);
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type FieldFrameProps } from '../Field/Field.js';
3
+ export interface SwitchProps extends FieldFrameProps {
4
+ /** The text beside the track, and the switch's accessible name. */
5
+ label: string;
6
+ /** Sits under the row and joins the switch's `aria-describedby`. */
7
+ description?: ReactNode;
8
+ /**
9
+ * The validation message. It is rendered and announced; the track itself is not restyled,
10
+ * because a switch's state is binary and already visible.
11
+ */
12
+ error?: string;
13
+ /** Controlled. Pair it with `onCheckedChange`; use `defaultChecked` for an uncontrolled one. */
14
+ checked?: boolean;
15
+ defaultChecked?: boolean;
16
+ /**
17
+ * The new checked state. One argument, as on every other control in the tier: Base UI calls
18
+ * its own callback `(checked, eventDetails)` and this wrapper drops the second, which no
19
+ * consumer can read without a cast.
20
+ */
21
+ onCheckedChange?: (checked: boolean) => void;
22
+ }
23
+ export declare function Switch({ label, name, description, error, checked, defaultChecked, onCheckedChange, required, disabled, }: SwitchProps): import("react").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Switch } from "@base-ui/react/switch";
3
+ import { InlineField } from "../Field/Field.js";
4
+ import Switch_module from "./Switch.module.js";
5
+ function Switch_Switch({ label, name, description, error, checked, defaultChecked, onCheckedChange, required = false, disabled = false }) {
6
+ return /*#__PURE__*/ jsx(InlineField, {
7
+ label: label,
8
+ name: name,
9
+ description: description,
10
+ error: error,
11
+ required: required,
12
+ disabled: disabled,
13
+ children: /*#__PURE__*/ jsx(Switch.Root, {
14
+ className: Switch_module.track,
15
+ checked: checked,
16
+ defaultChecked: defaultChecked,
17
+ onCheckedChange: (nextChecked)=>onCheckedChange?.(nextChecked),
18
+ required: required,
19
+ children: /*#__PURE__*/ jsx(Switch.Thumb, {
20
+ className: Switch_module.thumb
21
+ })
22
+ })
23
+ });
24
+ }
25
+ export { Switch_Switch as Switch };
@@ -0,0 +1,6 @@
1
+ import "./Switch_module.css";
2
+ const Switch_module = {
3
+ track: "track-vswWH",
4
+ thumb: "thumb-aDkgm"
5
+ };
6
+ export default Switch_module;
@@ -0,0 +1,41 @@
1
+ .track-vswWH {
2
+ width: 2.5rem;
3
+ height: 1.5rem;
4
+ padding: var(--space-1);
5
+ border: 1px solid var(--color-border-strong);
6
+ border-radius: var(--radius-full);
7
+ background: var(--color-surface-3);
8
+ cursor: pointer;
9
+ transition-property: background-color, border-color;
10
+ transition-duration: var(--motion-duration-1);
11
+ transition-timing-function: var(--motion-ease);
12
+ flex: none;
13
+ align-items: center;
14
+ display: inline-flex;
15
+ }
16
+
17
+ .track-vswWH[data-checked] {
18
+ border-color: var(--color-accent);
19
+ background: var(--color-accent);
20
+ }
21
+
22
+ .track-vswWH[data-disabled] {
23
+ cursor: not-allowed;
24
+ opacity: .55;
25
+ }
26
+
27
+ .thumb-aDkgm {
28
+ border-radius: var(--radius-full);
29
+ background: var(--color-surface-raised);
30
+ width: 1rem;
31
+ height: 1rem;
32
+ box-shadow: var(--elevation-1);
33
+ transition-property: transform;
34
+ transition-duration: var(--motion-duration-1);
35
+ transition-timing-function: var(--motion-ease);
36
+ }
37
+
38
+ .thumb-aDkgm[data-checked] {
39
+ transform: translateX(.875rem);
40
+ }
41
+
@@ -0,0 +1,17 @@
1
+ import type { ComponentPropsWithoutRef, ReactElement } from 'react';
2
+ export type TextInputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url' | 'date' | 'number';
3
+ export interface TextInputProps extends Omit<ComponentPropsWithoutRef<'input'>, 'className' | 'type' | 'value' | 'defaultValue' | 'onChange' | 'required' | 'name' | 'disabled'> {
4
+ /** Ignored when `render` is given: the caller's element brings its own. */
5
+ type?: TextInputType;
6
+ value?: string;
7
+ defaultValue?: string;
8
+ /** Base UI reports the new value directly; there is no event to read `.target.value` off. */
9
+ onValueChange?: (value: string) => void;
10
+ /**
11
+ * Render a different element in place of the `<input>`, keeping the field wiring and the
12
+ * control skin: a `<textarea rows={4} />`, an `<input type="file" />`, a masked input. This
13
+ * is the tier's escape hatch for a control the library does not ship.
14
+ */
15
+ render?: ReactElement;
16
+ }
17
+ export declare function TextInput({ type, value, defaultValue, onValueChange, render, ...rest }: TextInputProps): import("react").JSX.Element;
@@ -0,0 +1,18 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Input } from "@base-ui/react/input";
3
+ import { useFieldRequired } from "../Field/Field.js";
4
+ import field_module from "../../styles/field.module.js";
5
+ function TextInput({ type = 'text', value, defaultValue, onValueChange, render, ...rest }) {
6
+ const required = useFieldRequired();
7
+ return /*#__PURE__*/ jsx(Input, {
8
+ ...rest,
9
+ className: field_module.control,
10
+ type: void 0 === render ? type : void 0,
11
+ value: value,
12
+ defaultValue: defaultValue,
13
+ onValueChange: onValueChange,
14
+ required: required,
15
+ render: render
16
+ });
17
+ }
18
+ export { TextInput };
@@ -0,0 +1,72 @@
1
+ import type { ToastManager as BaseToastManager } from '@base-ui/react/toast';
2
+ export type ToastTone = 'info' | 'success' | 'warning' | 'danger';
3
+ export interface ToastAction {
4
+ label: string;
5
+ onClick: () => void;
6
+ }
7
+ export interface ToastOptions {
8
+ /**
9
+ * The manager's data payload, spread into Base UI's `add()`, which expects
10
+ * `title`/`description`; kept as `title` rather than the library's `heading` convention
11
+ * because the cross-repository Bridge contract carries the same `title: string`.
12
+ */
13
+ title: string;
14
+ description?: string;
15
+ tone?: ToastTone;
16
+ /** Milliseconds before the toast dismisses itself. `0` keeps it until it is closed. */
17
+ timeout?: number;
18
+ /** `high` also mirrors the toast into a hidden `role="alert"` region, so it interrupts. */
19
+ priority?: 'low' | 'high';
20
+ /** Reusing an id updates that toast in place and restarts its dismiss timer. */
21
+ id?: string;
22
+ action?: ToastAction;
23
+ }
24
+ /**
25
+ * The object a host hands to a remote so the remote can raise a toast in the host's single
26
+ * viewport. Deliberately narrower than Base UI's own manager: `title` and `description` are
27
+ * `string`, not `ReactNode`, because an element authored in a remote would render inside the
28
+ * host's React root and under the host's CSS.
29
+ */
30
+ export interface ToastManager {
31
+ add: (options: ToastOptions) => string;
32
+ /**
33
+ * Closes one toast by id. Omitting `toastId` closes every toast in the store (Base UI's
34
+ * `closeAll` path) — a caller that wants a no-op must pass an id.
35
+ */
36
+ close: (toastId?: string) => void;
37
+ update: (toastId: string, options: Omit<Partial<ToastOptions>, 'id'>) => void;
38
+ /**
39
+ * The Base UI manager `ToastRegion` subscribes to. Not part of the surface a remote is given —
40
+ * the Bridge contract declares only `add`, `close` and `update`.
41
+ */
42
+ readonly baseManager: BaseToastManager;
43
+ }
44
+ /**
45
+ * Creates a toast manager outside React. It is a plain object over a listener set: no context,
46
+ * no hooks, no module-identity requirement — which is exactly why it survives the trip across
47
+ * the Bridge into a remote's separate React root, where a provider's context could not.
48
+ *
49
+ * A call made while no `ToastRegion` is mounted is dropped: `add` still returns an id, and the
50
+ * toast is never shown.
51
+ */
52
+ export declare function createToastManager(): ToastManager;
53
+ export interface ToastRegionProps {
54
+ /** The manager this region renders. One region per manager, and one manager per page. */
55
+ manager: ToastManager;
56
+ /** The landmark's accessible name. */
57
+ label?: string;
58
+ /** How many toasts are on screen at once; the rest wait, marked `data-limited`. */
59
+ limit?: number;
60
+ /** Default milliseconds before a toast dismisses itself. `0` keeps every toast until closed. */
61
+ timeout?: number;
62
+ /** The accessible name of each toast's close control. */
63
+ closeLabel?: string;
64
+ }
65
+ /**
66
+ * The whole toast apparatus as one component: provider, portal and viewport together, so no
67
+ * consumer can mount a second viewport by accident. That matters because it is the viewport —
68
+ * not the provider — that renders the `role="region"` landmark, the hidden `role="alert"` mirror
69
+ * for high-priority toasts, and four window-level listeners. Two of them overlap in the same
70
+ * screen corner, and the last-committed one silently wins.
71
+ */
72
+ export declare function ToastRegion({ manager, label, limit, timeout, closeLabel, }: ToastRegionProps): import("react").JSX.Element;
@@ -0,0 +1,85 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Toast } from "@base-ui/react/toast";
3
+ import { CloseIcon } from "../../icons/CloseIcon.js";
4
+ import { IconButton } from "../IconButton/IconButton.js";
5
+ import popup_module from "../../styles/popup.module.js";
6
+ import ToastRegion_module from "./ToastRegion.module.js";
7
+ function toBaseOptions(options) {
8
+ const { tone, action, ...rest } = options;
9
+ return {
10
+ ...rest,
11
+ ...void 0 === tone ? {} : {
12
+ type: tone
13
+ },
14
+ ...void 0 === action ? {} : {
15
+ actionProps: {
16
+ children: action.label,
17
+ onClick: action.onClick
18
+ }
19
+ }
20
+ };
21
+ }
22
+ function createToastManager() {
23
+ const baseManager = Toast.createToastManager();
24
+ return {
25
+ baseManager,
26
+ add: (options)=>baseManager.add(toBaseOptions(options)),
27
+ close: (toastId)=>{
28
+ baseManager.close(toastId);
29
+ },
30
+ update: (toastId, options)=>{
31
+ baseManager.update(toastId, toBaseOptions(options));
32
+ }
33
+ };
34
+ }
35
+ function ToastList({ closeLabel }) {
36
+ const { toasts } = Toast.useToastManager();
37
+ return toasts.map((toastObject)=>/*#__PURE__*/ jsxs(Toast.Root, {
38
+ toast: toastObject,
39
+ className: ToastRegion_module.toast,
40
+ children: [
41
+ /*#__PURE__*/ jsxs(Toast.Content, {
42
+ className: ToastRegion_module.content,
43
+ children: [
44
+ /*#__PURE__*/ jsx(Toast.Title, {
45
+ className: ToastRegion_module.heading
46
+ }),
47
+ /*#__PURE__*/ jsx(Toast.Description, {
48
+ className: ToastRegion_module.description
49
+ })
50
+ ]
51
+ }),
52
+ /*#__PURE__*/ jsx(Toast.Action, {
53
+ className: ToastRegion_module.action
54
+ }),
55
+ /*#__PURE__*/ jsx(Toast.Close, {
56
+ render: /*#__PURE__*/ jsx(IconButton, {
57
+ label: closeLabel,
58
+ variant: "ghost",
59
+ size: "sm",
60
+ children: /*#__PURE__*/ jsx(CloseIcon, {})
61
+ })
62
+ })
63
+ ]
64
+ }, toastObject.id));
65
+ }
66
+ function ToastRegion({ manager, label = 'Notifications', limit = 3, timeout = 5000, closeLabel = 'Close' }) {
67
+ return /*#__PURE__*/ jsx(Toast.Provider, {
68
+ toastManager: manager.baseManager,
69
+ limit: limit,
70
+ timeout: timeout,
71
+ children: /*#__PURE__*/ jsx(Toast.Portal, {
72
+ children: /*#__PURE__*/ jsx(Toast.Viewport, {
73
+ className: [
74
+ popup_module.toastLayer,
75
+ ToastRegion_module.viewport
76
+ ].join(' '),
77
+ "aria-label": label,
78
+ children: /*#__PURE__*/ jsx(ToastList, {
79
+ closeLabel: closeLabel
80
+ })
81
+ })
82
+ })
83
+ });
84
+ }
85
+ export { ToastRegion, createToastManager };
@@ -0,0 +1,10 @@
1
+ import "./ToastRegion_module.css";
2
+ const ToastRegion_module = {
3
+ viewport: "viewport-v4Y5F",
4
+ toast: "toast-G4ytY",
5
+ content: "content-tQIoA",
6
+ heading: "heading-BAZ9J",
7
+ description: "description-a9oJ4",
8
+ action: "action-NmziC"
9
+ };
10
+ export default ToastRegion_module;
@@ -0,0 +1,104 @@
1
+ .viewport-v4Y5F {
2
+ right: var(--space-5);
3
+ bottom: var(--space-5);
4
+ width: min(22rem, calc(100vw - var(--space-6)));
5
+ position: fixed;
6
+ left: auto;
7
+ }
8
+
9
+ .toast-G4ytY {
10
+ align-items: flex-start;
11
+ gap: var(--space-3);
12
+ width: 100%;
13
+ padding: var(--space-3) var(--space-4);
14
+ border: 1px solid var(--color-border);
15
+ border-inline-start: var(--border-width-strong) solid var(--color-neutral);
16
+ border-radius: var(--radius-lg);
17
+ background: var(--color-surface-raised);
18
+ color: var(--color-text);
19
+ box-shadow: var(--elevation-2);
20
+ transition-property: transform, opacity;
21
+ transition-duration: var(--motion-duration-3);
22
+ transition-timing-function: var(--motion-ease);
23
+ transform: translateY(calc(var(--toast-index) * -.5rem))
24
+ scale(calc(1 - var(--toast-index) * .04));
25
+ z-index: calc(100 - var(--toast-index));
26
+ display: flex;
27
+ position: absolute;
28
+ bottom: 0;
29
+ left: auto;
30
+ right: 0;
31
+ }
32
+
33
+ .toast-G4ytY[data-expanded] {
34
+ transform: translateY(calc((var(--toast-offset-y) + var(--toast-index) * var(--space-2)) * -1));
35
+ }
36
+
37
+ .toast-G4ytY[data-limited] {
38
+ opacity: 0;
39
+ }
40
+
41
+ .toast-G4ytY[data-starting-style] {
42
+ opacity: 0;
43
+ transform: translateY(100%);
44
+ }
45
+
46
+ .toast-G4ytY[data-ending-style] {
47
+ opacity: 0;
48
+ }
49
+
50
+ .toast-G4ytY[data-type="info"] {
51
+ border-inline-start-color: var(--color-accent);
52
+ }
53
+
54
+ .toast-G4ytY[data-type="success"] {
55
+ border-inline-start-color: var(--color-success);
56
+ }
57
+
58
+ .toast-G4ytY[data-type="warning"] {
59
+ border-inline-start-color: var(--color-warning);
60
+ }
61
+
62
+ .toast-G4ytY[data-type="danger"] {
63
+ border-inline-start-color: var(--color-danger);
64
+ }
65
+
66
+ .content-tQIoA {
67
+ gap: var(--space-1);
68
+ flex-direction: column;
69
+ flex: auto;
70
+ min-width: 0;
71
+ display: flex;
72
+ }
73
+
74
+ .heading-BAZ9J {
75
+ color: var(--color-text);
76
+ font-size: var(--text-sm);
77
+ font-weight: 600;
78
+ line-height: var(--leading-snug);
79
+ }
80
+
81
+ .description-a9oJ4 {
82
+ color: var(--color-text-muted);
83
+ font-size: var(--text-sm);
84
+ line-height: var(--leading-prose);
85
+ }
86
+
87
+ .action-NmziC {
88
+ padding: var(--space-1) var(--space-3);
89
+ border: 1px solid var(--color-border-strong);
90
+ border-radius: var(--radius-md);
91
+ color: var(--color-text);
92
+ font-size: var(--text-sm);
93
+ cursor: pointer;
94
+ background: none;
95
+ flex: none;
96
+ align-self: center;
97
+ }
98
+
99
+ @media (hover: hover) {
100
+ .action-NmziC:hover {
101
+ background: var(--color-surface-2);
102
+ }
103
+ }
104
+
@@ -0,0 +1,33 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { PopupAlign, PopupSide } from '../Popover/Popover.js';
3
+ export interface TooltipProps {
4
+ /**
5
+ * The control the tip describes, rendered as the trigger itself: it must be a single element
6
+ * that produces a native `<button>`.
7
+ */
8
+ trigger: ReactElement;
9
+ /**
10
+ * The tip's text, applied to the trigger as `aria-label`. Base UI merges the render element's
11
+ * own props last, so this becomes the trigger's accessible name only when the trigger carries
12
+ * no `aria-label` of its own — a trigger that already has one (as `IconButton` always does,
13
+ * from its required `label`) keeps its own, and the two must then be kept identical by hand;
14
+ * nothing here enforces that.
15
+ *
16
+ * Base UI's tooltip puts nothing in the accessibility tree: the popup carries no
17
+ * `role="tooltip"`, the trigger gets no `aria-describedby`, and it is disabled on touch
18
+ * devices. This is therefore a label for a control that has no visible text, not a place for
19
+ * prose — for a sentence of help use `Popover`, and for feedback about something that just
20
+ * happened use a toast.
21
+ */
22
+ label: string;
23
+ side?: PopupSide;
24
+ align?: PopupAlign;
25
+ /** Gap between the trigger and the popup, in pixels. */
26
+ sideOffset?: number;
27
+ /**
28
+ * Hover delay in milliseconds for this trigger alone. Leave it out and the tooltip takes the
29
+ * delay from the nearest `TooltipProvider`, falling back to Base UI's own 600ms.
30
+ */
31
+ delay?: number;
32
+ }
33
+ export declare function Tooltip({ trigger, label, side, align, sideOffset, delay, }: TooltipProps): import("react").JSX.Element;
@@ -0,0 +1,28 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Tooltip } from "@base-ui/react/tooltip";
3
+ import popup_module from "../../styles/popup.module.js";
4
+ function Tooltip_Tooltip({ trigger, label, side = 'top', align = 'center', sideOffset = 8, delay }) {
5
+ return /*#__PURE__*/ jsxs(Tooltip.Root, {
6
+ children: [
7
+ /*#__PURE__*/ jsx(Tooltip.Trigger, {
8
+ render: trigger,
9
+ "aria-label": label,
10
+ delay: delay
11
+ }),
12
+ /*#__PURE__*/ jsx(Tooltip.Portal, {
13
+ children: /*#__PURE__*/ jsx(Tooltip.Positioner, {
14
+ className: popup_module.layer,
15
+ side: side,
16
+ align: align,
17
+ sideOffset: sideOffset,
18
+ children: /*#__PURE__*/ jsx(Tooltip.Popup, {
19
+ className: popup_module.surface,
20
+ "data-popup": "tooltip",
21
+ children: label
22
+ })
23
+ })
24
+ })
25
+ ]
26
+ });
27
+ }
28
+ export { Tooltip_Tooltip as Tooltip };
@@ -0,0 +1,24 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * Base UI's own default hover delay, in milliseconds, re-exported as a constant so the shell and
4
+ * every remote use one value across the federation seam. A remote that mounts its own provider
5
+ * with this number produces the same feel as the host's, which is the whole point: the seam
6
+ * should be invisible to someone moving the pointer across it.
7
+ */
8
+ export declare const TOOLTIP_DELAY = 600;
9
+ export interface TooltipProviderProps {
10
+ children?: ReactNode;
11
+ /** Hover delay in milliseconds shared by every tooltip below this provider. */
12
+ delay?: number;
13
+ /** How long a tooltip waits before closing, in milliseconds. */
14
+ closeDelay?: number;
15
+ }
16
+ /**
17
+ * Groups the tooltips below it, so that once one has opened its neighbours open instantly.
18
+ *
19
+ * It renders no DOM, mounts no portal and attaches no window listeners — two React contexts and
20
+ * a timer — which is why every federated remote mounts its own instead of trying to reach the
21
+ * host's through context, which cannot cross a React root boundary. It is also optional: without
22
+ * one, each trigger falls back to this same delay on its own.
23
+ */
24
+ export declare function TooltipProvider({ children, delay, closeDelay, }: TooltipProviderProps): import("react").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Tooltip } from "@base-ui/react/tooltip";
3
+ const TOOLTIP_DELAY = 600;
4
+ function TooltipProvider({ children, delay = TOOLTIP_DELAY, closeDelay }) {
5
+ return /*#__PURE__*/ jsx(Tooltip.Provider, {
6
+ delay: delay,
7
+ closeDelay: closeDelay,
8
+ children: children
9
+ });
10
+ }
11
+ export { TOOLTIP_DELAY, TooltipProvider };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The tick inside a selected `Select` option and a ticked `Checkbox`. Internal, like
3
+ * `CloseIcon` and `ChevronDownIcon`; decorative in both places, because the option's text and
4
+ * the checkbox's label carry the meaning.
5
+ */
6
+ export declare function CheckIcon(): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ function CheckIcon() {
3
+ return /*#__PURE__*/ jsx("svg", {
4
+ viewBox: "0 0 16 16",
5
+ fill: "none",
6
+ stroke: "currentColor",
7
+ strokeWidth: "2",
8
+ strokeLinecap: "round",
9
+ strokeLinejoin: "round",
10
+ "aria-hidden": "true",
11
+ focusable: "false",
12
+ children: /*#__PURE__*/ jsx("path", {
13
+ d: "m3.5 8.5 3 3 6-7"
14
+ })
15
+ });
16
+ }
17
+ export { CheckIcon };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * The chevron on a `Select` trigger. Internal, exactly as `CloseIcon` is: the barrel does not
3
+ * export it, so consumers bring their own icon set. It is decorative — Base UI marks
4
+ * `Select.Icon` `aria-hidden` itself — and declares no size; the control that holds it sizes it.
5
+ */
6
+ export declare function ChevronDownIcon(): import("react").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ function ChevronDownIcon() {
3
+ return /*#__PURE__*/ jsx("svg", {
4
+ viewBox: "0 0 16 16",
5
+ fill: "none",
6
+ stroke: "currentColor",
7
+ strokeWidth: "1.5",
8
+ strokeLinecap: "round",
9
+ strokeLinejoin: "round",
10
+ "aria-hidden": "true",
11
+ focusable: "false",
12
+ children: /*#__PURE__*/ jsx("path", {
13
+ d: "m4 6.25 4 4 4-4"
14
+ })
15
+ });
16
+ }
17
+ export { ChevronDownIcon };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The library's one close glyph. `Alert`'s dismiss control, `Dialog`'s header control and each
3
+ * toast's close control all draw it; each authored its own copy before this module existed.
4
+ *
5
+ * Internal on purpose: the barrel does not export it, so it is no part of the published surface
6
+ * and consumers bring their own icon set. It is decorative everywhere it is used — the button
7
+ * around it carries the accessible name — which is why it is `aria-hidden` and not focusable.
8
+ * It declares no size; the control that holds it sizes it.
9
+ */
10
+ export declare function CloseIcon(): import("react").JSX.Element;