@staffbase/design 20.4.0 → 21.0.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/codemods/v21-migrate-toggle/README.md +52 -0
- package/codemods/v21-migrate-toggle/transform.js +99 -0
- package/dist/components.css +1 -1
- package/dist/main.cjs +128 -146
- package/dist/main.cjs.map +1 -1
- package/dist/main.d.ts +64 -106
- package/dist/main.js +128 -144
- package/dist/main.js.map +1 -1
- package/dist/theme.css +1 -1
- package/dist/tokens/primitive.css +1 -13
- package/package.json +5 -7
package/dist/main.d.ts
CHANGED
|
@@ -16,7 +16,6 @@ import { Combobox } from '@base-ui/react/combobox';
|
|
|
16
16
|
import { ComboboxChipProps } from '@base-ui/react';
|
|
17
17
|
import { ComboboxItemProps } from '@base-ui/react';
|
|
18
18
|
import { ComponentProps } from 'react';
|
|
19
|
-
import { ComponentPropsWithoutRef } from 'react';
|
|
20
19
|
import { ContextMenuGroupLabelProps } from '@base-ui/react';
|
|
21
20
|
import { ContextMenuGroupProps } from '@base-ui/react';
|
|
22
21
|
import { ContextMenuRadioGroupProps } from '@base-ui/react';
|
|
@@ -28,7 +27,6 @@ import { Drawer } from '@base-ui/react/drawer';
|
|
|
28
27
|
import { DrawerDescriptionProps } from '@base-ui/react';
|
|
29
28
|
import { DrawerTitleProps } from '@base-ui/react';
|
|
30
29
|
import { DropzoneOptions } from 'react-dropzone';
|
|
31
|
-
import { FC } from 'react';
|
|
32
30
|
import { FieldDescriptionProps } from '@base-ui/react';
|
|
33
31
|
import { FieldErrorProps } from '@base-ui/react';
|
|
34
32
|
import { FieldLabelProps } from '@base-ui/react';
|
|
@@ -50,9 +48,10 @@ import { NumberFieldIncrementProps } from '@base-ui/react';
|
|
|
50
48
|
import { NumberFieldInputProps } from '@base-ui/react';
|
|
51
49
|
import { NumberFieldRootProps } from '@base-ui/react';
|
|
52
50
|
import { Placement } from '@floating-ui/react';
|
|
51
|
+
import { Popover as Popover_2 } from '@base-ui/react';
|
|
52
|
+
import { PopoverCloseProps } from '@base-ui/react';
|
|
53
53
|
import { Radio as Radio_2 } from '@base-ui/react/radio';
|
|
54
54
|
import { RadioGroup as RadioGroup_2 } from '@base-ui/react/radio-group';
|
|
55
|
-
import * as RadixPopover from '@radix-ui/react-popover';
|
|
56
55
|
import * as RadixTabs from '@radix-ui/react-tabs';
|
|
57
56
|
import { ReactElement } from 'react';
|
|
58
57
|
import { ReactNode } from 'react';
|
|
@@ -70,6 +69,8 @@ import { SeparatorProps } from '@base-ui/react';
|
|
|
70
69
|
import { SVGAttributes } from 'react';
|
|
71
70
|
import { SwitchRootProps } from '@base-ui/react';
|
|
72
71
|
import { TextareaHTMLAttributes } from 'react';
|
|
72
|
+
import { Toggle as Toggle_2 } from '@base-ui/react/toggle';
|
|
73
|
+
import { ToggleGroup as ToggleGroup_2 } from '@base-ui/react/toggle-group';
|
|
73
74
|
import { Tooltip as Tooltip_2 } from '@base-ui/react/tooltip';
|
|
74
75
|
import { UseFloatingReturn } from '@floating-ui/react';
|
|
75
76
|
import { UseInteractionsReturn } from '@floating-ui/react';
|
|
@@ -357,17 +358,6 @@ declare interface BaseFilterProps extends Pick<FilterOptions, 'placement'> {
|
|
|
357
358
|
triggerClassname?: string;
|
|
358
359
|
}
|
|
359
360
|
|
|
360
|
-
declare interface BaseGhostButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
361
|
-
/**
|
|
362
|
-
* The colors of the component
|
|
363
|
-
*/
|
|
364
|
-
variant?: GhostButtonVariant;
|
|
365
|
-
/**
|
|
366
|
-
* "leading" refers to the start position, whereas "trailing" refers to the end position of the icon
|
|
367
|
-
*/
|
|
368
|
-
iconPosition?: GhostButtonIconPosition;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
361
|
declare interface BaseOption {
|
|
372
362
|
id: string;
|
|
373
363
|
}
|
|
@@ -562,10 +552,6 @@ export declare const CommentIcon: default_2.NamedExoticComponent<default_2.SVGAt
|
|
|
562
552
|
|
|
563
553
|
export declare const ConnectionOffIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
564
554
|
|
|
565
|
-
declare interface ContentProps extends ComponentPropsWithoutRef<typeof RadixPopover.Content> {
|
|
566
|
-
container?: ComponentProps<typeof RadixPopover.Portal>['container'];
|
|
567
|
-
}
|
|
568
|
-
|
|
569
555
|
export declare const CopyIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
570
556
|
|
|
571
557
|
export declare const CropIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
@@ -836,29 +822,6 @@ export declare const FootballIcon: default_2.NamedExoticComponent<default_2.SVGA
|
|
|
836
822
|
|
|
837
823
|
export declare const GalleryIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
838
824
|
|
|
839
|
-
/** @deprecated Use Button with variant="ghost" instead */
|
|
840
|
-
export declare const GhostButton: ForwardRefExoticComponent<GhostButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
841
|
-
|
|
842
|
-
declare type GhostButtonIconPosition = 'leading' | 'trailing';
|
|
843
|
-
|
|
844
|
-
/** @deprecated Use Button with variant="ghost" instead */
|
|
845
|
-
export declare interface GhostButtonProps extends BaseGhostButtonProps {
|
|
846
|
-
/**
|
|
847
|
-
* Refers to the child element of the ghost button
|
|
848
|
-
*/
|
|
849
|
-
children?: string;
|
|
850
|
-
/**
|
|
851
|
-
* Disabled state of the ghost button
|
|
852
|
-
*/
|
|
853
|
-
disabled?: boolean;
|
|
854
|
-
/**
|
|
855
|
-
* The icon of the button
|
|
856
|
-
*/
|
|
857
|
-
icon?: ReactElement<SVGAttributes<SVGElement>>;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
declare type GhostButtonVariant = 'primary' | 'secondary' | 'critical';
|
|
861
|
-
|
|
862
825
|
export declare const GlobeIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
863
826
|
|
|
864
827
|
export declare const GridIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
@@ -928,22 +891,6 @@ export declare const HouseIcon: default_2.NamedExoticComponent<default_2.SVGAttr
|
|
|
928
891
|
|
|
929
892
|
export declare const Icon: ({ name, ...props }: IconProps) => ReactElement | null;
|
|
930
893
|
|
|
931
|
-
/** @deprecated Use Button component with iconOnly instead */
|
|
932
|
-
export declare const IconButton: ForwardRefExoticComponent<IconButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
933
|
-
|
|
934
|
-
/** @deprecated Use Button component with iconOnly instead */
|
|
935
|
-
export declare interface IconButtonProps extends Omit<BaseButtonProps, 'children'> {
|
|
936
|
-
icon: ReactElement<SVGAttributes<SVGElement>>;
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
/** @deprecated Use Button with variant="ghost" and iconOnly instead */
|
|
940
|
-
export declare const IconGhostButton: ForwardRefExoticComponent<IconGhostButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
941
|
-
|
|
942
|
-
/** @deprecated Use Button with variant="ghost" and iconOnly instead */
|
|
943
|
-
export declare interface IconGhostButtonProps extends Omit<BaseGhostButtonProps, 'children'> {
|
|
944
|
-
icon: ReactElement<SVGAttributes<SVGElement>>;
|
|
945
|
-
}
|
|
946
|
-
|
|
947
894
|
declare const iconList: {
|
|
948
895
|
readonly add: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
949
896
|
readonly 'add-circle': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
@@ -1612,15 +1559,18 @@ export declare const PluginThirdPartyIcon: default_2.NamedExoticComponent<defaul
|
|
|
1612
1559
|
export declare const PollIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
1613
1560
|
|
|
1614
1561
|
export declare const Popover: {
|
|
1615
|
-
Root:
|
|
1616
|
-
Content: ForwardRefExoticComponent<
|
|
1617
|
-
Trigger:
|
|
1618
|
-
Close: ForwardRefExoticComponent<PopoverCloseProps & RefAttributes<HTMLButtonElement>>;
|
|
1619
|
-
Anchor: ForwardRefExoticComponent<RadixPopover.PopoverAnchorProps & RefAttributes<HTMLDivElement>>;
|
|
1562
|
+
Root: typeof Popover_2.Root;
|
|
1563
|
+
Content: ForwardRefExoticComponent<Omit<PopoverContentProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
1564
|
+
Trigger: (props: PopoverTriggerProps) => JSX.Element;
|
|
1565
|
+
Close: ForwardRefExoticComponent<Omit< PopoverCloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
1620
1566
|
};
|
|
1621
1567
|
|
|
1622
|
-
|
|
1623
|
-
|
|
1568
|
+
declare interface PopoverContentProps extends Popover_2.Positioner.Props {
|
|
1569
|
+
container?: Popover_2.Portal.Props['container'];
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
declare interface PopoverTriggerProps extends Omit<Popover_2.Trigger.Props, 'children'> {
|
|
1573
|
+
children: Popover_2.Trigger.Props['render'];
|
|
1624
1574
|
}
|
|
1625
1575
|
|
|
1626
1576
|
declare interface PopupProps extends AlertDialog_2.Popup.Props, Pick<AlertDialog_2.Portal.Props, 'container'> {
|
|
@@ -2025,6 +1975,52 @@ declare interface SubMenuTriggerProps extends Menu_2.SubmenuTrigger.Props {
|
|
|
2025
1975
|
|
|
2026
1976
|
export declare const Switch: ForwardRefExoticComponent<Omit< SwitchRootProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
2027
1977
|
|
|
1978
|
+
/** @deprecated Use Switch component instead */
|
|
1979
|
+
export declare function SwitchDeprecated(props: SwitchDeprecatedProps): ReactElement;
|
|
1980
|
+
|
|
1981
|
+
export declare namespace SwitchDeprecated {
|
|
1982
|
+
var displayName: string;
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
export declare interface SwitchDeprecatedProps {
|
|
1986
|
+
/**
|
|
1987
|
+
* Refers to the checked state of the toggle
|
|
1988
|
+
*/
|
|
1989
|
+
checked?: boolean;
|
|
1990
|
+
/**
|
|
1991
|
+
* Disables the toggle, label and optional description
|
|
1992
|
+
*/
|
|
1993
|
+
disabled?: boolean;
|
|
1994
|
+
/**
|
|
1995
|
+
* Optional description below the label
|
|
1996
|
+
*/
|
|
1997
|
+
description?: string;
|
|
1998
|
+
/**
|
|
1999
|
+
* Required label of the toggle
|
|
2000
|
+
*/
|
|
2001
|
+
label: string;
|
|
2002
|
+
/**
|
|
2003
|
+
* Sets or returns the value of the name attribute
|
|
2004
|
+
*/
|
|
2005
|
+
name: string;
|
|
2006
|
+
/**
|
|
2007
|
+
* The event when the value of the toggle has been changed
|
|
2008
|
+
*/
|
|
2009
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
2010
|
+
/**
|
|
2011
|
+
* The reference object of the toggle
|
|
2012
|
+
*/
|
|
2013
|
+
ref?: RefObject<HTMLInputElement>;
|
|
2014
|
+
/**
|
|
2015
|
+
* Refers to space between the label and toggle and if true, it takes position to the end of the container
|
|
2016
|
+
*/
|
|
2017
|
+
spaceBetween?: boolean;
|
|
2018
|
+
/**
|
|
2019
|
+
* Optional classname prop for styling
|
|
2020
|
+
*/
|
|
2021
|
+
className?: string;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2028
2024
|
export declare const TabletIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
2029
2025
|
|
|
2030
2026
|
export declare const Tabs: {
|
|
@@ -2144,50 +2140,12 @@ export declare const ThumbUpAltIcon: default_2.NamedExoticComponent<default_2.SV
|
|
|
2144
2140
|
|
|
2145
2141
|
export declare const ThumbUpIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
2146
2142
|
|
|
2147
|
-
|
|
2148
|
-
export declare function Toggle(props: ToggleProps): ReactElement;
|
|
2143
|
+
export declare const Toggle: ForwardRefExoticComponent<Omit<Toggle_2.Props<string>, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
2149
2144
|
|
|
2150
|
-
export declare
|
|
2151
|
-
var displayName: string;
|
|
2152
|
-
}
|
|
2145
|
+
export declare const ToggleGroup: ForwardRefExoticComponent<Omit<ToggleGroupProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
2153
2146
|
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
* Refers to the checked state of the toggle
|
|
2157
|
-
*/
|
|
2158
|
-
checked?: boolean;
|
|
2159
|
-
/**
|
|
2160
|
-
* Disables the toggle, label and optional description
|
|
2161
|
-
*/
|
|
2162
|
-
disabled?: boolean;
|
|
2163
|
-
/**
|
|
2164
|
-
* Optional description below the label
|
|
2165
|
-
*/
|
|
2166
|
-
description?: string;
|
|
2167
|
-
/**
|
|
2168
|
-
* Required label of the toggle
|
|
2169
|
-
*/
|
|
2170
|
-
label: string;
|
|
2171
|
-
/**
|
|
2172
|
-
* Sets or returns the value of the name attribute
|
|
2173
|
-
*/
|
|
2174
|
-
name: string;
|
|
2175
|
-
/**
|
|
2176
|
-
* The event when the value of the toggle has been changed
|
|
2177
|
-
*/
|
|
2178
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
2179
|
-
/**
|
|
2180
|
-
* The reference object of the toggle
|
|
2181
|
-
*/
|
|
2182
|
-
ref?: RefObject<HTMLInputElement>;
|
|
2183
|
-
/**
|
|
2184
|
-
* Refers to space between the label and toggle and if true, it takes position to the end of the container
|
|
2185
|
-
*/
|
|
2186
|
-
spaceBetween?: boolean;
|
|
2187
|
-
/**
|
|
2188
|
-
* Optional classname prop for styling
|
|
2189
|
-
*/
|
|
2190
|
-
className?: string;
|
|
2147
|
+
declare interface ToggleGroupProps extends ToggleGroup_2.Props {
|
|
2148
|
+
'aria-label': string;
|
|
2191
2149
|
}
|
|
2192
2150
|
|
|
2193
2151
|
export declare const Tooltip: {
|