@staffbase/design 20.3.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 +168 -146
- package/dist/main.cjs.map +1 -1
- package/dist/main.d.ts +67 -106
- package/dist/main.js +167 -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>>;
|
|
@@ -1154,6 +1101,7 @@ declare const iconList: {
|
|
|
1154
1101
|
readonly 'rounded-corners': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
1155
1102
|
readonly rss: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
1156
1103
|
readonly search: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
1104
|
+
readonly slideshow: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
1157
1105
|
readonly send: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
1158
1106
|
readonly settings: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
1159
1107
|
readonly 'share-android': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
@@ -1611,15 +1559,18 @@ export declare const PluginThirdPartyIcon: default_2.NamedExoticComponent<defaul
|
|
|
1611
1559
|
export declare const PollIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
1612
1560
|
|
|
1613
1561
|
export declare const Popover: {
|
|
1614
|
-
Root:
|
|
1615
|
-
Content: ForwardRefExoticComponent<
|
|
1616
|
-
Trigger:
|
|
1617
|
-
Close: ForwardRefExoticComponent<PopoverCloseProps & RefAttributes<HTMLButtonElement>>;
|
|
1618
|
-
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>>;
|
|
1619
1566
|
};
|
|
1620
1567
|
|
|
1621
|
-
|
|
1622
|
-
|
|
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'];
|
|
1623
1574
|
}
|
|
1624
1575
|
|
|
1625
1576
|
declare interface PopupProps extends AlertDialog_2.Popup.Props, Pick<AlertDialog_2.Portal.Props, 'container'> {
|
|
@@ -1996,6 +1947,8 @@ export declare const Skeleton: {
|
|
|
1996
1947
|
|
|
1997
1948
|
export declare const SliderQuestionIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
1998
1949
|
|
|
1950
|
+
export declare const SlideshowIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
1951
|
+
|
|
1999
1952
|
export declare const SnowflakeIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
2000
1953
|
|
|
2001
1954
|
export declare const SortIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
@@ -2022,6 +1975,52 @@ declare interface SubMenuTriggerProps extends Menu_2.SubmenuTrigger.Props {
|
|
|
2022
1975
|
|
|
2023
1976
|
export declare const Switch: ForwardRefExoticComponent<Omit< SwitchRootProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
2024
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
|
+
|
|
2025
2024
|
export declare const TabletIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
2026
2025
|
|
|
2027
2026
|
export declare const Tabs: {
|
|
@@ -2141,50 +2140,12 @@ export declare const ThumbUpAltIcon: default_2.NamedExoticComponent<default_2.SV
|
|
|
2141
2140
|
|
|
2142
2141
|
export declare const ThumbUpIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
2143
2142
|
|
|
2144
|
-
|
|
2145
|
-
export declare function Toggle(props: ToggleProps): ReactElement;
|
|
2143
|
+
export declare const Toggle: ForwardRefExoticComponent<Omit<Toggle_2.Props<string>, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
2146
2144
|
|
|
2147
|
-
export declare
|
|
2148
|
-
var displayName: string;
|
|
2149
|
-
}
|
|
2145
|
+
export declare const ToggleGroup: ForwardRefExoticComponent<Omit<ToggleGroupProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
2150
2146
|
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
* Refers to the checked state of the toggle
|
|
2154
|
-
*/
|
|
2155
|
-
checked?: boolean;
|
|
2156
|
-
/**
|
|
2157
|
-
* Disables the toggle, label and optional description
|
|
2158
|
-
*/
|
|
2159
|
-
disabled?: boolean;
|
|
2160
|
-
/**
|
|
2161
|
-
* Optional description below the label
|
|
2162
|
-
*/
|
|
2163
|
-
description?: string;
|
|
2164
|
-
/**
|
|
2165
|
-
* Required label of the toggle
|
|
2166
|
-
*/
|
|
2167
|
-
label: string;
|
|
2168
|
-
/**
|
|
2169
|
-
* Sets or returns the value of the name attribute
|
|
2170
|
-
*/
|
|
2171
|
-
name: string;
|
|
2172
|
-
/**
|
|
2173
|
-
* The event when the value of the toggle has been changed
|
|
2174
|
-
*/
|
|
2175
|
-
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
2176
|
-
/**
|
|
2177
|
-
* The reference object of the toggle
|
|
2178
|
-
*/
|
|
2179
|
-
ref?: RefObject<HTMLInputElement>;
|
|
2180
|
-
/**
|
|
2181
|
-
* Refers to space between the label and toggle and if true, it takes position to the end of the container
|
|
2182
|
-
*/
|
|
2183
|
-
spaceBetween?: boolean;
|
|
2184
|
-
/**
|
|
2185
|
-
* Optional classname prop for styling
|
|
2186
|
-
*/
|
|
2187
|
-
className?: string;
|
|
2147
|
+
declare interface ToggleGroupProps extends ToggleGroup_2.Props {
|
|
2148
|
+
'aria-label': string;
|
|
2188
2149
|
}
|
|
2189
2150
|
|
|
2190
2151
|
export declare const Tooltip: {
|