Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/components/src/components/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import {
useElementSize,
useEventListener,
} from '@koobiq/react-core';
import { ButtonContext, Provider, useDialog } from '@koobiq/react-primitives';
import {
ButtonContext,
Provider,
useDialog,
DEFAULT_SLOT,
} from '@koobiq/react-primitives';

import { utilClasses } from '../../styles/utility';

Expand Down Expand Up @@ -81,6 +86,7 @@ const DialogComponent = forwardRef<DialogRef, DialogProps>(
ButtonContext,
{
slots: {
[DEFAULT_SLOT]: {},
close: {
onPress: onClose,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { useNumberField } from '@react-aria/numberfield';
import { useNumberFieldState } from '@react-stately/numberfield';

import {
DEFAULT_SLOT,
Provider,
removeDataAttributes,
useRenderProps,
Expand Down Expand Up @@ -77,6 +78,7 @@ export const NumberField = forwardRef<NumberFieldRef, NumberFieldProps>(
ButtonContext,
{
slots: {
[DEFAULT_SLOT]: {},
increment: incrementButtonProps,
decrement: decrementButtonProps,
},
Expand All @@ -86,6 +88,7 @@ export const NumberField = forwardRef<NumberFieldRef, NumberFieldProps>(
TextContext,
{
slots: {
[DEFAULT_SLOT]: {},
description: descriptionProps,
errorMessage: errorMessageProps,
},
Expand Down
2 changes: 2 additions & 0 deletions packages/primitives/src/components/Radio/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Provider,
removeDataAttributes,
useSlottedContext,
DEFAULT_SLOT,
} from '../../utils';
import { FieldErrorContext } from '../FieldError';
import { FormContext } from '../Form';
Expand Down Expand Up @@ -75,6 +76,7 @@ export const RadioGroup = forwardRef<ComponentRef<'div'>, RadioGroupProps>(
TextContext,
{
slots: {
[DEFAULT_SLOT]: {},
description: descriptionProps,
errorMessage: errorMessageProps,
},
Expand Down
3 changes: 3 additions & 0 deletions packages/primitives/src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
useRenderProps,
useSlottedContext,
removeDataAttributes,
DEFAULT_SLOT,
} from '../../utils';
import { ButtonContext } from '../Button';
import { FieldErrorContext } from '../FieldError';
Expand Down Expand Up @@ -141,6 +142,7 @@ function TextFieldRender(
TextContext,
{
slots: {
[DEFAULT_SLOT]: {},
description: descriptionProps,
errorMessage: errorMessageProps,
},
Expand All @@ -150,6 +152,7 @@ function TextFieldRender(
ButtonContext,
{
slots: {
[DEFAULT_SLOT]: {},
'clear-button': {
'aria-label': stringFormatter.format('clear'),
preventFocusOnPress: true,
Expand Down
9 changes: 2 additions & 7 deletions packages/primitives/src/utils/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ import type {
DOMProps as SharedDOMProps,
RefObject,
} from '@koobiq/react-core';
import {
isNotNil,
mergeProps,
mergeRefs,
useObjectRef,
} from '@koobiq/react-core';
import { mergeProps, mergeRefs, useObjectRef } from '@koobiq/react-core';

export const DEFAULT_SLOT = Symbol('default');

Expand Down Expand Up @@ -184,7 +179,7 @@ export function useSlottedContext<T>(
): T | null | undefined {
const ctx = useContext(context);

if (!isNotNil(slot)) {
if (slot === null) {
return null;
}

Expand Down