@radix-ui/react-select 0.1.2-rc.22 → 0.1.2-rc.25
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/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +10 -7
- package/dist/index.module.js.map +1 -1
- package/package.json +16 -16
package/dist/index.d.ts
CHANGED
|
@@ -23,7 +23,8 @@ export interface SelectTriggerProps extends PrimitiveButtonProps {
|
|
|
23
23
|
}
|
|
24
24
|
export const SelectTrigger: React.ForwardRefExoticComponent<SelectTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
25
25
|
type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
|
|
26
|
-
export interface SelectValueProps extends PrimitiveSpanProps {
|
|
26
|
+
export interface SelectValueProps extends Omit<PrimitiveSpanProps, 'placeholder'> {
|
|
27
|
+
placeholder?: React.ReactNode;
|
|
27
28
|
}
|
|
28
29
|
export const SelectValue: React.ForwardRefExoticComponent<SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
29
30
|
export interface SelectIconProps extends PrimitiveSpanProps {
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;AAyBA,iBAAiB,KAAK,GAAG,KAAK,CAAC;AAkB/B,OAAA,wFAEE,CAAC;AAqBH;IACE,QAAQ,CAAC,EAAE,MAAM,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,GAAG,CA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,IAAI,CAAC;CACtB;AAyDD,qCAA+B,SAAQ,iBAAiB;CAAG;AAE3D,OAAA,MAAM,4GAKL,CAAC;AA2HF,OAAA,MAAM,2BAAa,CAAC;AACpB,OAAA,MAAM,qGAAuB,CAAC;AAC9B,OAAA,MAAM,+FAAmB,CAAC;AAC1B,OAAA,MAAM,6FAAiB,CAAC;AACxB,OAAA,MAAM,kGAAuB,CAAC;AAC9B,OAAA,MAAM,oGAAyB,CAAC;AAChC,OAAA,MAAM,8FAAmB,CAAC;AAC1B,OAAA,MAAM,8FAAmB,CAAC;AAC1B,OAAA,MAAM,4FAAiB,CAAC;AACxB,OAAA,MAAM,qGAAyB,CAAC;AAChC,OAAA,MAAM,+GAAmC,CAAC;AAC1C,OAAA,MAAM,gHAAqC,CAAC;AAC5C,OAAA,MAAM,oHAAyC,CAAC;AAChD,OAAA,MAAM,sGAA2B,CAAC","sources":["packages/react/select/src/packages/react/select/src/Select.tsx","packages/react/select/src/packages/react/select/src/index.ts","packages/react/select/src/index.ts"],"sourcesContent":[null,null,"export * from './Select';\n"],"names":[],"version":3,"file":"index.d.ts.map"}
|
package/dist/index.js
CHANGED
|
@@ -197,8 +197,10 @@ const $1345bda09ffc1bc6$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ $cg2C9$react.forw
|
|
|
197
197
|
"aria-autocomplete": "none",
|
|
198
198
|
"aria-labelledby": labelledBy,
|
|
199
199
|
dir: context.dir,
|
|
200
|
+
"data-state": context.open ? 'open' : 'closed',
|
|
200
201
|
disabled: disabled,
|
|
201
|
-
"data-disabled": disabled ? '' : undefined
|
|
202
|
+
"data-disabled": disabled ? '' : undefined,
|
|
203
|
+
"data-placeholder": context.value === undefined ? '' : undefined
|
|
202
204
|
}, triggerProps, {
|
|
203
205
|
ref: composedRefs,
|
|
204
206
|
onPointerDown: $cg2C9$radixuiprimitive.composeEventHandlers(triggerProps.onPointerDown, (event)=>{
|
|
@@ -235,12 +237,12 @@ const $1345bda09ffc1bc6$export$3ac1e88a1c0b9f1 = /*#__PURE__*/ $cg2C9$react.forw
|
|
|
235
237
|
* -----------------------------------------------------------------------------------------------*/ const $1345bda09ffc1bc6$var$VALUE_NAME = 'SelectValue';
|
|
236
238
|
const $1345bda09ffc1bc6$export$e288731fd71264f0 = /*#__PURE__*/ $cg2C9$react.forwardRef((props, forwardedRef)=>{
|
|
237
239
|
// We ignore `className` and `style` as this part shouldn't be styled.
|
|
238
|
-
const { __scopeSelect: __scopeSelect , className: className , style: style , ...valueProps } = props;
|
|
240
|
+
const { __scopeSelect: __scopeSelect , className: className , style: style , children: children , placeholder: placeholder , ...valueProps } = props;
|
|
239
241
|
const context = $1345bda09ffc1bc6$var$useSelectContext($1345bda09ffc1bc6$var$VALUE_NAME, __scopeSelect);
|
|
240
242
|
const { onValueNodeHasChildrenChange: onValueNodeHasChildrenChange } = context;
|
|
241
|
-
const hasChildren =
|
|
243
|
+
const hasChildren = children !== undefined;
|
|
242
244
|
const composedRefs = $cg2C9$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.onValueNodeChange);
|
|
243
|
-
$cg2C9$
|
|
245
|
+
$cg2C9$radixuireactuselayouteffect.useLayoutEffect(()=>{
|
|
244
246
|
onValueNodeHasChildrenChange(hasChildren);
|
|
245
247
|
}, [
|
|
246
248
|
onValueNodeHasChildrenChange,
|
|
@@ -252,7 +254,7 @@ const $1345bda09ffc1bc6$export$e288731fd71264f0 = /*#__PURE__*/ $cg2C9$react.for
|
|
|
252
254
|
style: {
|
|
253
255
|
pointerEvents: 'none'
|
|
254
256
|
}
|
|
255
|
-
}));
|
|
257
|
+
}), context.value === undefined && placeholder !== undefined ? placeholder : children);
|
|
256
258
|
});
|
|
257
259
|
/*#__PURE__*/ Object.assign($1345bda09ffc1bc6$export$e288731fd71264f0, {
|
|
258
260
|
displayName: $1345bda09ffc1bc6$var$VALUE_NAME
|
|
@@ -775,10 +777,11 @@ const $1345bda09ffc1bc6$export$13ef48a934230896 = /*#__PURE__*/ $cg2C9$react.for
|
|
|
775
777
|
textValue: textValue
|
|
776
778
|
}, /*#__PURE__*/ $cg2C9$react.createElement($cg2C9$radixuireactprimitive.Primitive.div, ($parcel$interopDefault($cg2C9$babelruntimehelpersextends))({
|
|
777
779
|
role: "option",
|
|
778
|
-
"aria-labelledby": textId
|
|
780
|
+
"aria-labelledby": textId,
|
|
781
|
+
"data-highlighted": isFocused ? '' : undefined // `isFocused` caveat fixes stuttering in VoiceOver
|
|
779
782
|
,
|
|
780
783
|
"aria-selected": isSelected && isFocused,
|
|
781
|
-
"data-state": isSelected ? '
|
|
784
|
+
"data-state": isSelected ? 'checked' : 'unchecked',
|
|
782
785
|
"aria-disabled": disabled || undefined,
|
|
783
786
|
"data-disabled": disabled ? '' : undefined,
|
|
784
787
|
tabIndex: disabled ? undefined : -1
|