@qasa/qds-ui 0.9.0-next.5 → 0.10.0-next.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/cjs/index.js +1323 -1323
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/_internal/form-parts.d.ts +1 -1
- package/dist/cjs/types/components/index.d.ts +1 -0
- package/dist/cjs/types/components/radio-group/index.d.ts +1 -0
- package/dist/cjs/types/components/radio-group/radio-card.d.ts +23 -0
- package/dist/cjs/types/components/radio-group/radio-group-context.d.ts +16 -0
- package/dist/cjs/types/components/radio-group/radio-group-label.d.ts +4 -0
- package/dist/cjs/types/components/radio-group/radio-group.d.ts +50 -0
- package/dist/cjs/types/components/radio-group/radio-indicator.d.ts +10 -0
- package/dist/cjs/types/styles/common-styles.d.ts +2 -1
- package/dist/cjs/types/utils/html-attributes.d.ts +3 -0
- package/dist/cjs/types/utils/merge-refs.d.ts +5 -0
- package/dist/esm/index.js +1323 -1323
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/_internal/form-parts.d.ts +1 -1
- package/dist/esm/types/components/index.d.ts +1 -0
- package/dist/esm/types/components/radio-group/index.d.ts +1 -0
- package/dist/esm/types/components/radio-group/radio-card.d.ts +23 -0
- package/dist/esm/types/components/radio-group/radio-group-context.d.ts +16 -0
- package/dist/esm/types/components/radio-group/radio-group-label.d.ts +4 -0
- package/dist/esm/types/components/radio-group/radio-group.d.ts +50 -0
- package/dist/esm/types/components/radio-group/radio-indicator.d.ts +10 -0
- package/dist/esm/types/styles/common-styles.d.ts +2 -1
- package/dist/esm/types/utils/html-attributes.d.ts +3 -0
- package/dist/esm/types/utils/merge-refs.d.ts +5 -0
- package/dist/index.d.ts +72 -2
- package/package.json +4 -1
|
@@ -7,4 +7,4 @@ export declare const ErrorMessage: import("@emotion/styled").StyledComponent<{
|
|
|
7
7
|
export declare const HelperText: import("@emotion/styled").StyledComponent<{
|
|
8
8
|
theme?: import("@emotion/react").Theme | undefined;
|
|
9
9
|
as?: import("react").ElementType<any> | undefined;
|
|
10
|
-
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<
|
|
10
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './radio-group';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
interface RadioCardOptions {
|
|
4
|
+
label: string;
|
|
5
|
+
/**
|
|
6
|
+
* Text that provides additional guidance to the user
|
|
7
|
+
*/
|
|
8
|
+
helperText?: string;
|
|
9
|
+
/**
|
|
10
|
+
* If `true` the radio card will be required using the HTML `required` attribute.
|
|
11
|
+
* @default false
|
|
12
|
+
*/
|
|
13
|
+
isRequired?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* If `true` the radio card will be disabled using the HTML `disabled` attribute.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface RadioCardProps extends Omit<RadioGroupPrimitive.RadioGroupItemProps, 'asChild' | keyof RadioCardOptions>, RadioCardOptions {
|
|
21
|
+
}
|
|
22
|
+
export declare const RadioCard: import("react").ForwardRefExoticComponent<RadioCardProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface RadioGroupContextValue {
|
|
3
|
+
labelRefCallback: (node: HTMLElement | null) => void;
|
|
4
|
+
isDisabled: boolean | undefined;
|
|
5
|
+
errorMessageId?: string;
|
|
6
|
+
}
|
|
7
|
+
interface RadioGroupProviderProps {
|
|
8
|
+
value: RadioGroupContextValue;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function RadioGroupProvider({ value, children }: RadioGroupProviderProps): JSX.Element;
|
|
12
|
+
interface UseRadioGroupContextProps {
|
|
13
|
+
consumerName: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const useRadioGroupContext: ({ consumerName }: UseRadioGroupContextProps) => RadioGroupContextValue;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { HTMLQdsProps } from '../../types';
|
|
3
|
+
export declare type RadioGroupLabelProps = HTMLQdsProps<'label'>;
|
|
4
|
+
export declare const RadioGroupLabel: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "key" | keyof import("react").LabelHTMLAttributes<HTMLLabelElement>> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
import type { RadioCardProps } from './radio-card';
|
|
4
|
+
import type { RadioGroupLabelProps } from './radio-group-label';
|
|
5
|
+
interface RadioGroupOptions {
|
|
6
|
+
/**
|
|
7
|
+
* The value of the radio item that should be checked when initially rendered.
|
|
8
|
+
* Use when you do not need to control the state of the radio items.
|
|
9
|
+
*/
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The controlled value of the radio item to check.
|
|
13
|
+
* Should be used in conjunction with `onValueChange`.
|
|
14
|
+
*/
|
|
15
|
+
value?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Event handler called when the value changes.
|
|
18
|
+
*/
|
|
19
|
+
onValueChange?: (value: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* The name of the group. Submitted with its owning form as part of a name/value pair.
|
|
22
|
+
*/
|
|
23
|
+
name?: string;
|
|
24
|
+
/**
|
|
25
|
+
* If `true` all child radio items will be disabled.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
isDisabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If `true` the user must check a radio item before the owning form can be submitted.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
isRequired?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* If `true` the radio group will be invalid.
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
isInvalid?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The error message to display if `isInvalid` is `true`
|
|
41
|
+
*/
|
|
42
|
+
errorMessage?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface RadioGroupProps extends Omit<RadioGroupPrimitive.RadioGroupProps, 'asChild' | keyof RadioGroupOptions>, RadioGroupOptions {
|
|
45
|
+
}
|
|
46
|
+
export declare const RadioGroup: import("react").ForwardRefExoticComponent<RadioGroupProps & import("react").RefAttributes<HTMLDivElement>> & {
|
|
47
|
+
Card: import("react").ForwardRefExoticComponent<RadioCardProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
48
|
+
Label: import("react").ForwardRefExoticComponent<Pick<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "key" | keyof import("react").LabelHTMLAttributes<HTMLLabelElement>> & import("react").RefAttributes<HTMLLabelElement>>;
|
|
49
|
+
};
|
|
50
|
+
export type { RadioGroupLabelProps, RadioCardProps };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
+
declare type RadioIndicatorProps = Omit<RadioGroupPrimitive.RadioGroupIndicatorProps, 'asChild' | 'forceMount'>;
|
|
4
|
+
/**
|
|
5
|
+
* Styled Radix `RadioIndicator` component.
|
|
6
|
+
* @see Docs https://www.radix-ui.com/primitives/docs/components/radio-group#indicator
|
|
7
|
+
* @internal Not to be used outside the library.
|
|
8
|
+
*/
|
|
9
|
+
export declare const RadioIndicator: import("react").ForwardRefExoticComponent<RadioIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
10
|
+
export {};
|
|
@@ -414,8 +414,9 @@ export declare const getFormFieldBaseStyles: (theme: {
|
|
|
414
414
|
boxShadow: `0 0 0 1px ${string}`;
|
|
415
415
|
};
|
|
416
416
|
};
|
|
417
|
-
'&[disabled]': {
|
|
417
|
+
'&[disabled], &:disabled, &[data-disabled]': {
|
|
418
418
|
opacity: number;
|
|
419
|
+
borderColor: string;
|
|
419
420
|
};
|
|
420
421
|
transitionProperty: "opacity, border-color, box-shadow";
|
|
421
422
|
transitionDuration: "120ms";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { MutableRefObject, RefCallback } from 'react';
|
|
2
|
+
declare type ReactRef<T> = RefCallback<T> | MutableRefObject<T>;
|
|
3
|
+
declare type Maybe<T> = T | null | undefined;
|
|
4
|
+
export declare const mergeRefs: <T>(...refs: Maybe<ReactRef<T>>[]) => (node: T | null) => void;
|
|
5
|
+
export {};
|