@staffbase/design 20.4.0 → 21.2.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 +137 -157
- package/dist/main.cjs.map +1 -1
- package/dist/main.d.ts +72 -111
- package/dist/main.js +137 -154
- package/dist/main.js.map +1 -1
- package/dist/theme.css +4 -1
- package/dist/tokens/component.css +4 -3
- package/dist/tokens/primitive.css +9 -16
- package/dist/tokens/semantic.css +50 -46
- package/package.json +6 -8
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,10 +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
|
-
import * as RadixTabs from '@radix-ui/react-tabs';
|
|
57
55
|
import { ReactElement } from 'react';
|
|
58
56
|
import { ReactNode } from 'react';
|
|
59
57
|
import { Ref } from 'react';
|
|
@@ -69,7 +67,13 @@ import { SelectValueProps } from '@base-ui/react';
|
|
|
69
67
|
import { SeparatorProps } from '@base-ui/react';
|
|
70
68
|
import { SVGAttributes } from 'react';
|
|
71
69
|
import { SwitchRootProps } from '@base-ui/react';
|
|
70
|
+
import { TabsListProps } from '@base-ui/react';
|
|
71
|
+
import { TabsPanelProps } from '@base-ui/react';
|
|
72
|
+
import { TabsRootProps } from '@base-ui/react';
|
|
73
|
+
import { TabsTabProps } from '@base-ui/react';
|
|
72
74
|
import { TextareaHTMLAttributes } from 'react';
|
|
75
|
+
import { Toggle as Toggle_2 } from '@base-ui/react/toggle';
|
|
76
|
+
import { ToggleGroup as ToggleGroup_2 } from '@base-ui/react/toggle-group';
|
|
73
77
|
import { Tooltip as Tooltip_2 } from '@base-ui/react/tooltip';
|
|
74
78
|
import { UseFloatingReturn } from '@floating-ui/react';
|
|
75
79
|
import { UseInteractionsReturn } from '@floating-ui/react';
|
|
@@ -357,17 +361,6 @@ declare interface BaseFilterProps extends Pick<FilterOptions, 'placement'> {
|
|
|
357
361
|
triggerClassname?: string;
|
|
358
362
|
}
|
|
359
363
|
|
|
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
364
|
declare interface BaseOption {
|
|
372
365
|
id: string;
|
|
373
366
|
}
|
|
@@ -562,10 +555,6 @@ export declare const CommentIcon: default_2.NamedExoticComponent<default_2.SVGAt
|
|
|
562
555
|
|
|
563
556
|
export declare const ConnectionOffIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
564
557
|
|
|
565
|
-
declare interface ContentProps extends ComponentPropsWithoutRef<typeof RadixPopover.Content> {
|
|
566
|
-
container?: ComponentProps<typeof RadixPopover.Portal>['container'];
|
|
567
|
-
}
|
|
568
|
-
|
|
569
558
|
export declare const CopyIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
570
559
|
|
|
571
560
|
export declare const CropIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
@@ -836,29 +825,6 @@ export declare const FootballIcon: default_2.NamedExoticComponent<default_2.SVGA
|
|
|
836
825
|
|
|
837
826
|
export declare const GalleryIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
838
827
|
|
|
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
828
|
export declare const GlobeIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
863
829
|
|
|
864
830
|
export declare const GridIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
@@ -928,22 +894,6 @@ export declare const HouseIcon: default_2.NamedExoticComponent<default_2.SVGAttr
|
|
|
928
894
|
|
|
929
895
|
export declare const Icon: ({ name, ...props }: IconProps) => ReactElement | null;
|
|
930
896
|
|
|
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
897
|
declare const iconList: {
|
|
948
898
|
readonly add: NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
949
899
|
readonly 'add-circle': NamedExoticComponent< SVGAttributes<SVGSVGElement> & RefAttributes<SVGSVGElement>>;
|
|
@@ -1612,15 +1562,18 @@ export declare const PluginThirdPartyIcon: default_2.NamedExoticComponent<defaul
|
|
|
1612
1562
|
export declare const PollIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
1613
1563
|
|
|
1614
1564
|
export declare const Popover: {
|
|
1615
|
-
Root:
|
|
1616
|
-
Content: ForwardRefExoticComponent<
|
|
1617
|
-
Trigger:
|
|
1618
|
-
Close: ForwardRefExoticComponent<PopoverCloseProps & RefAttributes<HTMLButtonElement>>;
|
|
1619
|
-
Anchor: ForwardRefExoticComponent<RadixPopover.PopoverAnchorProps & RefAttributes<HTMLDivElement>>;
|
|
1565
|
+
Root: typeof Popover_2.Root;
|
|
1566
|
+
Content: ForwardRefExoticComponent<Omit<PopoverContentProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
1567
|
+
Trigger: (props: PopoverTriggerProps) => JSX.Element;
|
|
1568
|
+
Close: ForwardRefExoticComponent<Omit< PopoverCloseProps, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
1620
1569
|
};
|
|
1621
1570
|
|
|
1622
|
-
|
|
1623
|
-
|
|
1571
|
+
declare interface PopoverContentProps extends Popover_2.Positioner.Props {
|
|
1572
|
+
container?: Popover_2.Portal.Props['container'];
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
declare interface PopoverTriggerProps extends Omit<Popover_2.Trigger.Props, 'children'> {
|
|
1576
|
+
children: Popover_2.Trigger.Props['render'];
|
|
1624
1577
|
}
|
|
1625
1578
|
|
|
1626
1579
|
declare interface PopupProps extends AlertDialog_2.Popup.Props, Pick<AlertDialog_2.Portal.Props, 'container'> {
|
|
@@ -2025,13 +1978,59 @@ declare interface SubMenuTriggerProps extends Menu_2.SubmenuTrigger.Props {
|
|
|
2025
1978
|
|
|
2026
1979
|
export declare const Switch: ForwardRefExoticComponent<Omit< SwitchRootProps, "ref"> & RefAttributes<HTMLElement>>;
|
|
2027
1980
|
|
|
1981
|
+
/** @deprecated Use Switch component instead */
|
|
1982
|
+
export declare function SwitchDeprecated(props: SwitchDeprecatedProps): ReactElement;
|
|
1983
|
+
|
|
1984
|
+
export declare namespace SwitchDeprecated {
|
|
1985
|
+
var displayName: string;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
export declare interface SwitchDeprecatedProps {
|
|
1989
|
+
/**
|
|
1990
|
+
* Refers to the checked state of the toggle
|
|
1991
|
+
*/
|
|
1992
|
+
checked?: boolean;
|
|
1993
|
+
/**
|
|
1994
|
+
* Disables the toggle, label and optional description
|
|
1995
|
+
*/
|
|
1996
|
+
disabled?: boolean;
|
|
1997
|
+
/**
|
|
1998
|
+
* Optional description below the label
|
|
1999
|
+
*/
|
|
2000
|
+
description?: string;
|
|
2001
|
+
/**
|
|
2002
|
+
* Required label of the toggle
|
|
2003
|
+
*/
|
|
2004
|
+
label: string;
|
|
2005
|
+
/**
|
|
2006
|
+
* Sets or returns the value of the name attribute
|
|
2007
|
+
*/
|
|
2008
|
+
name: string;
|
|
2009
|
+
/**
|
|
2010
|
+
* The event when the value of the toggle has been changed
|
|
2011
|
+
*/
|
|
2012
|
+
onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
2013
|
+
/**
|
|
2014
|
+
* The reference object of the toggle
|
|
2015
|
+
*/
|
|
2016
|
+
ref?: RefObject<HTMLInputElement>;
|
|
2017
|
+
/**
|
|
2018
|
+
* Refers to space between the label and toggle and if true, it takes position to the end of the container
|
|
2019
|
+
*/
|
|
2020
|
+
spaceBetween?: boolean;
|
|
2021
|
+
/**
|
|
2022
|
+
* Optional classname prop for styling
|
|
2023
|
+
*/
|
|
2024
|
+
className?: string;
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2028
2027
|
export declare const TabletIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
2029
2028
|
|
|
2030
2029
|
export declare const Tabs: {
|
|
2031
|
-
Root: ForwardRefExoticComponent<Omit<
|
|
2032
|
-
List: ForwardRefExoticComponent<Omit<
|
|
2033
|
-
Trigger: ForwardRefExoticComponent<Omit<
|
|
2034
|
-
Content: ForwardRefExoticComponent<Omit<
|
|
2030
|
+
Root: ForwardRefExoticComponent<Omit<Omit< TabsRootProps, "ref"> & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
2031
|
+
List: ForwardRefExoticComponent<Omit<Omit< TabsListProps, "ref"> & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
2032
|
+
Trigger: ForwardRefExoticComponent<Omit<Omit< TabsTabProps, "ref"> & RefAttributes<HTMLElement>, "ref"> & RefAttributes<HTMLElement>>;
|
|
2033
|
+
Content: ForwardRefExoticComponent<Omit<Omit< TabsPanelProps, "ref"> & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
2035
2034
|
};
|
|
2036
2035
|
|
|
2037
2036
|
export declare const TagIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
@@ -2144,50 +2143,12 @@ export declare const ThumbUpAltIcon: default_2.NamedExoticComponent<default_2.SV
|
|
|
2144
2143
|
|
|
2145
2144
|
export declare const ThumbUpIcon: default_2.NamedExoticComponent<default_2.SVGAttributes<SVGSVGElement> & default_2.RefAttributes<SVGSVGElement>>;
|
|
2146
2145
|
|
|
2147
|
-
|
|
2148
|
-
export declare function Toggle(props: ToggleProps): ReactElement;
|
|
2146
|
+
export declare const Toggle: ForwardRefExoticComponent<Omit<Toggle_2.Props<string>, "ref"> & RefAttributes<HTMLButtonElement>>;
|
|
2149
2147
|
|
|
2150
|
-
export declare
|
|
2151
|
-
var displayName: string;
|
|
2152
|
-
}
|
|
2148
|
+
export declare const ToggleGroup: ForwardRefExoticComponent<Omit<ToggleGroupProps, "ref"> & RefAttributes<HTMLDivElement>>;
|
|
2153
2149
|
|
|
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;
|
|
2150
|
+
declare interface ToggleGroupProps extends ToggleGroup_2.Props {
|
|
2151
|
+
'aria-label': string;
|
|
2191
2152
|
}
|
|
2192
2153
|
|
|
2193
2154
|
export declare const Tooltip: {
|