@jobber/components 8.22.0 → 8.23.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 (72) hide show
  1. package/dist/CSPContext-cjs.js +69 -0
  2. package/dist/CSPContext-es.js +46 -0
  3. package/dist/Card/index.cjs +2 -0
  4. package/dist/Card/index.mjs +2 -0
  5. package/dist/ComboboxChipRemove-cjs.js +54 -211
  6. package/dist/ComboboxChipRemove-es.js +8 -164
  7. package/dist/DataDump/index.cjs +2 -0
  8. package/dist/DataDump/index.mjs +2 -0
  9. package/dist/Dialog/index.cjs +1 -0
  10. package/dist/Dialog/index.mjs +1 -0
  11. package/dist/DrawerDescription-cjs.js +2 -1
  12. package/dist/DrawerDescription-es.js +3 -2
  13. package/dist/DrawerTitle-es.js +1 -1
  14. package/dist/InputNumberExperimental-cjs.js +24 -23
  15. package/dist/InputNumberExperimental-es.js +3 -2
  16. package/dist/InternalBackdrop-es.js +3 -3
  17. package/dist/Menu/index.cjs +2 -0
  18. package/dist/Menu/index.mjs +2 -0
  19. package/dist/Menu-cjs.js +1 -1
  20. package/dist/Menu-es.js +1 -1
  21. package/dist/MenuSubmenuTrigger-cjs.js +5 -13
  22. package/dist/MenuSubmenuTrigger-es.js +8 -16
  23. package/dist/NumberFieldInput-cjs.js +9 -9
  24. package/dist/NumberFieldInput-es.js +3 -3
  25. package/dist/Page/index.cjs +2 -0
  26. package/dist/Page/index.mjs +2 -0
  27. package/dist/ScrollAreaViewport-cjs.js +5 -47
  28. package/dist/ScrollAreaViewport-es.js +5 -46
  29. package/dist/SelectGroupLabel-cjs.js +1924 -0
  30. package/dist/SelectGroupLabel-es.js +1888 -0
  31. package/dist/SelectPrimitive-cjs.js +112 -0
  32. package/dist/SelectPrimitive-es.js +110 -0
  33. package/dist/ToolbarRootContext-cjs.js +35 -0
  34. package/dist/ToolbarRootContext-es.js +14 -0
  35. package/dist/docs/SelectPrimitive/SelectPrimitive.md +326 -0
  36. package/dist/docs/index.md +1 -0
  37. package/dist/floating-ui.react-dom-cjs.js +1 -0
  38. package/dist/floating-ui.react-dom-es.js +2 -2
  39. package/dist/floating-ui.utils.dom-es.js +1 -1
  40. package/dist/index.cjs +2 -0
  41. package/dist/index.mjs +2 -0
  42. package/dist/primitives/BottomSheet/index.cjs +1 -0
  43. package/dist/primitives/BottomSheet/index.mjs +1 -0
  44. package/dist/primitives/ComboboxPrimitive/index.cjs +3 -1
  45. package/dist/primitives/ComboboxPrimitive/index.mjs +3 -1
  46. package/dist/primitives/InputNumberExperimental/index.cjs +2 -1
  47. package/dist/primitives/InputNumberExperimental/index.mjs +2 -1
  48. package/dist/primitives/SelectPrimitive/SelectPrimitive.d.ts +63 -0
  49. package/dist/primitives/SelectPrimitive/index.cjs +29 -0
  50. package/dist/primitives/SelectPrimitive/index.d.ts +2 -0
  51. package/dist/primitives/SelectPrimitive/index.mjs +23 -0
  52. package/dist/primitives/SelectPrimitive/types.d.ts +16 -0
  53. package/dist/primitives/index.cjs +8 -1
  54. package/dist/primitives/index.d.ts +1 -0
  55. package/dist/primitives/index.mjs +7 -1
  56. package/dist/primitives/mergeClassName.d.ts +12 -0
  57. package/dist/resolveAriaLabelledBy-cjs.js +195 -0
  58. package/dist/resolveAriaLabelledBy-es.js +162 -0
  59. package/dist/styles.css +325 -0
  60. package/dist/unstyledPrimitives/index.cjs +416 -24
  61. package/dist/unstyledPrimitives/index.d.ts +1 -0
  62. package/dist/unstyledPrimitives/index.mjs +417 -26
  63. package/dist/useButton-cjs.js +2 -0
  64. package/dist/useButton-es.js +3 -2
  65. package/dist/useCompositeListItem-es.js +3 -3
  66. package/dist/useLabel-cjs.js +3 -329
  67. package/dist/useLabel-es.js +4 -299
  68. package/dist/useLabelableId-cjs.js +332 -0
  69. package/dist/useLabelableId-es.js +300 -0
  70. package/dist/useRenderElement-cjs.js +3 -0
  71. package/dist/useRenderElement-es.js +4 -1
  72. package/package.json +2 -2
@@ -0,0 +1,112 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('./tslib.es6-cjs.js');
4
+ var React = require('react');
5
+ var classnames = require('classnames');
6
+ var Icon = require('./Icon-cjs.js');
7
+ var OverlaySeparator = require('./OverlaySeparator-cjs.js');
8
+ var SelectGroupLabel = require('./SelectGroupLabel-cjs.js');
9
+
10
+ var styles = {"trigger":"WQiJQH4jadQ-","value":"P2HhjOjxY34-","iconWrapper":"cxgFUCKcXcw-","iconRotate":"_3BEK4Z1gGis-","positioner":"g221yZJtRrU-","popup":"vifRnCQ18ss-","list":"WsOmdkQ0SWU-","item":"wQ2wXu1YH-k-","itemText":"_--Vi-17OUiU-","itemIndicator":"CfjooR3I8Jc-","separator":"lI5-MyBERFY-","group":"_21z9KBWR06w-","groupLabel":"ZhtKkgZiSQI-","spinning":"sIXiKKpdSj8-"};
11
+
12
+ function mergeClassName(baseClassName, className) {
13
+ if (typeof className === "function") {
14
+ return (state) => classnames(baseClassName, className(state));
15
+ }
16
+ return classnames(baseClassName, className);
17
+ }
18
+
19
+ /**
20
+ * The offset (px) between the trigger bottom edge and the popup top edge,
21
+ * matching the Menu dropdown spacing.
22
+ */
23
+ const SELECT_OFFSET = 6;
24
+ // ─── Trigger ─────────────────────────────────────────────────────────────────
25
+ function SelectPrimitiveTrigger(_a) {
26
+ var { className, children } = _a, props = tslib_es6.__rest(_a, ["className", "children"]);
27
+ return (React.createElement(SelectGroupLabel.SelectTrigger, Object.assign({ className: mergeClassName(styles.trigger, className) }, props),
28
+ children,
29
+ React.createElement("span", { "aria-hidden": "true", className: styles.iconWrapper },
30
+ React.createElement("span", { className: styles.iconRotate },
31
+ React.createElement(Icon.Icon, { color: "greyBlue", name: "arrowDown", size: "base" })))));
32
+ }
33
+ // ─── Value ───────────────────────────────────────────────────────────────────
34
+ function SelectPrimitiveValue(_a) {
35
+ var { className } = _a, props = tslib_es6.__rest(_a, ["className"]);
36
+ return (React.createElement(SelectGroupLabel.SelectValue, Object.assign({ className: mergeClassName(styles.value, className) }, props)));
37
+ }
38
+ // ─── Positioner ───────────────────────────────────────────────────────────────
39
+ function SelectPrimitivePositioner(_a) {
40
+ var { className, sideOffset = SELECT_OFFSET, alignItemWithTrigger = false } = _a, props = tslib_es6.__rest(_a, ["className", "sideOffset", "alignItemWithTrigger"]);
41
+ return (React.createElement(SelectGroupLabel.SelectPositioner, Object.assign({ className: mergeClassName(styles.positioner, className), sideOffset: sideOffset, alignItemWithTrigger: alignItemWithTrigger }, props)));
42
+ }
43
+ // ─── Popup ────────────────────────────────────────────────────────────────────
44
+ function SelectPrimitivePopup(_a) {
45
+ var { className } = _a, props = tslib_es6.__rest(_a, ["className"]);
46
+ return (React.createElement(SelectGroupLabel.SelectPopup, Object.assign({ className: mergeClassName(styles.popup, className) }, props)));
47
+ }
48
+ // ─── List ─────────────────────────────────────────────────────────────────────
49
+ function SelectPrimitiveList(_a) {
50
+ var { className } = _a, props = tslib_es6.__rest(_a, ["className"]);
51
+ return (React.createElement(SelectGroupLabel.SelectList, Object.assign({ className: mergeClassName(styles.list, className) }, props)));
52
+ }
53
+ // ─── Item ─────────────────────────────────────────────────────────────────────
54
+ function SelectPrimitiveItem(_a) {
55
+ var { className } = _a, props = tslib_es6.__rest(_a, ["className"]);
56
+ return (React.createElement(SelectGroupLabel.SelectItem, Object.assign({ className: mergeClassName(styles.item, className) }, props)));
57
+ }
58
+ // ─── ItemText ─────────────────────────────────────────────────────────────────
59
+ function SelectPrimitiveItemText(_a) {
60
+ var { className } = _a, props = tslib_es6.__rest(_a, ["className"]);
61
+ return (React.createElement(SelectGroupLabel.SelectItemText, Object.assign({ className: mergeClassName(styles.itemText, className) }, props)));
62
+ }
63
+ // ─── ItemIndicator ────────────────────────────────────────────────────────────
64
+ function SelectPrimitiveItemIndicator(_a) {
65
+ var { className, children } = _a, props = tslib_es6.__rest(_a, ["className", "children"]);
66
+ return (React.createElement(SelectGroupLabel.SelectItemIndicator, Object.assign({ keepMounted: true, className: mergeClassName(styles.itemIndicator, className) }, props), children !== null && children !== void 0 ? children : React.createElement(Icon.Icon, { color: "icon", name: "checkmark", size: "base" })));
67
+ }
68
+ // ─── Group ────────────────────────────────────────────────────────────────────
69
+ function SelectPrimitiveGroup(_a) {
70
+ var { className } = _a, props = tslib_es6.__rest(_a, ["className"]);
71
+ return (React.createElement(SelectGroupLabel.SelectGroup, Object.assign({ className: mergeClassName(styles.group, className) }, props)));
72
+ }
73
+ // ─── GroupLabel ───────────────────────────────────────────────────────────────
74
+ function SelectPrimitiveGroupLabel(_a) {
75
+ var { className } = _a, props = tslib_es6.__rest(_a, ["className"]);
76
+ return (React.createElement(SelectGroupLabel.SelectGroupLabel, Object.assign({ className: mergeClassName(styles.groupLabel, className) }, props)));
77
+ }
78
+ // ─── Separator ────────────────────────────────────────────────────────────────
79
+ function SelectPrimitiveSeparator(_a) {
80
+ var { className } = _a, props = tslib_es6.__rest(_a, ["className"]);
81
+ return (React.createElement(OverlaySeparator.OverlaySeparator, Object.assign({ className: classnames(styles.separator, className), "data-testid": "ATL-SelectPrimitive-Separator" }, props)));
82
+ }
83
+ // ─── Display names ───────────────────────────────────────────────────────────
84
+ SelectPrimitiveTrigger.displayName = "SelectPrimitive.Trigger";
85
+ SelectPrimitiveValue.displayName = "SelectPrimitive.Value";
86
+ SelectPrimitivePositioner.displayName = "SelectPrimitive.Positioner";
87
+ SelectPrimitivePopup.displayName = "SelectPrimitive.Popup";
88
+ SelectPrimitiveList.displayName = "SelectPrimitive.List";
89
+ SelectPrimitiveItem.displayName = "SelectPrimitive.Item";
90
+ SelectPrimitiveItemText.displayName = "SelectPrimitive.ItemText";
91
+ SelectPrimitiveItemIndicator.displayName = "SelectPrimitive.ItemIndicator";
92
+ SelectPrimitiveGroup.displayName = "SelectPrimitive.Group";
93
+ SelectPrimitiveGroupLabel.displayName = "SelectPrimitive.GroupLabel";
94
+ SelectPrimitiveSeparator.displayName = "SelectPrimitive.Separator";
95
+ // ─── Compound export ─────────────────────────────────────────────────────────
96
+ const SelectPrimitive = {
97
+ Root: SelectGroupLabel.SelectRoot,
98
+ Trigger: SelectPrimitiveTrigger,
99
+ Value: SelectPrimitiveValue,
100
+ Portal: SelectGroupLabel.SelectPortal,
101
+ Positioner: SelectPrimitivePositioner,
102
+ Popup: SelectPrimitivePopup,
103
+ List: SelectPrimitiveList,
104
+ Item: SelectPrimitiveItem,
105
+ ItemText: SelectPrimitiveItemText,
106
+ ItemIndicator: SelectPrimitiveItemIndicator,
107
+ Group: SelectPrimitiveGroup,
108
+ GroupLabel: SelectPrimitiveGroupLabel,
109
+ Separator: SelectPrimitiveSeparator,
110
+ };
111
+
112
+ exports.SelectPrimitive = SelectPrimitive;
@@ -0,0 +1,110 @@
1
+ import { _ as __rest } from './tslib.es6-es.js';
2
+ import React__default from 'react';
3
+ import classnames from 'classnames';
4
+ import { I as Icon } from './Icon-es.js';
5
+ import { O as OverlaySeparator } from './OverlaySeparator-es.js';
6
+ import { S as SelectRoot, a as SelectPortal, b as SelectTrigger, c as SelectValue, d as SelectPositioner, e as SelectPopup, f as SelectList, g as SelectItem, h as SelectItemText, i as SelectItemIndicator, j as SelectGroup, k as SelectGroupLabel } from './SelectGroupLabel-es.js';
7
+
8
+ var styles = {"trigger":"WQiJQH4jadQ-","value":"P2HhjOjxY34-","iconWrapper":"cxgFUCKcXcw-","iconRotate":"_3BEK4Z1gGis-","positioner":"g221yZJtRrU-","popup":"vifRnCQ18ss-","list":"WsOmdkQ0SWU-","item":"wQ2wXu1YH-k-","itemText":"_--Vi-17OUiU-","itemIndicator":"CfjooR3I8Jc-","separator":"lI5-MyBERFY-","group":"_21z9KBWR06w-","groupLabel":"ZhtKkgZiSQI-","spinning":"sIXiKKpdSj8-"};
9
+
10
+ function mergeClassName(baseClassName, className) {
11
+ if (typeof className === "function") {
12
+ return (state) => classnames(baseClassName, className(state));
13
+ }
14
+ return classnames(baseClassName, className);
15
+ }
16
+
17
+ /**
18
+ * The offset (px) between the trigger bottom edge and the popup top edge,
19
+ * matching the Menu dropdown spacing.
20
+ */
21
+ const SELECT_OFFSET = 6;
22
+ // ─── Trigger ─────────────────────────────────────────────────────────────────
23
+ function SelectPrimitiveTrigger(_a) {
24
+ var { className, children } = _a, props = __rest(_a, ["className", "children"]);
25
+ return (React__default.createElement(SelectTrigger, Object.assign({ className: mergeClassName(styles.trigger, className) }, props),
26
+ children,
27
+ React__default.createElement("span", { "aria-hidden": "true", className: styles.iconWrapper },
28
+ React__default.createElement("span", { className: styles.iconRotate },
29
+ React__default.createElement(Icon, { color: "greyBlue", name: "arrowDown", size: "base" })))));
30
+ }
31
+ // ─── Value ───────────────────────────────────────────────────────────────────
32
+ function SelectPrimitiveValue(_a) {
33
+ var { className } = _a, props = __rest(_a, ["className"]);
34
+ return (React__default.createElement(SelectValue, Object.assign({ className: mergeClassName(styles.value, className) }, props)));
35
+ }
36
+ // ─── Positioner ───────────────────────────────────────────────────────────────
37
+ function SelectPrimitivePositioner(_a) {
38
+ var { className, sideOffset = SELECT_OFFSET, alignItemWithTrigger = false } = _a, props = __rest(_a, ["className", "sideOffset", "alignItemWithTrigger"]);
39
+ return (React__default.createElement(SelectPositioner, Object.assign({ className: mergeClassName(styles.positioner, className), sideOffset: sideOffset, alignItemWithTrigger: alignItemWithTrigger }, props)));
40
+ }
41
+ // ─── Popup ────────────────────────────────────────────────────────────────────
42
+ function SelectPrimitivePopup(_a) {
43
+ var { className } = _a, props = __rest(_a, ["className"]);
44
+ return (React__default.createElement(SelectPopup, Object.assign({ className: mergeClassName(styles.popup, className) }, props)));
45
+ }
46
+ // ─── List ─────────────────────────────────────────────────────────────────────
47
+ function SelectPrimitiveList(_a) {
48
+ var { className } = _a, props = __rest(_a, ["className"]);
49
+ return (React__default.createElement(SelectList, Object.assign({ className: mergeClassName(styles.list, className) }, props)));
50
+ }
51
+ // ─── Item ─────────────────────────────────────────────────────────────────────
52
+ function SelectPrimitiveItem(_a) {
53
+ var { className } = _a, props = __rest(_a, ["className"]);
54
+ return (React__default.createElement(SelectItem, Object.assign({ className: mergeClassName(styles.item, className) }, props)));
55
+ }
56
+ // ─── ItemText ─────────────────────────────────────────────────────────────────
57
+ function SelectPrimitiveItemText(_a) {
58
+ var { className } = _a, props = __rest(_a, ["className"]);
59
+ return (React__default.createElement(SelectItemText, Object.assign({ className: mergeClassName(styles.itemText, className) }, props)));
60
+ }
61
+ // ─── ItemIndicator ────────────────────────────────────────────────────────────
62
+ function SelectPrimitiveItemIndicator(_a) {
63
+ var { className, children } = _a, props = __rest(_a, ["className", "children"]);
64
+ return (React__default.createElement(SelectItemIndicator, Object.assign({ keepMounted: true, className: mergeClassName(styles.itemIndicator, className) }, props), children !== null && children !== void 0 ? children : React__default.createElement(Icon, { color: "icon", name: "checkmark", size: "base" })));
65
+ }
66
+ // ─── Group ────────────────────────────────────────────────────────────────────
67
+ function SelectPrimitiveGroup(_a) {
68
+ var { className } = _a, props = __rest(_a, ["className"]);
69
+ return (React__default.createElement(SelectGroup, Object.assign({ className: mergeClassName(styles.group, className) }, props)));
70
+ }
71
+ // ─── GroupLabel ───────────────────────────────────────────────────────────────
72
+ function SelectPrimitiveGroupLabel(_a) {
73
+ var { className } = _a, props = __rest(_a, ["className"]);
74
+ return (React__default.createElement(SelectGroupLabel, Object.assign({ className: mergeClassName(styles.groupLabel, className) }, props)));
75
+ }
76
+ // ─── Separator ────────────────────────────────────────────────────────────────
77
+ function SelectPrimitiveSeparator(_a) {
78
+ var { className } = _a, props = __rest(_a, ["className"]);
79
+ return (React__default.createElement(OverlaySeparator, Object.assign({ className: classnames(styles.separator, className), "data-testid": "ATL-SelectPrimitive-Separator" }, props)));
80
+ }
81
+ // ─── Display names ───────────────────────────────────────────────────────────
82
+ SelectPrimitiveTrigger.displayName = "SelectPrimitive.Trigger";
83
+ SelectPrimitiveValue.displayName = "SelectPrimitive.Value";
84
+ SelectPrimitivePositioner.displayName = "SelectPrimitive.Positioner";
85
+ SelectPrimitivePopup.displayName = "SelectPrimitive.Popup";
86
+ SelectPrimitiveList.displayName = "SelectPrimitive.List";
87
+ SelectPrimitiveItem.displayName = "SelectPrimitive.Item";
88
+ SelectPrimitiveItemText.displayName = "SelectPrimitive.ItemText";
89
+ SelectPrimitiveItemIndicator.displayName = "SelectPrimitive.ItemIndicator";
90
+ SelectPrimitiveGroup.displayName = "SelectPrimitive.Group";
91
+ SelectPrimitiveGroupLabel.displayName = "SelectPrimitive.GroupLabel";
92
+ SelectPrimitiveSeparator.displayName = "SelectPrimitive.Separator";
93
+ // ─── Compound export ─────────────────────────────────────────────────────────
94
+ const SelectPrimitive = {
95
+ Root: SelectRoot,
96
+ Trigger: SelectPrimitiveTrigger,
97
+ Value: SelectPrimitiveValue,
98
+ Portal: SelectPortal,
99
+ Positioner: SelectPrimitivePositioner,
100
+ Popup: SelectPrimitivePopup,
101
+ List: SelectPrimitiveList,
102
+ Item: SelectPrimitiveItem,
103
+ ItemText: SelectPrimitiveItemText,
104
+ ItemIndicator: SelectPrimitiveItemIndicator,
105
+ Group: SelectPrimitiveGroup,
106
+ GroupLabel: SelectPrimitiveGroupLabel,
107
+ Separator: SelectPrimitiveSeparator,
108
+ };
109
+
110
+ export { SelectPrimitive as S };
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var useRenderElement = require('./useRenderElement-cjs.js');
4
+ var React = require('react');
5
+
6
+ function _interopNamespaceDefault(e) {
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
24
+
25
+ const ToolbarRootContext = /*#__PURE__*/React__namespace.createContext(undefined);
26
+ if (process.env.NODE_ENV !== "production") ToolbarRootContext.displayName = "ToolbarRootContext";
27
+ function useToolbarRootContext(optional) {
28
+ const context = React__namespace.useContext(ToolbarRootContext);
29
+ if (context === undefined && !optional) {
30
+ throw new Error(process.env.NODE_ENV !== "production" ? 'Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.' : useRenderElement.formatErrorMessage(69));
31
+ }
32
+ return context;
33
+ }
34
+
35
+ exports.useToolbarRootContext = useToolbarRootContext;
@@ -0,0 +1,14 @@
1
+ import { f as formatErrorMessage } from './useRenderElement-es.js';
2
+ import * as React from 'react';
3
+
4
+ const ToolbarRootContext = /*#__PURE__*/React.createContext(undefined);
5
+ if (process.env.NODE_ENV !== "production") ToolbarRootContext.displayName = "ToolbarRootContext";
6
+ function useToolbarRootContext(optional) {
7
+ const context = React.useContext(ToolbarRootContext);
8
+ if (context === undefined && !optional) {
9
+ throw new Error(process.env.NODE_ENV !== "production" ? 'Base UI: ToolbarRootContext is missing. Toolbar parts must be placed within <Toolbar.Root>.' : formatErrorMessage(69));
10
+ }
11
+ return context;
12
+ }
13
+
14
+ export { useToolbarRootContext as u };
@@ -0,0 +1,326 @@
1
+ # SelectPrimitive
2
+
3
+ `SelectPrimitive` is a set of styled wrappers around
4
+ [Base UI's Select](https://base-ui.com/react/components/select) parts,
5
+ pre-themed with Atlantis design tokens. It exposes every building block as a
6
+ named sub-component so consumers compose their own field structure — no label,
7
+ error, or description abstraction is included.
8
+
9
+ > **⚠️ Experimental** — This is a primitive building block. It does not carry
10
+ > the same stability guarantees as promoted Atlantis components. Reach out to
11
+ > UXF before adopting it in product code.
12
+
13
+ ## Design & usage guidelines
14
+
15
+ Use `SelectPrimitive` when you need a composable, fully-styled select that goes
16
+ beyond what the native `<select>` element supports — e.g. custom item layouts,
17
+ option groups with separators, or accessible keyboard navigation baked in
18
+ through Base UI.
19
+
20
+ For everyday form selects, prefer the standard `Select` component.
21
+
22
+ ### Composition
23
+
24
+ Because `SelectPrimitive` provides no field abstraction, consumers wire up
25
+ labels and other field structure themselves:
26
+
27
+ ```tsx
28
+ <label htmlFor="my-select">Fruit</label>
29
+ <SelectPrimitive.Root value={value} onValueChange={setValue}>
30
+ <SelectPrimitive.Trigger id="my-select">
31
+ <SelectPrimitive.Value placeholder="Select an option" />
32
+ </SelectPrimitive.Trigger>
33
+ <SelectPrimitive.Portal>
34
+ <SelectPrimitive.Positioner>
35
+ <SelectPrimitive.Popup>
36
+ <SelectPrimitive.List>
37
+ <SelectPrimitive.Item value="apple">
38
+ <SelectPrimitive.ItemText>Apple</SelectPrimitive.ItemText>
39
+ <SelectPrimitive.ItemIndicator />
40
+ </SelectPrimitive.Item>
41
+ <SelectPrimitive.Item value="banana">
42
+ <SelectPrimitive.ItemText>Banana</SelectPrimitive.ItemText>
43
+ <SelectPrimitive.ItemIndicator />
44
+ </SelectPrimitive.Item>
45
+ </SelectPrimitive.List>
46
+ </SelectPrimitive.Popup>
47
+ </SelectPrimitive.Positioner>
48
+ </SelectPrimitive.Portal>
49
+ </SelectPrimitive.Root>
50
+ ```
51
+
52
+ ### Placeholder
53
+
54
+ Pass a `placeholder` string to `SelectPrimitive.Value` to show hint text inside
55
+ the trigger when no value is selected. It is replaced by the selected value once
56
+ the user makes a choice.
57
+
58
+ ### Dropdown
59
+
60
+ The dropdown popup mirrors the `Menu` component's visual style — same border,
61
+ shadow, border-radius, and item hover/highlight states. The popup is always at
62
+ least as wide as the trigger.
63
+
64
+ A checkmark indicator (`SelectPrimitive.ItemIndicator`) appears on the currently
65
+ selected item. Place it inside each `SelectPrimitive.Item` to opt in.
66
+
67
+ ## States
68
+
69
+ ### Basic
70
+
71
+ ```tsx
72
+ <label htmlFor="basic-select">Fruit</label>
73
+ <SelectPrimitive.Root value={value} onValueChange={setValue}>
74
+ <SelectPrimitive.Trigger id="basic-select">
75
+ <SelectPrimitive.Value placeholder="Select an option" />
76
+ </SelectPrimitive.Trigger>
77
+ <SelectPrimitive.Portal>
78
+ <SelectPrimitive.Positioner>
79
+ <SelectPrimitive.Popup>
80
+ <SelectPrimitive.List>
81
+ <SelectPrimitive.Item value="apple">
82
+ <SelectPrimitive.ItemText>Apple</SelectPrimitive.ItemText>
83
+ <SelectPrimitive.ItemIndicator />
84
+ </SelectPrimitive.Item>
85
+ <SelectPrimitive.Item value="banana">
86
+ <SelectPrimitive.ItemText>Banana</SelectPrimitive.ItemText>
87
+ <SelectPrimitive.ItemIndicator />
88
+ </SelectPrimitive.Item>
89
+ </SelectPrimitive.List>
90
+ </SelectPrimitive.Popup>
91
+ </SelectPrimitive.Positioner>
92
+ </SelectPrimitive.Portal>
93
+ </SelectPrimitive.Root>
94
+ ```
95
+
96
+ ### Disabled
97
+
98
+ Pass `disabled` to `SelectPrimitive.Root` to prevent interaction. The trigger
99
+ border, background, and text colour all shift to the disabled palette.
100
+
101
+ ### Option grouping
102
+
103
+ Use `SelectPrimitive.Group` and `SelectPrimitive.GroupLabel` to organise items
104
+ under labelled sections, and `SelectPrimitive.Separator` to add a horizontal
105
+ rule between groups.
106
+
107
+ ```tsx
108
+ <SelectPrimitive.Root value={value} onValueChange={setValue}>
109
+ <SelectPrimitive.Trigger id="grouped-select">
110
+ <SelectPrimitive.Value placeholder="Choose produce" />
111
+ </SelectPrimitive.Trigger>
112
+ <SelectPrimitive.Portal>
113
+ <SelectPrimitive.Positioner>
114
+ <SelectPrimitive.Popup>
115
+ <SelectPrimitive.List>
116
+ <SelectPrimitive.Group>
117
+ <SelectPrimitive.GroupLabel>Fruits</SelectPrimitive.GroupLabel>
118
+ <SelectPrimitive.Item value="apple">
119
+ <SelectPrimitive.ItemText>Apple</SelectPrimitive.ItemText>
120
+ <SelectPrimitive.ItemIndicator />
121
+ </SelectPrimitive.Item>
122
+ </SelectPrimitive.Group>
123
+
124
+ <SelectPrimitive.Separator />
125
+
126
+ <SelectPrimitive.Group>
127
+ <SelectPrimitive.GroupLabel>Vegetables</SelectPrimitive.GroupLabel>
128
+ <SelectPrimitive.Item value="carrot">
129
+ <SelectPrimitive.ItemText>Carrot</SelectPrimitive.ItemText>
130
+ <SelectPrimitive.ItemIndicator />
131
+ </SelectPrimitive.Item>
132
+ </SelectPrimitive.Group>
133
+ </SelectPrimitive.List>
134
+ </SelectPrimitive.Popup>
135
+ </SelectPrimitive.Positioner>
136
+ </SelectPrimitive.Portal>
137
+ </SelectPrimitive.Root>
138
+ ```
139
+
140
+
141
+ ## Configuration
142
+
143
+ ### Controlled vs uncontrolled
144
+
145
+ `SelectPrimitive.Root` supports both controlled (`value` + `onValueChange`) and
146
+ uncontrolled (`defaultValue`) usage.
147
+
148
+ ### Generic value type
149
+
150
+ `SelectPrimitive.Root` is generic over the value type — the `value` and
151
+ `onValueChange` props stay fully typed without extra casting.
152
+
153
+ ### Keyboard navigation
154
+
155
+ Base UI provides full keyboard support out of the box:
156
+
157
+ * **Arrow Up / Down** — move between items
158
+ * **Enter / Space** — select the highlighted item
159
+ * **Escape** — close the dropdown without changing the value
160
+ * **Home / End** — jump to the first / last item
161
+
162
+ ### Form integration
163
+
164
+ Pass `name` and `required` to `SelectPrimitive.Root` to participate in standard
165
+ HTML form submission. The value is serialised via a hidden `<input>` managed by
166
+ Base UI.
167
+
168
+ ## Sub-components
169
+
170
+ | Sub-component | Purpose |
171
+ | ------------------------------- | -------------------------------------------------------------------------------------------------------------- |
172
+ | `SelectPrimitive.Root` | Provides state, value, and open/close control. No DOM element of its own. |
173
+ | `SelectPrimitive.Trigger` | The button that opens the dropdown. Renders the chevron icon automatically. |
174
+ | `SelectPrimitive.Value` | Displays the selected value (or placeholder) inside the trigger. |
175
+ | `SelectPrimitive.Portal` | Renders the popup in a portal outside the current DOM subtree. |
176
+ | `SelectPrimitive.Positioner` | Positions the popup relative to the trigger using floating-ui. |
177
+ | `SelectPrimitive.Popup` | The styled dropdown container. Sized to at least the trigger's width. |
178
+ | `SelectPrimitive.List` | Scrollable list container inside the popup. |
179
+ | `SelectPrimitive.Item` | An individual selectable option. Accepts `value`, `disabled`, and `label`. |
180
+ | `SelectPrimitive.ItemText` | The visible text label inside an item. |
181
+ | `SelectPrimitive.ItemIndicator` | A checkmark shown only on the selected item. Renders an Atlantis icon by default; pass `children` to override. |
182
+ | `SelectPrimitive.Group` | Groups items together under a common label. |
183
+ | `SelectPrimitive.GroupLabel` | The heading rendered above a group. |
184
+ | `SelectPrimitive.Separator` | A horizontal rule between groups. |
185
+
186
+
187
+ ## Props
188
+
189
+ ### Web
190
+
191
+ #### Portal
192
+
193
+ | Prop | Type | Required | Default | Description |
194
+ |------|------|----------|---------|-------------|
195
+ | `className` | `string | ((state: SelectPortalState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
196
+ | `container` | `HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot>` | No | — | A parent element to render the portal element into. |
197
+ | `ref` | `Ref<HTMLDivElement>` | No | — | Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (... |
198
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPortalState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
199
+
200
+ #### Root
201
+
202
+ | Prop | Type | Required | Default | Description |
203
+ |------|------|----------|---------|-------------|
204
+ | `actionsRef` | `RefObject<SelectRootActions>` | No | — | A ref to imperative actions. - `unmount`: When specified, the select will not be unmounted when closed. Instead, the ... |
205
+ | `autoComplete` | `string` | No | — | Provides a hint to the browser for autofill. @see https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attribu... |
206
+ | `defaultOpen` | `boolean` | No | `false` | Whether the select popup is initially open. To render a controlled select popup, use the `open` prop instead. |
207
+ | `defaultValue` | `SelectValueType<Value, Multiple>` | No | — | The uncontrolled value of the select when it’s initially rendered. To render a controlled select, use the `value` pr... |
208
+ | `disabled` | `boolean` | No | `false` | Whether the component should ignore user interaction. |
209
+ | `highlightItemOnHover` | `boolean` | No | `true` | Whether moving the pointer over items should highlight them. Disabling this prop allows CSS `:hover` to be differenti... |
210
+ | `id` | `string` | No | — | The id of the Select. |
211
+ | `inputRef` | `Ref<HTMLInputElement>` | No | — | A ref to access the hidden input element. |
212
+ | `isItemEqualToValue` | `(itemValue: Value, value: Value) => boolean` | No | — | Custom comparison logic used to determine if a select item value matches the current selected value. Useful when item... |
213
+ | `items` | `Record<string, ReactNode> | readonly { label: ReactNode; value: any; }[] | readonly Group<any>[]` | No | — | Data structure of the items rendered in the select popup. When specified, `<Select.Value>` renders the label of the s... |
214
+ | `itemToStringLabel` | `(itemValue: Value) => string` | No | — | When the item values are objects (`<Select.Item value={object}>`), this function converts the object value to a strin... |
215
+ | `itemToStringValue` | `(itemValue: Value) => string` | No | — | When the item values are objects (`<Select.Item value={object}>`), this function converts the object value to a strin... |
216
+ | `modal` | `boolean` | No | `true` | Determines if the select enters a modal state when open. - `true`: user interaction is limited to the select: documen... |
217
+ | `multiple` | `boolean` | No | `false` | Whether multiple items can be selected. |
218
+ | `name` | `string` | No | — | Identifies the field when a form is submitted. |
219
+ | `onOpenChange` | `(open: boolean, eventDetails: SelectRootChangeEventDetails) => void` | No | — | Event handler called when the select popup is opened or closed. |
220
+ | `onOpenChangeComplete` | `(open: boolean) => void` | No | — | Event handler called after any animations complete when the select popup is opened or closed. |
221
+ | `onValueChange` | `(value: SelectValueType<Value, Multiple> | (Multiple extends true ? never : null), eventDetails: SelectRootChangeEventDetails) => void` | No | — | Event handler called when the value of the select changes. |
222
+ | `open` | `boolean` | No | — | Whether the select popup is currently open. |
223
+ | `readOnly` | `boolean` | No | `false` | Whether the user should be unable to choose a different option from the select popup. |
224
+ | `required` | `boolean` | No | `false` | Whether the user must choose a value before submitting a form. |
225
+ | `value` | `SelectValueType<Value, Multiple>` | No | — | The value of the select. Use when controlled. |
226
+
227
+ #### SelectPrimitiveGroup
228
+
229
+ | Prop | Type | Required | Default | Description |
230
+ |------|------|----------|---------|-------------|
231
+ | `className` | `string | ((state: SelectGroupState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
232
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectGroupState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
233
+
234
+ #### SelectPrimitiveGroupLabel
235
+
236
+ | Prop | Type | Required | Default | Description |
237
+ |------|------|----------|---------|-------------|
238
+ | `className` | `string | ((state: SelectGroupLabelState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
239
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectGroupLabelState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
240
+
241
+ #### SelectPrimitiveItem
242
+
243
+ | Prop | Type | Required | Default | Description |
244
+ |------|------|----------|---------|-------------|
245
+ | `className` | `string | ((state: SelectItemState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
246
+ | `disabled` | `boolean` | No | `false` | Whether the component should ignore user interaction. |
247
+ | `label` | `string` | No | — | Specifies the text label to use when the item is matched during keyboard text navigation. Defaults to the item text ... |
248
+ | `nativeButton` | `boolean` | No | `true` | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if ... |
249
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
250
+ | `value` | `any` | No | `null` | A unique value that identifies this select item. |
251
+
252
+ #### SelectPrimitiveItemIndicator
253
+
254
+ | Prop | Type | Required | Default | Description |
255
+ |------|------|----------|---------|-------------|
256
+ | `className` | `string | ((state: SelectItemIndicatorState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
257
+ | `keepMounted` | `boolean` | No | — | Whether to keep the HTML element in the DOM when the item is not selected. |
258
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemIndicatorState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
259
+
260
+ #### SelectPrimitiveItemText
261
+
262
+ | Prop | Type | Required | Default | Description |
263
+ |------|------|----------|---------|-------------|
264
+ | `className` | `string | ((state: SelectItemTextState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
265
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectItemTextState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
266
+
267
+ #### SelectPrimitiveList
268
+
269
+ | Prop | Type | Required | Default | Description |
270
+ |------|------|----------|---------|-------------|
271
+ | `className` | `string | ((state: SelectListState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
272
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectListState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
273
+
274
+ #### SelectPrimitivePopup
275
+
276
+ | Prop | Type | Required | Default | Description |
277
+ |------|------|----------|---------|-------------|
278
+ | `className` | `string | ((state: SelectPopupState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
279
+ | `finalFocus` | `boolean | RefObject<HTMLElement> | ((closeType: InteractionType) => boolean | void | HTMLElement)` | No | — | Determines the element to focus when the select popup is closed. - `false`: Do not move focus. - `true`: Move focus ... |
280
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPopupState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
281
+
282
+ #### SelectPrimitivePositioner
283
+
284
+ | Prop | Type | Required | Default | Description |
285
+ |------|------|----------|---------|-------------|
286
+ | `align` | `Align` | No | `'center'` | How to align the popup relative to the specified side. |
287
+ | `alignItemWithTrigger` | `boolean` | No | `false` | Whether the positioner overlaps the trigger so the selected item's text is aligned with the trigger's value text. Thi... |
288
+ | `alignOffset` | `OffsetFunction | number` | No | `0` | Additional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dim... |
289
+ | `anchor` | `Element | RefObject<Element> | VirtualElement | (() => Element | VirtualElement)` | No | — | An element to position the popup against. By default, the popup will be positioned against the trigger. |
290
+ | `arrowPadding` | `number` | No | `5` | Minimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from ... |
291
+ | `className` | `string | ((state: SelectPositionerState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
292
+ | `collisionAvoidance` | `CollisionAvoidance` | No | — | Determines how to handle collisions when positioning the popup. `side` controls overflow on the preferred placement ... |
293
+ | `collisionBoundary` | `Boundary` | No | `'clipping-ancestors'` | An element or a rectangle that delimits the area that the popup is confined to. |
294
+ | `collisionPadding` | `Padding` | No | `5` | Additional space to maintain from the edge of the collision boundary. |
295
+ | `disableAnchorTracking` | `boolean` | No | `false` | Whether to disable the popup from tracking any layout shift of its positioning anchor. |
296
+ | `positionMethod` | `"absolute" | "fixed"` | No | `'absolute'` | Determines which CSS `position` property to use. |
297
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectPositionerState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
298
+ | `side` | `Side` | No | `'bottom'` | Which side of the anchor element to align the popup against. May automatically change to avoid collisions. |
299
+ | `sideOffset` | `OffsetFunction | number` | No | `6` | Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the di... |
300
+ | `sticky` | `boolean` | No | `false` | Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. |
301
+
302
+ #### SelectPrimitiveSeparator
303
+
304
+ | Prop | Type | Required | Default | Description |
305
+ |------|------|----------|---------|-------------|
306
+ | `className` | `string` | No | — | |
307
+ | `orientation` | `Orientation` | No | `'horizontal'` | The orientation of the separator. |
308
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SeparatorState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
309
+
310
+ #### SelectPrimitiveTrigger
311
+
312
+ | Prop | Type | Required | Default | Description |
313
+ |------|------|----------|---------|-------------|
314
+ | `className` | `string | ((state: SelectTriggerState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
315
+ | `disabled` | `boolean` | No | — | Whether the component should ignore user interaction. |
316
+ | `nativeButton` | `boolean` | No | `true` | Whether the component renders a native `<button>` element when replacing it via the `render` prop. Set to `false` if ... |
317
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectTriggerState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
318
+
319
+ #### SelectPrimitiveValue
320
+
321
+ | Prop | Type | Required | Default | Description |
322
+ |------|------|----------|---------|-------------|
323
+ | `children` | `ReactNode | ((value: any) => ReactNode)` | No | — | Accepts a function that returns a `ReactNode` to format the selected value. @example ```tsx <Select.Value> {(value:... |
324
+ | `className` | `string | ((state: SelectValueState) => string)` | No | — | CSS class applied to the element, or a function that returns a class based on the component’s state. |
325
+ | `placeholder` | `ReactNode` | No | — | The placeholder value to display when no value is selected. This is overridden by `children` if specified, or by a nu... |
326
+ | `render` | `ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, SelectValueState>` | No | — | Allows you to replace the component’s HTML element with a different tag, or compose it with another component. Accep... |
@@ -79,6 +79,7 @@
79
79
  [ResponsiveSwitcher](./ResponsiveSwitcher/ResponsiveSwitcher.md)
80
80
  [scaffolding](./scaffolding/scaffolding.md)
81
81
  [SegmentedControl](./SegmentedControl/SegmentedControl.md)
82
+ [SelectPrimitive](./SelectPrimitive/SelectPrimitive.md)
82
83
  [settings](./settings/settings.md)
83
84
  [SideDrawer](./SideDrawer/SideDrawer.md)
84
85
  [SideKick](./SideKick/SideKick.md)
@@ -2098,6 +2098,7 @@ exports.flip = flip;
2098
2098
  exports.hide = hide;
2099
2099
  exports.limitShift = limitShift;
2100
2100
  exports.offset = offset;
2101
+ exports.platform = platform;
2101
2102
  exports.shift = shift;
2102
2103
  exports.size = size;
2103
2104
  exports.useFloating = useFloating;
@@ -1,5 +1,5 @@
1
1
  import { g as getSideAxis, b as getAlignmentAxis, c as getSide, d as getAlignment, e as evaluate, h as getPaddingObject, r as rectToClientRect, j as getOppositePlacement, k as getExpandedPlacements, l as getOppositeAxisPlacements, m as getAlignmentSides, n as clamp, o as min, p as max, q as getAxisLength, s as sides, u as getOppositeAxis, v as placements, w as getOppositeAlignmentPlacement, x as createCoords, y as round, f as floor } from './index.esm-es.js';
2
- import { h as getOverflowAncestors, b as isElement, k as getWindow, l as getFrameElement, f as getComputedStyle$1, m as getDocumentElement, a as isHTMLElement, j as isWebKit, n as isTopLayer, g as getNodeName, o as isOverflowElement, p as getNodeScroll, e as getParentNode, d as isLastTraversableNode, q as isTableElement, r as isContainingBlock, s as getContainingBlock } from './floating-ui.utils.dom-es.js';
2
+ import { k as getDocumentElement, b as isElement, a as isHTMLElement, l as isTopLayer, g as getNodeName, m as isOverflowElement, n as getNodeScroll, o as getWindow, e as getParentNode, d as isLastTraversableNode, p as isTableElement, q as isContainingBlock, r as getContainingBlock, f as getComputedStyle$1, h as getOverflowAncestors, s as getFrameElement, j as isWebKit } from './floating-ui.utils.dom-es.js';
3
3
  import * as React from 'react';
4
4
  import { useLayoutEffect } from 'react';
5
5
  import * as ReactDOM from 'react-dom';
@@ -2070,4 +2070,4 @@ const arrow = (options, deps) => {
2070
2070
  };
2071
2071
  };
2072
2072
 
2073
- export { arrow as a, autoUpdate as b, autoPlacement as c, size as d, flip as f, hide as h, limitShift as l, offset as o, shift as s, useFloating as u };
2073
+ export { arrow as a, autoUpdate as b, autoPlacement as c, size as d, flip as f, hide as h, limitShift as l, offset as o, platform as p, shift as s, useFloating as u };