@qasa/qds-ui 0.9.0 → 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 {};
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import * as _emotion_react from '@emotion/react';
|
|
|
6
6
|
import { CSSObject } from '@emotion/react';
|
|
7
7
|
import * as _emotion_styled from '@emotion/styled';
|
|
8
8
|
import { LucideIcon } from 'lucide-react';
|
|
9
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
9
10
|
|
|
10
11
|
declare const theme: {
|
|
11
12
|
mediaQueries: {
|
|
@@ -1448,8 +1449,9 @@ declare const getFormFieldBaseStyles: (theme: {
|
|
|
1448
1449
|
boxShadow: `0 0 0 1px ${string}`;
|
|
1449
1450
|
};
|
|
1450
1451
|
};
|
|
1451
|
-
'&[disabled]': {
|
|
1452
|
+
'&[disabled], &:disabled, &[data-disabled]': {
|
|
1452
1453
|
opacity: number;
|
|
1454
|
+
borderColor: string;
|
|
1453
1455
|
};
|
|
1454
1456
|
transitionProperty: "opacity, border-color, box-shadow";
|
|
1455
1457
|
transitionDuration: "120ms";
|
|
@@ -5251,6 +5253,74 @@ interface TextareaBaseProps extends Omit<HTMLQdsProps<'textarea'>, OmittedProps$
|
|
|
5251
5253
|
}
|
|
5252
5254
|
declare const TextareaBase: react.ForwardRefExoticComponent<TextareaBaseProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
5253
5255
|
|
|
5256
|
+
interface RadioCardOptions {
|
|
5257
|
+
label: string;
|
|
5258
|
+
/**
|
|
5259
|
+
* Text that provides additional guidance to the user
|
|
5260
|
+
*/
|
|
5261
|
+
helperText?: string;
|
|
5262
|
+
/**
|
|
5263
|
+
* If `true` the radio card will be required using the HTML `required` attribute.
|
|
5264
|
+
* @default false
|
|
5265
|
+
*/
|
|
5266
|
+
isRequired?: boolean;
|
|
5267
|
+
/**
|
|
5268
|
+
* If `true` the radio card will be disabled using the HTML `disabled` attribute.
|
|
5269
|
+
* @default false
|
|
5270
|
+
*/
|
|
5271
|
+
isDisabled?: boolean;
|
|
5272
|
+
}
|
|
5273
|
+
interface RadioCardProps extends Omit<RadioGroupPrimitive.RadioGroupItemProps, 'asChild' | keyof RadioCardOptions>, RadioCardOptions {
|
|
5274
|
+
}
|
|
5275
|
+
|
|
5276
|
+
declare type RadioGroupLabelProps = HTMLQdsProps<'label'>;
|
|
5277
|
+
|
|
5278
|
+
interface RadioGroupOptions {
|
|
5279
|
+
/**
|
|
5280
|
+
* The value of the radio item that should be checked when initially rendered.
|
|
5281
|
+
* Use when you do not need to control the state of the radio items.
|
|
5282
|
+
*/
|
|
5283
|
+
defaultValue?: string;
|
|
5284
|
+
/**
|
|
5285
|
+
* The controlled value of the radio item to check.
|
|
5286
|
+
* Should be used in conjunction with `onValueChange`.
|
|
5287
|
+
*/
|
|
5288
|
+
value?: string;
|
|
5289
|
+
/**
|
|
5290
|
+
* Event handler called when the value changes.
|
|
5291
|
+
*/
|
|
5292
|
+
onValueChange?: (value: string) => void;
|
|
5293
|
+
/**
|
|
5294
|
+
* The name of the group. Submitted with its owning form as part of a name/value pair.
|
|
5295
|
+
*/
|
|
5296
|
+
name?: string;
|
|
5297
|
+
/**
|
|
5298
|
+
* If `true` all child radio items will be disabled.
|
|
5299
|
+
* @default false
|
|
5300
|
+
*/
|
|
5301
|
+
isDisabled?: boolean;
|
|
5302
|
+
/**
|
|
5303
|
+
* If `true` the user must check a radio item before the owning form can be submitted.
|
|
5304
|
+
* @default false
|
|
5305
|
+
*/
|
|
5306
|
+
isRequired?: boolean;
|
|
5307
|
+
/**
|
|
5308
|
+
* If `true` the radio group will be invalid.
|
|
5309
|
+
* @default false
|
|
5310
|
+
*/
|
|
5311
|
+
isInvalid?: boolean;
|
|
5312
|
+
/**
|
|
5313
|
+
* The error message to display if `isInvalid` is `true`
|
|
5314
|
+
*/
|
|
5315
|
+
errorMessage?: string;
|
|
5316
|
+
}
|
|
5317
|
+
interface RadioGroupProps extends Omit<RadioGroupPrimitive.RadioGroupProps, 'asChild' | keyof RadioGroupOptions>, RadioGroupOptions {
|
|
5318
|
+
}
|
|
5319
|
+
declare const RadioGroup: react.ForwardRefExoticComponent<RadioGroupProps & react.RefAttributes<HTMLDivElement>> & {
|
|
5320
|
+
Card: react.ForwardRefExoticComponent<RadioCardProps & react.RefAttributes<HTMLButtonElement>>;
|
|
5321
|
+
Label: react.ForwardRefExoticComponent<Pick<react.DetailedHTMLProps<react.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "key" | keyof react.LabelHTMLAttributes<HTMLLabelElement>> & react.RefAttributes<HTMLLabelElement>>;
|
|
5322
|
+
};
|
|
5323
|
+
|
|
5254
5324
|
interface SelectOptionOptions {
|
|
5255
5325
|
isDisabled?: boolean;
|
|
5256
5326
|
}
|
|
@@ -5449,4 +5519,4 @@ declare function useStableId(fixedId?: string | null): string;
|
|
|
5449
5519
|
*/
|
|
5450
5520
|
declare const useSafeLayoutEffect: typeof useLayoutEffect;
|
|
5451
5521
|
|
|
5452
|
-
export { AlertCircleIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Avatar, AvatarProps, BellIcon, BellOffIcon, BookmarkIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CreateIconOptions, Divider, DividerProps, ForwardRefComponent, GlobalStyles, GlobeIcon, Heading, HeadingProps, HeartFilledIcon, HeartIcon, HelpCircleIcon, HintBox, HintBoxProps, HintBoxTitleProps, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconProps, Image, ImageIcon, ImageProps, InputBase, InputBaseOptions, InputBaseProps, IntrinsicElement, Label, LabelProps, Link, LinkProps, ListFilterIcon, ListIcon, LoadingDots, LoadingDotsProps, LogOutIcon, MapIcon, MapPinIcon, MenuIcon, MessageCircleIcon, MinusIcon, MoreHorizontalIcon, MoreVerticalIcon, OwnProps, Paragraph, ParagraphProps, PenIcon, PlusIcon, PropsOf, QdsProvider, SearchIcon, Select, SelectBase, SelectBaseOptions, SelectOptionProps, SelectProps, SettingsIcon, ShareIcon, SlidersIcon, Spacer, SpacerProps, Stack, StackProps, StarFilledIcon, StarIcon, TextField, TextFieldProps, Textarea, TextareaBase, TextareaBaseOptions, TextareaBaseProps, TextareaProps, Theme, ThemeOverrides, TrashIcon, UseBreakpointOptions, UseBreakpointValueProps, UseFormFieldProps, UseImageProps, UserIcon, VariantProps, XCircleIcon, XIcon, createIcon, createLucideIcon, createStyle, createStyleVariants, getFormFieldBaseStyles, overrideTheme, pxToRem, theme, useBreakpoint, useBreakpointValue, useFormField, useImage, useSafeLayoutEffect, useStableId };
|
|
5522
|
+
export { AlertCircleIcon, AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, Avatar, AvatarProps, BellIcon, BellOffIcon, BookmarkIcon, Button, ButtonProps, CalendarIcon, CameraIcon, CheckCircleIcon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CreateIconOptions, Divider, DividerProps, ForwardRefComponent, GlobalStyles, GlobeIcon, Heading, HeadingProps, HeartFilledIcon, HeartIcon, HelpCircleIcon, HintBox, HintBoxProps, HintBoxTitleProps, HistoryIcon, HomeIcon, IconButton, IconButtonProps, IconProps, Image, ImageIcon, ImageProps, InputBase, InputBaseOptions, InputBaseProps, IntrinsicElement, Label, LabelProps, Link, LinkProps, ListFilterIcon, ListIcon, LoadingDots, LoadingDotsProps, LogOutIcon, MapIcon, MapPinIcon, MenuIcon, MessageCircleIcon, MinusIcon, MoreHorizontalIcon, MoreVerticalIcon, OwnProps, Paragraph, ParagraphProps, PenIcon, PlusIcon, PropsOf, QdsProvider, RadioCardProps, RadioGroup, RadioGroupLabelProps, RadioGroupProps, SearchIcon, Select, SelectBase, SelectBaseOptions, SelectOptionProps, SelectProps, SettingsIcon, ShareIcon, SlidersIcon, Spacer, SpacerProps, Stack, StackProps, StarFilledIcon, StarIcon, TextField, TextFieldProps, Textarea, TextareaBase, TextareaBaseOptions, TextareaBaseProps, TextareaProps, Theme, ThemeOverrides, TrashIcon, UseBreakpointOptions, UseBreakpointValueProps, UseFormFieldProps, UseImageProps, UserIcon, VariantProps, XCircleIcon, XIcon, createIcon, createLucideIcon, createStyle, createStyleVariants, getFormFieldBaseStyles, overrideTheme, pxToRem, theme, useBreakpoint, useBreakpointValue, useFormField, useImage, useSafeLayoutEffect, useStableId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qasa/qds-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0-next.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -101,5 +101,8 @@
|
|
|
101
101
|
},
|
|
102
102
|
"engines": {
|
|
103
103
|
"node": ">=14"
|
|
104
|
+
},
|
|
105
|
+
"dependencies": {
|
|
106
|
+
"@radix-ui/react-radio-group": "^1.1.3"
|
|
104
107
|
}
|
|
105
108
|
}
|