uikit-react-public 0.50.5 → 0.50.6
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/components/ToggleGroup/ToggleGroup.d.ts +5 -3
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +2 -2
- package/dist/components/ToggleGroup/ToggleGroupContext.d.ts +2 -0
- package/dist/components/ToggleGroup/index.d.ts +1 -2
- package/dist/components/ToggleGroup/subcomponents/ToggleGroupItem.d.ts +13 -0
- package/dist/components/ToggleGroup/subcomponents/{Item.stories.d.ts → ToggleGroupItem.stories.d.ts} +2 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/index.js +5126 -5045
- package/lib/components/ToggleGroup/ToggleGroup.tsx +51 -10
- package/lib/components/ToggleGroup/ToggleGroupContext.tsx +2 -0
- package/lib/components/ToggleGroup/__tests__/ToggleGroup.test.tsx +105 -6
- package/lib/components/ToggleGroup/index.ts +1 -2
- package/lib/components/ToggleGroup/subcomponents/{Item.stories.tsx → ToggleGroupItem.stories.tsx} +2 -3
- package/lib/components/ToggleGroup/subcomponents/{Item.tsx → ToggleGroupItem.tsx} +126 -52
- package/lib/components/ToggleGroup/subcomponents/__tests__/{Item.test.tsx → ToggleGroupItem.test.tsx} +50 -6
- package/lib/components/index.ts +1 -1
- package/package.json +1 -1
- package/dist/components/ToggleGroup/subcomponents/Item.d.ts +0 -11
- /package/dist/components/ToggleGroup/subcomponents/__tests__/{Item.test.d.ts → ToggleGroupItem.test.d.ts} +0 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { NonClearableSelectProps } from '../Select';
|
|
3
|
-
import {
|
|
3
|
+
import { ToggleGroupItemProps } from './subcomponents/ToggleGroupItem';
|
|
4
|
+
export declare const NAME = "ucl-uikit-toggle-group";
|
|
4
5
|
export interface ToggleGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
6
|
children: React.ReactNode;
|
|
6
7
|
value?: string;
|
|
7
8
|
defaultValue?: string;
|
|
8
9
|
onValueChange?: (value: string) => void;
|
|
10
|
+
testId?: string;
|
|
9
11
|
selectProps?: Omit<NonClearableSelectProps<string>, 'options' | 'value' | 'onValueChange'>;
|
|
10
12
|
}
|
|
11
13
|
declare const ToggleGroup: {
|
|
12
|
-
({ children, value, defaultValue, onValueChange, selectProps, }: ToggleGroupProps): React.JSX.Element;
|
|
13
|
-
Item: ({ value, label, sublabel, icon, disabled, }:
|
|
14
|
+
({ children, value, defaultValue, onValueChange, selectProps, className, onKeyDown, testId, ...htmlAttributes }: ToggleGroupProps): React.JSX.Element;
|
|
15
|
+
Item: ({ value, label, sublabel, icon, disabled, className, onChange, testId, ...inputProps }: ToggleGroupItemProps) => React.JSX.Element;
|
|
14
16
|
};
|
|
15
17
|
export default ToggleGroup;
|
|
@@ -2,8 +2,8 @@ import { StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: {
|
|
5
|
-
({ children, value, defaultValue, onValueChange, selectProps, }: import('./ToggleGroup').ToggleGroupProps): import("react").JSX.Element;
|
|
6
|
-
Item: ({ value, label, sublabel, icon, disabled, }: import('.').
|
|
5
|
+
({ children, value, defaultValue, onValueChange, selectProps, className, onKeyDown, testId, ...htmlAttributes }: import('./ToggleGroup').ToggleGroupProps): import("react").JSX.Element;
|
|
6
|
+
Item: ({ value, label, sublabel, icon, disabled, className, onChange, testId, ...inputProps }: import('.').ToggleGroupItemProps) => import("react").JSX.Element;
|
|
7
7
|
};
|
|
8
8
|
parameters: {
|
|
9
9
|
layout: string;
|
|
@@ -2,6 +2,8 @@ export interface ToggleGroupContextType {
|
|
|
2
2
|
value: string | undefined;
|
|
3
3
|
setValue: (value: string) => void;
|
|
4
4
|
name: string;
|
|
5
|
+
tabbableValue: string | undefined;
|
|
6
|
+
hasSublabel: boolean;
|
|
5
7
|
}
|
|
6
8
|
declare const ToggleGroupContext: import('react').Context<ToggleGroupContextType | undefined>;
|
|
7
9
|
export declare const useToggleGroupContext: () => ToggleGroupContextType;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { default } from './ToggleGroup';
|
|
2
2
|
export type { ToggleGroupProps } from './ToggleGroup';
|
|
3
|
-
export {
|
|
4
|
-
export type { ItemProps } from './subcomponents/Item';
|
|
3
|
+
export type { ToggleGroupItemProps } from './subcomponents/ToggleGroupItem';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SpecificIconsType } from '../../Icon/Icon';
|
|
3
|
+
export declare const NAME = "ucl-uikit-toggle-group__item";
|
|
4
|
+
export interface ToggleGroupItemProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon?: keyof SpecificIconsType;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
sublabel?: string;
|
|
10
|
+
testId?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const ToggleGroupItem: ({ value, label, sublabel, icon, disabled, className, onChange, testId, ...inputProps }: ToggleGroupItemProps) => React.JSX.Element;
|
|
13
|
+
export default ToggleGroupItem;
|
package/dist/components/ToggleGroup/subcomponents/{Item.stories.d.ts → ToggleGroupItem.stories.d.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react-vite';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: ({ value, label, sublabel, icon, disabled, }: import('./
|
|
4
|
+
component: ({ value, label, sublabel, icon, disabled, className, onChange, testId, ...inputProps }: import('./ToggleGroupItem').ToggleGroupItemProps) => import("react").JSX.Element;
|
|
5
5
|
parameters: {
|
|
6
6
|
layout: string;
|
|
7
7
|
};
|
|
@@ -12,6 +12,7 @@ declare const meta: {
|
|
|
12
12
|
icon?: keyof import('../../Icon/Icon').SpecificIconsType | undefined;
|
|
13
13
|
disabled?: boolean | undefined;
|
|
14
14
|
sublabel?: string | undefined;
|
|
15
|
+
testId?: string | undefined;
|
|
15
16
|
accept?: string | undefined | undefined;
|
|
16
17
|
alt?: string | undefined | undefined;
|
|
17
18
|
autoComplete?: import('react').HTMLInputAutoCompleteAttribute | undefined;
|
|
@@ -77,7 +77,7 @@ export type { CheckboxProps, LabelledCheckboxProps } from './Checkbox';
|
|
|
77
77
|
export { default as Toggle } from './Toggle';
|
|
78
78
|
export type { ToggleProps } from './Toggle';
|
|
79
79
|
export { default as ToggleGroup } from './ToggleGroup';
|
|
80
|
-
export type {
|
|
80
|
+
export type { ToggleGroupItemProps, ToggleGroupProps } from './ToggleGroup';
|
|
81
81
|
export { default as Chip } from './Chip';
|
|
82
82
|
export type { ChipProps } from './Chip';
|
|
83
83
|
export { default as AppMenu } from './AppMenu';
|