@arc-ui/components 11.2.0 → 11.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.
- package/dist/Button/Button.cjs.d.ts +1 -1
- package/dist/Button/Button.cjs.js +1 -1
- package/dist/Button/Button.esm.d.ts +1 -1
- package/dist/Button/Button.esm.js +1 -1
- package/dist/Card/Card.cjs.js +1 -1
- package/dist/Card/Card.esm.js +1 -1
- package/dist/Checkbox/Checkbox.cjs.js +8 -27
- package/dist/Checkbox/Checkbox.esm.js +3 -22
- package/dist/FormControl/FormControl.cjs.d.ts +1 -1
- package/dist/FormControl/FormControl.cjs.js +1 -1
- package/dist/FormControl/FormControl.esm.d.ts +1 -1
- package/dist/FormControl/FormControl.esm.js +1 -1
- package/dist/ProgressBar/ProgressBar.cjs.d.ts +47 -0
- package/dist/ProgressBar/ProgressBar.cjs.js +113 -0
- package/dist/ProgressBar/ProgressBar.esm.d.ts +47 -0
- package/dist/ProgressBar/ProgressBar.esm.js +105 -0
- package/dist/ProgressBar/package.json +7 -0
- package/dist/RadioGroup/RadioGroup.cjs.d.ts +2 -2
- package/dist/RadioGroup/RadioGroup.cjs.js +2 -2
- package/dist/RadioGroup/RadioGroup.esm.d.ts +2 -2
- package/dist/RadioGroup/RadioGroup.esm.js +2 -2
- package/dist/Select/Select.cjs.d.ts +2 -2
- package/dist/Select/Select.cjs.js +75 -74
- package/dist/Select/Select.esm.d.ts +2 -2
- package/dist/Select/Select.esm.js +3 -2
- package/dist/SiteHeader/SiteHeader.cjs.js +1 -1
- package/dist/SiteHeader/SiteHeader.esm.js +1 -1
- package/dist/Switch/Switch.cjs.d.ts +1 -1
- package/dist/Switch/Switch.cjs.js +13 -12
- package/dist/Switch/Switch.esm.d.ts +1 -1
- package/dist/Switch/Switch.esm.js +4 -3
- package/dist/Tag/Tag.cjs.d.ts +33 -0
- package/dist/Tag/Tag.cjs.js +73 -0
- package/dist/Tag/Tag.esm.d.ts +33 -0
- package/dist/Tag/Tag.esm.js +65 -0
- package/dist/Tag/package.json +7 -0
- package/dist/TextInput/TextInput.cjs.d.ts +2 -2
- package/dist/TextInput/TextInput.cjs.js +1 -1
- package/dist/TextInput/TextInput.esm.d.ts +2 -2
- package/dist/TextInput/TextInput.esm.js +1 -1
- package/dist/VerticalSpace/VerticalSpace.cjs.d.ts +1 -1
- package/dist/VerticalSpace/VerticalSpace.cjs.js +1 -1
- package/dist/VerticalSpace/VerticalSpace.esm.d.ts +1 -1
- package/dist/VerticalSpace/VerticalSpace.esm.js +1 -1
- package/dist/_shared/cjs/BtIconTickAlt2Px-bdf06f8c.js +29 -0
- package/dist/_shared/cjs/{Button-b3a69953.js → Button-1af6868c.js} +1 -4
- package/dist/_shared/{esm/FormControl-84c9ace6.d.ts → cjs/FormControl-d4d9c665.d.ts} +4 -0
- package/dist/_shared/cjs/{FormControl-e6b7d7c5.js → FormControl-d4d9c665.js} +6 -5
- package/dist/_shared/cjs/VerticalSpace-7aed88ab.d.ts +34 -0
- package/dist/_shared/cjs/{VerticalSpace-65ad083c.js → VerticalSpace-7aed88ab.js} +6 -2
- package/dist/_shared/cjs/index-c81c9401.d.ts +1 -1
- package/dist/_shared/cjs/{BtIconTickAlt2Px-b12ecc78.js → index.module-af7c85f2.js} +34 -59
- package/dist/_shared/esm/BtIconTickAlt2Px-da97e9ae.js +23 -0
- package/dist/_shared/esm/{Button-69439f8f.js → Button-10700df4.js} +1 -4
- package/dist/_shared/{cjs/FormControl-e6b7d7c5.d.ts → esm/FormControl-2cb96de7.d.ts} +4 -0
- package/dist/_shared/esm/{FormControl-84c9ace6.js → FormControl-2cb96de7.js} +6 -5
- package/dist/_shared/esm/VerticalSpace-3579b20e.d.ts +34 -0
- package/dist/_shared/esm/{VerticalSpace-6b4f5e50.js → VerticalSpace-3579b20e.js} +6 -2
- package/dist/_shared/esm/index-c81c9401.d.ts +1 -1
- package/dist/_shared/esm/{BtIconTickAlt2Px-2c4ec3be.js → index.module-599b86dd.js} +2 -22
- package/dist/index.es.js +77 -38
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +77 -37
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/FormControl/FormControl.d.ts +4 -0
- package/dist/types/components/ProgressBar/ProgressBar.d.ts +46 -0
- package/dist/types/components/ProgressBar/constants/progress-bar-icon-map.d.ts +3 -0
- package/dist/types/components/ProgressBar/index.d.ts +1 -0
- package/dist/types/components/ProgressBar/types/progress-bar-icons.d.ts +1 -0
- package/dist/types/components/ProgressBar/types/progress-bar-state.d.ts +1 -0
- package/dist/types/components/ProgressBar/utils/get-progress-bar-props.d.ts +1 -0
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/Tag/Tag.d.ts +32 -0
- package/dist/types/components/Tag/index.d.ts +1 -0
- package/dist/types/components/TextInput/TextInput.d.ts +1 -1
- package/dist/types/components/VerticalSpace/VerticalSpace.d.ts +17 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/styles.d.ts +2 -0
- package/package.json +4 -4
- package/dist/_shared/cjs/VerticalSpace-65ad083c.d.ts +0 -18
- package/dist/_shared/esm/VerticalSpace-6b4f5e50.d.ts +0 -18
- /package/dist/_shared/cjs/{Button-b3a69953.d.ts → Button-1af6868c.d.ts} +0 -0
- /package/dist/_shared/esm/{Button-69439f8f.d.ts → Button-10700df4.d.ts} +0 -0
|
@@ -4,11 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var index = require('../_shared/cjs/index-45bfb67b.js');
|
|
6
6
|
var React$1 = require('react');
|
|
7
|
-
var
|
|
7
|
+
var index_module = require('../_shared/cjs/index.module-af7c85f2.js');
|
|
8
8
|
var $7SXl2$reactdom = require('react-dom');
|
|
9
9
|
var BtIconChevronDown2Px = require('../_shared/cjs/BtIconChevronDown2Px-8fb4e2eb.js');
|
|
10
|
+
var BtIconTickAlt2Px = require('../_shared/cjs/BtIconTickAlt2Px-bdf06f8c.js');
|
|
10
11
|
var Icon = require('../_shared/cjs/Icon-719d13d4.js');
|
|
11
|
-
var FormControl = require('../_shared/cjs/FormControl-
|
|
12
|
+
var FormControl = require('../_shared/cjs/FormControl-d4d9c665.js');
|
|
12
13
|
var Surface = require('../_shared/cjs/Surface-d6b8010e.js');
|
|
13
14
|
var Base = require('../_shared/cjs/Base-e2b846fe.js');
|
|
14
15
|
require('../_shared/cjs/index-78b35bc1.js');
|
|
@@ -52,7 +53,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
52
53
|
/* -----------------------------------------------------------------------------------------------
|
|
53
54
|
* CollectionProvider
|
|
54
55
|
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
|
|
55
|
-
const [createCollectionContext, createCollectionScope] =
|
|
56
|
+
const [createCollectionContext, createCollectionScope] = index_module.$c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
56
57
|
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
57
58
|
collectionRef: {
|
|
58
59
|
current: null
|
|
@@ -75,8 +76,8 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
75
76
|
const CollectionSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
76
77
|
const { scope: scope , children: children } = props;
|
|
77
78
|
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
78
|
-
const composedRefs =
|
|
79
|
-
return /*#__PURE__*/ React__default["default"].createElement(
|
|
79
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
80
|
+
return /*#__PURE__*/ React__default["default"].createElement(index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
80
81
|
ref: composedRefs
|
|
81
82
|
}, children);
|
|
82
83
|
});
|
|
@@ -87,7 +88,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
87
88
|
const CollectionItemSlot = /*#__PURE__*/ React__default["default"].forwardRef((props, forwardedRef)=>{
|
|
88
89
|
const { scope: scope , children: children , ...itemData } = props;
|
|
89
90
|
const ref = React__default["default"].useRef(null);
|
|
90
|
-
const composedRefs =
|
|
91
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
91
92
|
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
92
93
|
React__default["default"].useEffect(()=>{
|
|
93
94
|
context.itemMap.set(ref, {
|
|
@@ -97,7 +98,7 @@ function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
|
97
98
|
return ()=>void context.itemMap.delete(ref)
|
|
98
99
|
;
|
|
99
100
|
});
|
|
100
|
-
return /*#__PURE__*/ React__default["default"].createElement(
|
|
101
|
+
return /*#__PURE__*/ React__default["default"].createElement(index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
101
102
|
[ITEM_DATA_ATTR]: '',
|
|
102
103
|
ref: composedRefs
|
|
103
104
|
}, children);
|
|
@@ -140,7 +141,7 @@ const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ React$1.createConte
|
|
|
140
141
|
/**
|
|
141
142
|
* Listens for when the escape key is down
|
|
142
143
|
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
143
|
-
const onEscapeKeyDown =
|
|
144
|
+
const onEscapeKeyDown = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
144
145
|
React$1.useEffect(()=>{
|
|
145
146
|
const handleKeyDown = (event)=>{
|
|
146
147
|
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
@@ -170,7 +171,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$1.forwardR
|
|
|
170
171
|
const [node1, setNode] = React$1.useState(null);
|
|
171
172
|
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
172
173
|
const [, force] = React$1.useState({});
|
|
173
|
-
const composedRefs =
|
|
174
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
174
175
|
);
|
|
175
176
|
const layers = Array.from(context.layers);
|
|
176
177
|
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
@@ -254,15 +255,15 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$1.forwardR
|
|
|
254
255
|
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
255
256
|
;
|
|
256
257
|
}, []);
|
|
257
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
258
|
+
return /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index_module._extends({}, layerProps, {
|
|
258
259
|
ref: composedRefs,
|
|
259
260
|
style: {
|
|
260
261
|
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
261
262
|
...props.style
|
|
262
263
|
},
|
|
263
|
-
onFocusCapture:
|
|
264
|
-
onBlurCapture:
|
|
265
|
-
onPointerDownCapture:
|
|
264
|
+
onFocusCapture: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
265
|
+
onBlurCapture: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
266
|
+
onPointerDownCapture: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
266
267
|
}));
|
|
267
268
|
});
|
|
268
269
|
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
@@ -270,7 +271,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$1.forwardR
|
|
|
270
271
|
* to mimic layer dismissing behaviour present in OS.
|
|
271
272
|
* Returns props to pass to the node we want to check for outside events.
|
|
272
273
|
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
273
|
-
const handlePointerDownOutside =
|
|
274
|
+
const handlePointerDownOutside = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
274
275
|
const isPointerInsideReactTreeRef = React$1.useRef(false);
|
|
275
276
|
const handleClickRef = React$1.useRef(()=>{});
|
|
276
277
|
React$1.useEffect(()=>{
|
|
@@ -338,7 +339,7 @@ const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React$1.forwardR
|
|
|
338
339
|
* Listens for when focus happens outside a react subtree.
|
|
339
340
|
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
340
341
|
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
341
|
-
const handleFocusOutside =
|
|
342
|
+
const handleFocusOutside = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
342
343
|
const isFocusInsideReactTreeRef = React$1.useRef(false);
|
|
343
344
|
React$1.useEffect(()=>{
|
|
344
345
|
const handleFocus = (event)=>{
|
|
@@ -378,7 +379,7 @@ function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detai
|
|
|
378
379
|
if (handler) target.addEventListener(name, handler, {
|
|
379
380
|
once: true
|
|
380
381
|
});
|
|
381
|
-
if (discrete)
|
|
382
|
+
if (discrete) index_module.$8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
382
383
|
else target.dispatchEvent(event);
|
|
383
384
|
}
|
|
384
385
|
|
|
@@ -417,10 +418,10 @@ const $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
|
417
418
|
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
418
419
|
const { loop: loop = false , trapped: trapped = false , onMountAutoFocus: onMountAutoFocusProp , onUnmountAutoFocus: onUnmountAutoFocusProp , ...scopeProps } = props;
|
|
419
420
|
const [container1, setContainer] = React$1.useState(null);
|
|
420
|
-
const onMountAutoFocus =
|
|
421
|
-
const onUnmountAutoFocus =
|
|
421
|
+
const onMountAutoFocus = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
422
|
+
const onUnmountAutoFocus = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
422
423
|
const lastFocusedElementRef = React$1.useRef(null);
|
|
423
|
-
const composedRefs =
|
|
424
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContainer(node)
|
|
424
425
|
);
|
|
425
426
|
const focusScope = React$1.useRef({
|
|
426
427
|
paused: false,
|
|
@@ -528,7 +529,7 @@ const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ React$1.forwardR
|
|
|
528
529
|
trapped,
|
|
529
530
|
focusScope.paused
|
|
530
531
|
]);
|
|
531
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
532
|
+
return /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index_module._extends({
|
|
532
533
|
tabIndex: -1
|
|
533
534
|
}, scopeProps, {
|
|
534
535
|
ref: composedRefs,
|
|
@@ -657,7 +658,7 @@ const $1746a345f3d73bb7$var$useReactId = React__namespace['useId'.toString()] ||
|
|
|
657
658
|
let $1746a345f3d73bb7$var$count = 0;
|
|
658
659
|
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
659
660
|
const [id, setId] = React__namespace.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
|
|
660
|
-
|
|
661
|
+
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
661
662
|
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
662
663
|
);
|
|
663
664
|
}, [
|
|
@@ -669,13 +670,13 @@ function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
|
669
670
|
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
670
671
|
var _globalThis$document;
|
|
671
672
|
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
672
|
-
return container ? /*#__PURE__*/ $7SXl2$reactdom__default["default"].createPortal(/*#__PURE__*/ React$1.createElement(
|
|
673
|
+
return container ? /*#__PURE__*/ $7SXl2$reactdom__default["default"].createPortal(/*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index_module._extends({}, portalProps, {
|
|
673
674
|
ref: forwardedRef
|
|
674
675
|
})), container) : null;
|
|
675
676
|
});
|
|
676
677
|
|
|
677
678
|
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
678
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
679
|
+
return /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index_module._extends({}, props, {
|
|
679
680
|
ref: forwardedRef,
|
|
680
681
|
style: {
|
|
681
682
|
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
@@ -1551,7 +1552,7 @@ const $cc7e05a45900e73f$var$SELECTION_KEYS = [
|
|
|
1551
1552
|
* Select
|
|
1552
1553
|
* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$SELECT_NAME = 'Select';
|
|
1553
1554
|
const [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($cc7e05a45900e73f$var$SELECT_NAME);
|
|
1554
|
-
const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] =
|
|
1555
|
+
const [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = index_module.$c512c27ab02ef895$export$50c7b4e9d9f19c1($cc7e05a45900e73f$var$SELECT_NAME, [
|
|
1555
1556
|
$cc7e05a45900e73f$var$createCollectionScope
|
|
1556
1557
|
]);
|
|
1557
1558
|
const [$cc7e05a45900e73f$var$SelectProvider, $cc7e05a45900e73f$var$useSelectContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
@@ -1562,12 +1563,12 @@ const $cc7e05a45900e73f$export$ef9b1a59e592288f = (props)=>{
|
|
|
1562
1563
|
const [valueNode, setValueNode] = React$1.useState(null);
|
|
1563
1564
|
const [valueNodeHasChildren, setValueNodeHasChildren] = React$1.useState(false);
|
|
1564
1565
|
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
1565
|
-
const [open = false, setOpen] =
|
|
1566
|
+
const [open = false, setOpen] = index_module.$71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
1566
1567
|
prop: openProp,
|
|
1567
1568
|
defaultProp: defaultOpen,
|
|
1568
1569
|
onChange: onOpenChange
|
|
1569
1570
|
});
|
|
1570
|
-
const [value, setValue] =
|
|
1571
|
+
const [value, setValue] = index_module.$71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
1571
1572
|
prop: valueProp,
|
|
1572
1573
|
defaultProp: defaultValue,
|
|
1573
1574
|
onChange: onValueChange
|
|
@@ -1636,7 +1637,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1636
1637
|
const { __scopeSelect: __scopeSelect , disabled: disabled = false , ...triggerProps } = props;
|
|
1637
1638
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME, __scopeSelect);
|
|
1638
1639
|
const isDisabled = context.disabled || disabled;
|
|
1639
|
-
const composedRefs =
|
|
1640
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onTriggerChange);
|
|
1640
1641
|
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
1641
1642
|
const [searchRef, handleTypeaheadSearch, resetTypeahead] = $cc7e05a45900e73f$var$useTypeaheadSearch((search)=>{
|
|
1642
1643
|
const enabledItems = getItems().filter((item)=>!item.disabled
|
|
@@ -1652,7 +1653,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1652
1653
|
resetTypeahead();
|
|
1653
1654
|
}
|
|
1654
1655
|
};
|
|
1655
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
1656
|
+
return /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.button, index_module._extends({
|
|
1656
1657
|
type: "button",
|
|
1657
1658
|
role: "combobox",
|
|
1658
1659
|
"aria-controls": context.contentId,
|
|
@@ -1667,7 +1668,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1667
1668
|
}, triggerProps, {
|
|
1668
1669
|
ref: composedRefs // Enable compatibility with native label or custom `Label` "click" for Safari:
|
|
1669
1670
|
,
|
|
1670
|
-
onClick:
|
|
1671
|
+
onClick: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onClick, (event)=>{
|
|
1671
1672
|
// Whilst browsers generally have no issue focusing the trigger when clicking
|
|
1672
1673
|
// on a label, Safari seems to struggle with the fact that there's no `onClick`.
|
|
1673
1674
|
// We force `focus` in this case. Note: this doesn't create any other side-effect
|
|
@@ -1675,7 +1676,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1675
1676
|
// this only runs for a label "click"
|
|
1676
1677
|
event.currentTarget.focus();
|
|
1677
1678
|
}),
|
|
1678
|
-
onPointerDown:
|
|
1679
|
+
onPointerDown: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onPointerDown, (event)=>{
|
|
1679
1680
|
// prevent implicit pointer capture
|
|
1680
1681
|
// https://www.w3.org/TR/pointerevents3/#implicit-pointer-capture
|
|
1681
1682
|
const target = event.target;
|
|
@@ -1691,7 +1692,7 @@ const $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ React$1.forwardRe
|
|
|
1691
1692
|
event.preventDefault();
|
|
1692
1693
|
}
|
|
1693
1694
|
}),
|
|
1694
|
-
onKeyDown:
|
|
1695
|
+
onKeyDown: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onKeyDown, (event)=>{
|
|
1695
1696
|
const isTypingAhead = searchRef.current !== '';
|
|
1696
1697
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
1697
1698
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -1712,14 +1713,14 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React$1.forwardR
|
|
|
1712
1713
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect);
|
|
1713
1714
|
const { onValueNodeHasChildrenChange: onValueNodeHasChildrenChange } = context;
|
|
1714
1715
|
const hasChildren = children !== undefined;
|
|
1715
|
-
const composedRefs =
|
|
1716
|
-
|
|
1716
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onValueNodeChange);
|
|
1717
|
+
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1717
1718
|
onValueNodeHasChildrenChange(hasChildren);
|
|
1718
1719
|
}, [
|
|
1719
1720
|
onValueNodeHasChildrenChange,
|
|
1720
1721
|
hasChildren
|
|
1721
1722
|
]);
|
|
1722
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
1723
|
+
return /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index_module._extends({}, valueProps, {
|
|
1723
1724
|
ref: composedRefs // we don't want events from the portalled `SelectValue` children to bubble
|
|
1724
1725
|
,
|
|
1725
1726
|
style: {
|
|
@@ -1729,14 +1730,14 @@ const $cc7e05a45900e73f$export$e288731fd71264f0 = /*#__PURE__*/ React$1.forwardR
|
|
|
1729
1730
|
});
|
|
1730
1731
|
const $cc7e05a45900e73f$export$99b400cabb58c515 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
1731
1732
|
const { __scopeSelect: __scopeSelect , children: children , ...iconProps } = props;
|
|
1732
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
1733
|
+
return /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index_module._extends({
|
|
1733
1734
|
"aria-hidden": true
|
|
1734
1735
|
}, iconProps, {
|
|
1735
1736
|
ref: forwardedRef
|
|
1736
1737
|
}), children || '▼');
|
|
1737
1738
|
});
|
|
1738
1739
|
const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
1739
|
-
return /*#__PURE__*/ React$1.createElement($f1701beae083dbae$export$602eac185826482c,
|
|
1740
|
+
return /*#__PURE__*/ React$1.createElement($f1701beae083dbae$export$602eac185826482c, index_module._extends({
|
|
1740
1741
|
asChild: true
|
|
1741
1742
|
}, props));
|
|
1742
1743
|
};
|
|
@@ -1746,10 +1747,10 @@ const $cc7e05a45900e73f$export$b2af6c9944296213 = (props)=>{
|
|
|
1746
1747
|
const $cc7e05a45900e73f$export$c973a4b3cb86a03d = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
1747
1748
|
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, props.__scopeSelect);
|
|
1748
1749
|
const [fragment, setFragment] = React$1.useState(); // setting the fragment in `useLayoutEffect` as `DocumentFragment` doesn't exist on the server
|
|
1749
|
-
|
|
1750
|
+
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1750
1751
|
setFragment(new DocumentFragment());
|
|
1751
1752
|
}, []);
|
|
1752
|
-
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, context.open ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectContentImpl,
|
|
1753
|
+
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, context.open ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectContentImpl, index_module._extends({}, props, {
|
|
1753
1754
|
ref: forwardedRef
|
|
1754
1755
|
})) : fragment ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
1755
1756
|
scope: props.__scopeSelect
|
|
@@ -1765,7 +1766,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
1765
1766
|
const [contentWrapper, setContentWrapper] = React$1.useState(null);
|
|
1766
1767
|
const [content, setContent] = React$1.useState(null);
|
|
1767
1768
|
const [viewport, setViewport] = React$1.useState(null);
|
|
1768
|
-
const composedRefs =
|
|
1769
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setContent(node)
|
|
1769
1770
|
);
|
|
1770
1771
|
const [selectedItem, setSelectedItem] = React$1.useState(null);
|
|
1771
1772
|
const [selectedItemText, setSelectedItemText] = React$1.useState(null);
|
|
@@ -1782,7 +1783,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
1782
1783
|
// the last element in the DOM (because of the `Portal`)
|
|
1783
1784
|
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
1784
1785
|
const [contentZIndex, setContentZIndex] = React$1.useState();
|
|
1785
|
-
|
|
1786
|
+
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
1786
1787
|
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
1787
1788
|
}, [
|
|
1788
1789
|
content
|
|
@@ -1898,7 +1899,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
1898
1899
|
selectedItemText,
|
|
1899
1900
|
context.dir
|
|
1900
1901
|
]);
|
|
1901
|
-
|
|
1902
|
+
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>position()
|
|
1902
1903
|
, [
|
|
1903
1904
|
position
|
|
1904
1905
|
]);
|
|
@@ -2034,7 +2035,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
2034
2035
|
shouldExpandOnScrollRef: shouldExpandOnScrollRef,
|
|
2035
2036
|
searchRef: searchRef
|
|
2036
2037
|
}, /*#__PURE__*/ React$1.createElement($01b9c$RemoveScroll, {
|
|
2037
|
-
as:
|
|
2038
|
+
as: index_module.$5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
2038
2039
|
allowPinchZoom: true
|
|
2039
2040
|
}, /*#__PURE__*/ React$1.createElement("div", {
|
|
2040
2041
|
ref: setContentWrapper,
|
|
@@ -2052,14 +2053,14 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
2052
2053
|
// we prevent open autofocus because we manually focus the selected item
|
|
2053
2054
|
event.preventDefault();
|
|
2054
2055
|
},
|
|
2055
|
-
onUnmountAutoFocus:
|
|
2056
|
+
onUnmountAutoFocus: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(onCloseAutoFocus, (event)=>{
|
|
2056
2057
|
var _context$trigger;
|
|
2057
2058
|
(_context$trigger = context.trigger) === null || _context$trigger === void 0 || _context$trigger.focus({
|
|
2058
2059
|
preventScroll: true
|
|
2059
2060
|
});
|
|
2060
2061
|
event.preventDefault();
|
|
2061
2062
|
})
|
|
2062
|
-
}, /*#__PURE__*/ React$1.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22,
|
|
2063
|
+
}, /*#__PURE__*/ React$1.createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, index_module._extends({
|
|
2063
2064
|
role: "listbox",
|
|
2064
2065
|
id: context.contentId,
|
|
2065
2066
|
"data-state": context.open ? 'open' : 'closed',
|
|
@@ -2083,7 +2084,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
2083
2084
|
,
|
|
2084
2085
|
onDismiss: ()=>context.onOpenChange(false)
|
|
2085
2086
|
,
|
|
2086
|
-
onKeyDown:
|
|
2087
|
+
onKeyDown: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event)=>{
|
|
2087
2088
|
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; // select should not be navigated using tab key so we prevent it
|
|
2088
2089
|
if (event.key === 'Tab') event.preventDefault();
|
|
2089
2090
|
if (!isModifierKey && event.key.length === 1) handleTypeaheadSearch(event.key);
|
|
@@ -2125,7 +2126,7 @@ const $cc7e05a45900e73f$var$SelectContentImpl = /*#__PURE__*/ React$1.forwardRef
|
|
|
2125
2126
|
const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2126
2127
|
const { __scopeSelect: __scopeSelect , ...viewportProps } = props;
|
|
2127
2128
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
2128
|
-
const composedRefs =
|
|
2129
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onViewportChange);
|
|
2129
2130
|
const prevScrollTopRef = React$1.useRef(0);
|
|
2130
2131
|
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, /*#__PURE__*/ React$1.createElement("style", {
|
|
2131
2132
|
dangerouslySetInnerHTML: {
|
|
@@ -2133,7 +2134,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React$1.forwardR
|
|
|
2133
2134
|
}
|
|
2134
2135
|
}), /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
2135
2136
|
scope: __scopeSelect
|
|
2136
|
-
}, /*#__PURE__*/ React$1.createElement(
|
|
2137
|
+
}, /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index_module._extends({
|
|
2137
2138
|
"data-radix-select-viewport": "",
|
|
2138
2139
|
role: "presentation"
|
|
2139
2140
|
}, viewportProps, {
|
|
@@ -2147,7 +2148,7 @@ const $cc7e05a45900e73f$export$9ed6e7b40248d36d = /*#__PURE__*/ React$1.forwardR
|
|
|
2147
2148
|
overflow: 'auto',
|
|
2148
2149
|
...viewportProps.style
|
|
2149
2150
|
},
|
|
2150
|
-
onScroll:
|
|
2151
|
+
onScroll: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(viewportProps.onScroll, (event)=>{
|
|
2151
2152
|
const viewport = event.currentTarget;
|
|
2152
2153
|
const { contentWrapper: contentWrapper , shouldExpandOnScrollRef: shouldExpandOnScrollRef } = contentContext;
|
|
2153
2154
|
if (shouldExpandOnScrollRef !== null && shouldExpandOnScrollRef !== void 0 && shouldExpandOnScrollRef.current && contentWrapper) {
|
|
@@ -2188,7 +2189,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$1.forwardR
|
|
|
2188
2189
|
const isSelected = context.value === value;
|
|
2189
2190
|
const [textValue, setTextValue] = React$1.useState(textValueProp !== null && textValueProp !== void 0 ? textValueProp : '');
|
|
2190
2191
|
const [isFocused, setIsFocused] = React$1.useState(false);
|
|
2191
|
-
const composedRefs =
|
|
2192
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>{
|
|
2192
2193
|
var _contentContext$itemR;
|
|
2193
2194
|
return (_contentContext$itemR = contentContext.itemRefCallback) === null || _contentContext$itemR === void 0 ? void 0 : _contentContext$itemR.call(contentContext, node, value, disabled);
|
|
2194
2195
|
});
|
|
@@ -2216,7 +2217,7 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$1.forwardR
|
|
|
2216
2217
|
value: value,
|
|
2217
2218
|
disabled: disabled,
|
|
2218
2219
|
textValue: textValue
|
|
2219
|
-
}, /*#__PURE__*/ React$1.createElement(
|
|
2220
|
+
}, /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index_module._extends({
|
|
2220
2221
|
role: "option",
|
|
2221
2222
|
"aria-labelledby": textId,
|
|
2222
2223
|
"data-highlighted": isFocused ? '' : undefined // `isFocused` caveat fixes stuttering in VoiceOver
|
|
@@ -2228,12 +2229,12 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$1.forwardR
|
|
|
2228
2229
|
tabIndex: disabled ? undefined : -1
|
|
2229
2230
|
}, itemProps, {
|
|
2230
2231
|
ref: composedRefs,
|
|
2231
|
-
onFocus:
|
|
2232
|
+
onFocus: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onFocus, ()=>setIsFocused(true)
|
|
2232
2233
|
),
|
|
2233
|
-
onBlur:
|
|
2234
|
+
onBlur: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onBlur, ()=>setIsFocused(false)
|
|
2234
2235
|
),
|
|
2235
|
-
onPointerUp:
|
|
2236
|
-
onPointerMove:
|
|
2236
|
+
onPointerUp: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerUp, handleSelect),
|
|
2237
|
+
onPointerMove: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerMove, (event)=>{
|
|
2237
2238
|
if (disabled) {
|
|
2238
2239
|
var _contentContext$onIte;
|
|
2239
2240
|
(_contentContext$onIte = contentContext.onItemLeave) === null || _contentContext$onIte === void 0 || _contentContext$onIte.call(contentContext);
|
|
@@ -2243,13 +2244,13 @@ const $cc7e05a45900e73f$export$13ef48a934230896 = /*#__PURE__*/ React$1.forwardR
|
|
|
2243
2244
|
preventScroll: true
|
|
2244
2245
|
});
|
|
2245
2246
|
}),
|
|
2246
|
-
onPointerLeave:
|
|
2247
|
+
onPointerLeave: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerLeave, (event)=>{
|
|
2247
2248
|
if (event.currentTarget === document.activeElement) {
|
|
2248
2249
|
var _contentContext$onIte2;
|
|
2249
2250
|
(_contentContext$onIte2 = contentContext.onItemLeave) === null || _contentContext$onIte2 === void 0 || _contentContext$onIte2.call(contentContext);
|
|
2250
2251
|
}
|
|
2251
2252
|
}),
|
|
2252
|
-
onKeyDown:
|
|
2253
|
+
onKeyDown: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onKeyDown, (event)=>{
|
|
2253
2254
|
var _contentContext$searc;
|
|
2254
2255
|
const isTypingAhead = ((_contentContext$searc = contentContext.searchRef) === null || _contentContext$searc === void 0 ? void 0 : _contentContext$searc.current) !== '';
|
|
2255
2256
|
if (isTypingAhead && event.key === ' ') return;
|
|
@@ -2269,7 +2270,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$1.forwardR
|
|
|
2269
2270
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
2270
2271
|
const nativeOptionsContext = $cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
2271
2272
|
const [itemTextNode, setItemTextNode] = React$1.useState(null);
|
|
2272
|
-
const composedRefs =
|
|
2273
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setItemTextNode(node)
|
|
2273
2274
|
, itemContext.onItemTextChange, (node)=>{
|
|
2274
2275
|
var _contentContext$itemT;
|
|
2275
2276
|
return (_contentContext$itemT = contentContext.itemTextRefCallback) === null || _contentContext$itemT === void 0 ? void 0 : _contentContext$itemT.call(contentContext, node, itemContext.value, itemContext.disabled);
|
|
@@ -2286,7 +2287,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$1.forwardR
|
|
|
2286
2287
|
textContent
|
|
2287
2288
|
]);
|
|
2288
2289
|
const { onNativeOptionAdd: onNativeOptionAdd , onNativeOptionRemove: onNativeOptionRemove } = nativeOptionsContext;
|
|
2289
|
-
|
|
2290
|
+
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
2290
2291
|
onNativeOptionAdd(nativeOption);
|
|
2291
2292
|
return ()=>onNativeOptionRemove(nativeOption)
|
|
2292
2293
|
;
|
|
@@ -2295,7 +2296,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$1.forwardR
|
|
|
2295
2296
|
onNativeOptionRemove,
|
|
2296
2297
|
nativeOption
|
|
2297
2298
|
]);
|
|
2298
|
-
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, /*#__PURE__*/ React$1.createElement(
|
|
2299
|
+
return /*#__PURE__*/ React$1.createElement(React$1.Fragment, null, /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index_module._extends({
|
|
2299
2300
|
id: itemContext.textId
|
|
2300
2301
|
}, itemTextProps, {
|
|
2301
2302
|
ref: composedRefs
|
|
@@ -2307,7 +2308,7 @@ const $cc7e05a45900e73f$export$3572fb0fb821ff49 = /*#__PURE__*/ React$1.forwardR
|
|
|
2307
2308
|
const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2308
2309
|
const { __scopeSelect: __scopeSelect , ...itemIndicatorProps } = props;
|
|
2309
2310
|
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME, __scopeSelect);
|
|
2310
|
-
return itemContext.isSelected ? /*#__PURE__*/ React$1.createElement(
|
|
2311
|
+
return itemContext.isSelected ? /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.span, index_module._extends({
|
|
2311
2312
|
"aria-hidden": true
|
|
2312
2313
|
}, itemIndicatorProps, {
|
|
2313
2314
|
ref: forwardedRef
|
|
@@ -2319,8 +2320,8 @@ const $cc7e05a45900e73f$export$6b9198de19accfe6 = /*#__PURE__*/ React$1.forwardR
|
|
|
2319
2320
|
const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2320
2321
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
2321
2322
|
const [canScrollUp1, setCanScrollUp] = React$1.useState(false);
|
|
2322
|
-
const composedRefs =
|
|
2323
|
-
|
|
2323
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onScrollButtonChange);
|
|
2324
|
+
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
2324
2325
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
2325
2326
|
const viewport = contentContext.viewport;
|
|
2326
2327
|
function handleScroll() {
|
|
@@ -2336,7 +2337,7 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$1.forwardR
|
|
|
2336
2337
|
contentContext.viewport,
|
|
2337
2338
|
contentContext.isPositioned
|
|
2338
2339
|
]);
|
|
2339
|
-
return canScrollUp1 ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl,
|
|
2340
|
+
return canScrollUp1 ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, index_module._extends({}, props, {
|
|
2340
2341
|
ref: composedRefs,
|
|
2341
2342
|
onAutoScroll: ()=>{
|
|
2342
2343
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -2350,8 +2351,8 @@ const $cc7e05a45900e73f$export$d8117927658af6d7 = /*#__PURE__*/ React$1.forwardR
|
|
|
2350
2351
|
const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2351
2352
|
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
2352
2353
|
const [canScrollDown1, setCanScrollDown] = React$1.useState(false);
|
|
2353
|
-
const composedRefs =
|
|
2354
|
-
|
|
2354
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onScrollButtonChange);
|
|
2355
|
+
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
2355
2356
|
if (contentContext.viewport && contentContext.isPositioned) {
|
|
2356
2357
|
const viewport = contentContext.viewport;
|
|
2357
2358
|
function handleScroll() {
|
|
@@ -2369,7 +2370,7 @@ const $cc7e05a45900e73f$export$ff951e476c12189 = /*#__PURE__*/ React$1.forwardRe
|
|
|
2369
2370
|
contentContext.viewport,
|
|
2370
2371
|
contentContext.isPositioned
|
|
2371
2372
|
]);
|
|
2372
|
-
return canScrollDown1 ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl,
|
|
2373
|
+
return canScrollDown1 ? /*#__PURE__*/ React$1.createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, index_module._extends({}, props, {
|
|
2373
2374
|
ref: composedRefs,
|
|
2374
2375
|
onAutoScroll: ()=>{
|
|
2375
2376
|
const { viewport: viewport , selectedItem: selectedItem } = contentContext;
|
|
@@ -2397,7 +2398,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$1.forwa
|
|
|
2397
2398
|
// Because it is part of the normal flow, it will push down (top button) or shrink (bottom button)
|
|
2398
2399
|
// the viewport, potentially causing the active item to now be partially out of view.
|
|
2399
2400
|
// We re-run the `scrollIntoView` logic to make sure it stays within the viewport.
|
|
2400
|
-
|
|
2401
|
+
index_module.$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
2401
2402
|
var _activeItem$ref$curre;
|
|
2402
2403
|
const activeItem = getItems().find((item)=>item.ref.current === document.activeElement
|
|
2403
2404
|
);
|
|
@@ -2407,7 +2408,7 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$1.forwa
|
|
|
2407
2408
|
}, [
|
|
2408
2409
|
getItems
|
|
2409
2410
|
]);
|
|
2410
|
-
return /*#__PURE__*/ React$1.createElement(
|
|
2411
|
+
return /*#__PURE__*/ React$1.createElement(index_module.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, index_module._extends({
|
|
2411
2412
|
"aria-hidden": true
|
|
2412
2413
|
}, scrollIndicatorProps, {
|
|
2413
2414
|
ref: forwardedRef,
|
|
@@ -2415,12 +2416,12 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$1.forwa
|
|
|
2415
2416
|
flexShrink: 0,
|
|
2416
2417
|
...scrollIndicatorProps.style
|
|
2417
2418
|
},
|
|
2418
|
-
onPointerMove:
|
|
2419
|
+
onPointerMove: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerMove, ()=>{
|
|
2419
2420
|
var _contentContext$onIte3;
|
|
2420
2421
|
(_contentContext$onIte3 = contentContext.onItemLeave) === null || _contentContext$onIte3 === void 0 || _contentContext$onIte3.call(contentContext);
|
|
2421
2422
|
if (autoScrollTimerRef.current === null) autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
2422
2423
|
}),
|
|
2423
|
-
onPointerLeave:
|
|
2424
|
+
onPointerLeave: index_module.$e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerLeave, ()=>{
|
|
2424
2425
|
clearAutoScrollTimer();
|
|
2425
2426
|
})
|
|
2426
2427
|
}));
|
|
@@ -2428,8 +2429,8 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$1.forwa
|
|
|
2428
2429
|
/* -----------------------------------------------------------------------------------------------*/ const $cc7e05a45900e73f$var$BubbleSelect = /*#__PURE__*/ React$1.forwardRef((props, forwardedRef)=>{
|
|
2429
2430
|
const { value: value , ...selectProps } = props;
|
|
2430
2431
|
const ref = React$1.useRef(null);
|
|
2431
|
-
const composedRefs =
|
|
2432
|
-
const prevValue =
|
|
2432
|
+
const composedRefs = index_module.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
2433
|
+
const prevValue = index_module.$010c2913dbd2fe3d$export$5cae361ad82dce8b(value); // Bubble value change to parents (e.g form change event)
|
|
2433
2434
|
React$1.useEffect(()=>{
|
|
2434
2435
|
const select = ref.current;
|
|
2435
2436
|
const selectProto = window.HTMLSelectElement.prototype;
|
|
@@ -2459,14 +2460,14 @@ const $cc7e05a45900e73f$var$SelectScrollButtonImpl = /*#__PURE__*/ React$1.forwa
|
|
|
2459
2460
|
* won't work otherwise.
|
|
2460
2461
|
*/ return /*#__PURE__*/ React$1.createElement($ea1ef594cf570d83$export$439d29a4e110a164, {
|
|
2461
2462
|
asChild: true
|
|
2462
|
-
}, /*#__PURE__*/ React$1.createElement("select",
|
|
2463
|
+
}, /*#__PURE__*/ React$1.createElement("select", index_module._extends({}, selectProps, {
|
|
2463
2464
|
ref: composedRefs,
|
|
2464
2465
|
defaultValue: value
|
|
2465
2466
|
})));
|
|
2466
2467
|
});
|
|
2467
2468
|
$cc7e05a45900e73f$var$BubbleSelect.displayName = 'BubbleSelect';
|
|
2468
2469
|
function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
|
|
2469
|
-
const handleSearchChange =
|
|
2470
|
+
const handleSearchChange = index_module.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onSearchChange);
|
|
2470
2471
|
const searchRef = React$1.useRef('');
|
|
2471
2472
|
const timerRef = React$1.useRef(0);
|
|
2472
2473
|
const handleTypeaheadSearch = React$1.useCallback((key)=>{
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FocusEvent } from "react";
|
|
4
|
-
import { FormControlProps } from "../_shared/esm/FormControl-
|
|
4
|
+
import { FormControlProps } from "../_shared/esm/FormControl-2cb96de7";
|
|
5
5
|
/** Use `Select` to choose from a dropdown list of options. */
|
|
6
6
|
declare const Select: React.FC<SelectProps>;
|
|
7
|
-
interface SelectProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "id"> {
|
|
7
|
+
interface SelectProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "id" | "helperUnderLabel"> {
|
|
8
8
|
name: string;
|
|
9
9
|
label: string;
|
|
10
10
|
placeholder: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { c as classNames } from '../_shared/esm/index-2ae58626.js';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
3
|
import React__default, { useContext, createContext, useEffect, forwardRef, useState, createElement, useRef, useCallback, Fragment, useMemo, useId } from 'react';
|
|
4
|
-
import { $ as $c512c27ab02ef895$export$50c7b4e9d9f19c1, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, b as $5e63c961fc1ce211$export$8c6ed5c666ac1360, c as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a, d as $8927f6f2acc4f386$export$250ffa63cdc0d034, _ as _extends, e as $e42e1063c40fb3ef$export$b9ecd428b558ff10, f as $8927f6f2acc4f386$export$6d1a0317bde7de7f, g as $9f79659886946c16$export$e5c5a5f917a5871c, h as $71cd76cc60e0454e$export$6f32135080cb4c3, i as $010c2913dbd2fe3d$export$5cae361ad82dce8b
|
|
4
|
+
import { $ as $c512c27ab02ef895$export$50c7b4e9d9f19c1, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, b as $5e63c961fc1ce211$export$8c6ed5c666ac1360, c as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a, d as $8927f6f2acc4f386$export$250ffa63cdc0d034, _ as _extends, e as $e42e1063c40fb3ef$export$b9ecd428b558ff10, f as $8927f6f2acc4f386$export$6d1a0317bde7de7f, g as $9f79659886946c16$export$e5c5a5f917a5871c, h as $71cd76cc60e0454e$export$6f32135080cb4c3, i as $010c2913dbd2fe3d$export$5cae361ad82dce8b } from '../_shared/esm/index.module-599b86dd.js';
|
|
5
5
|
import $7SXl2$reactdom, { createPortal } from 'react-dom';
|
|
6
6
|
import { B as BtIconChevronDown2Px_2 } from '../_shared/esm/BtIconChevronDown2Px-782876e2.js';
|
|
7
|
+
import { B as BtIconTickAlt2Px_2 } from '../_shared/esm/BtIconTickAlt2Px-da97e9ae.js';
|
|
7
8
|
import { I as Icon } from '../_shared/esm/Icon-61f7237a.js';
|
|
8
|
-
import { F as FormControl } from '../_shared/esm/FormControl-
|
|
9
|
+
import { F as FormControl } from '../_shared/esm/FormControl-2cb96de7.js';
|
|
9
10
|
import { C as Context } from '../_shared/esm/Surface-bf201530.js';
|
|
10
11
|
import { A as ArcRootElementContext } from '../_shared/esm/Base-c235dc45.js';
|
|
11
12
|
import '../_shared/esm/index-229fc864.js';
|
|
@@ -7,7 +7,7 @@ var index_es = require('../_shared/cjs/index.es-77def0c9.js');
|
|
|
7
7
|
var index$1 = require('../_shared/cjs/index-45bfb67b.js');
|
|
8
8
|
var React = require('react');
|
|
9
9
|
var BrandLogo = require('../_shared/cjs/BrandLogo-3c6102ef.js');
|
|
10
|
-
var Button = require('../_shared/cjs/Button-
|
|
10
|
+
var Button = require('../_shared/cjs/Button-1af6868c.js');
|
|
11
11
|
var Surface = require('../_shared/cjs/Surface-d6b8010e.js');
|
|
12
12
|
var BtIconChevronDown2Px = require('../_shared/cjs/BtIconChevronDown2Px-8fb4e2eb.js');
|
|
13
13
|
var handleLinkClick = require('../_shared/cjs/handle-link-click-17a44cf4.js');
|
|
@@ -3,7 +3,7 @@ import { u as useMediaQuery, a as ArcBreakpointL } from '../_shared/esm/index.es
|
|
|
3
3
|
import { c as classNames } from '../_shared/esm/index-2ae58626.js';
|
|
4
4
|
import React__default, { useState, useEffect, Fragment, useContext, useRef, createContext } from 'react';
|
|
5
5
|
import { B as BrandLogo } from '../_shared/esm/BrandLogo-4f13fe85.js';
|
|
6
|
-
import { B as Button } from '../_shared/esm/Button-
|
|
6
|
+
import { B as Button } from '../_shared/esm/Button-10700df4.js';
|
|
7
7
|
import { S as Surface } from '../_shared/esm/Surface-bf201530.js';
|
|
8
8
|
import { B as BtIconChevronDown2Px_2 } from '../_shared/esm/BtIconChevronDown2Px-782876e2.js';
|
|
9
9
|
import { h as handleLinkClick } from '../_shared/esm/handle-link-click-f64f55a2.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { SwitchProps as RadixSwitchProps } from "@radix-ui/react-switch";
|
|
3
|
-
import { FormControlProps } from "../_shared/cjs/FormControl-
|
|
3
|
+
import { FormControlProps } from "../_shared/cjs/FormControl-d4d9c665";
|
|
4
4
|
/** Use `Switch` to toggle between checked and not checked. */
|
|
5
5
|
declare const Switch: FC<SwitchProps>;
|
|
6
6
|
interface SwitchProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "disclosureText" | "disclosureTitle" | "onClickDisclosure" | "helper"> {
|