@juspay/blend-design-system 0.0.24 → 0.0.25-beta
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/Breadcrumb/types.d.ts +6 -0
- package/dist/components/Button/button.tokens.d.ts +4 -1
- package/dist/components/Checkbox/checkbox.animations.d.ts +2 -0
- package/dist/components/DataTable/types.d.ts +23 -6
- package/dist/components/DateRangePicker/TimeSelector.d.ts +0 -2
- package/dist/components/DateRangePicker/dateRangePicker.tokens.d.ts +7 -19
- package/dist/components/Directory/types.d.ts +5 -0
- package/dist/components/Menu/menu.animations.d.ts +8 -0
- package/dist/components/Modal/modal.animations.d.ts +3 -0
- package/dist/components/Modal/modal.utils.d.ts +2 -0
- package/dist/components/Modal/useModal.d.ts +5 -0
- package/dist/components/MultiSelect/multiSelect.animations.d.ts +12 -0
- package/dist/components/Popover/popover.animations.d.ts +1 -0
- package/dist/components/Primitives/PrimitiveInput/PrimitiveInput.d.ts +5 -0
- package/dist/components/Primitives/PrimitiveTextArea.d.ts +5 -0
- package/dist/components/Radio/radio.animations.d.ts +1 -0
- package/dist/components/Sidebar/SidebarMobile/MobileNavigationItem.d.ts +11 -0
- package/dist/components/Sidebar/SidebarMobile/MoreButton.d.ts +7 -0
- package/dist/components/Sidebar/SidebarMobile/PrimaryActionButton.d.ts +8 -0
- package/dist/components/Sidebar/SidebarMobile/hooks.d.ts +24 -0
- package/dist/components/Sidebar/SidebarMobile/index.d.ts +3 -0
- package/dist/components/Sidebar/SidebarMobile/mobile.tokens.d.ts +81 -0
- package/dist/components/Sidebar/SidebarMobile/utils.d.ts +29 -0
- package/dist/components/Sidebar/types.d.ts +35 -1
- package/dist/components/Sidebar/utils.d.ts +39 -1
- package/dist/components/SingleSelect/singleSelect.animations.d.ts +3 -0
- package/dist/components/StatCard/statcard.tokens.d.ts +1 -1
- package/dist/components/Switch/switch.animations.d.ts +2 -0
- package/dist/components/Tags/Tags.d.ts +12 -0
- package/dist/components/Tags/tag.tokens.d.ts +2 -1
- package/dist/components/Tooltip/tooltip.animations.d.ts +1 -0
- package/dist/components/Topbar/types.d.ts +7 -0
- package/dist/components/animations/ChevronAnimation/ChevronAnimation.d.ts +3 -0
- package/dist/components/animations/ChevronAnimation/index.d.ts +3 -0
- package/dist/components/animations/ChevronAnimation/types.d.ts +28 -0
- package/dist/components/animations/ChevronAnimation/utils.d.ts +3 -0
- package/dist/components/animations/Ripple/RippleContainer.d.ts +7 -0
- package/dist/components/animations/Ripple/index.d.ts +2 -0
- package/dist/components/common/error.animations.d.ts +4 -0
- package/dist/components/common/index.d.ts +2 -0
- package/dist/components/common/useErrorShake.d.ts +6 -0
- package/dist/context/ThemeContext.d.ts +4 -0
- package/dist/context/ThemeProvider.d.ts +6 -1
- package/dist/context/index.d.ts +1 -1
- package/dist/context/initComponentTokens.d.ts +2 -1
- package/dist/context/useComponentToken.d.ts +2 -1
- package/dist/hooks/useRipple.d.ts +11 -0
- package/dist/main.js +25896 -23386
- package/package.json +2 -2
|
@@ -3,4 +3,10 @@ export type BreadcrumbItemType = {
|
|
|
3
3
|
rightSlot?: React.ReactNode;
|
|
4
4
|
label: string;
|
|
5
5
|
href: string;
|
|
6
|
+
/**
|
|
7
|
+
* Optional click handler for custom routing (e.g., React Router).
|
|
8
|
+
* When provided, prevents default link behavior and calls this handler instead.
|
|
9
|
+
* Use this to avoid page reloads and handle navigation with client-side routing.
|
|
10
|
+
*/
|
|
11
|
+
onClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
6
12
|
};
|
|
@@ -37,7 +37,10 @@ export type ButtonTokensType = {
|
|
|
37
37
|
padding: {
|
|
38
38
|
[key in ButtonSize]: {
|
|
39
39
|
[key in ButtonType]: {
|
|
40
|
-
[key in ButtonSubType]:
|
|
40
|
+
[key in ButtonSubType]: {
|
|
41
|
+
x: CSSObject['padding'];
|
|
42
|
+
y: CSSObject['padding'];
|
|
43
|
+
};
|
|
41
44
|
};
|
|
42
45
|
};
|
|
43
46
|
};
|
|
@@ -188,11 +188,12 @@ export type PaginationConfig = {
|
|
|
188
188
|
totalRows: number;
|
|
189
189
|
pageSizeOptions?: number[];
|
|
190
190
|
};
|
|
191
|
-
export type
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
export type BulkActionsConfig = {
|
|
192
|
+
showSelectAll?: boolean;
|
|
193
|
+
showDeselectAll?: boolean;
|
|
194
|
+
onSelectAll?: () => void;
|
|
195
|
+
onDeselectAll?: () => void;
|
|
196
|
+
customActions?: ReactNode;
|
|
196
197
|
};
|
|
197
198
|
export type RowActionConfig<T extends Record<string, unknown>> = {
|
|
198
199
|
id: string;
|
|
@@ -274,8 +275,24 @@ export type DataTableProps<T extends Record<string, unknown>> = {
|
|
|
274
275
|
isRowExpandable?: (row: T, index: number) => boolean;
|
|
275
276
|
onRowExpansionChange?: (rowId: unknown, isExpanded: boolean, rowData: T) => void;
|
|
276
277
|
enableRowSelection?: boolean;
|
|
277
|
-
|
|
278
|
+
onRowSelectionChange?: (selectedRowIds: string[], isSelected: boolean, rowId: string, rowData: T) => void;
|
|
279
|
+
bulkActions?: BulkActionsConfig;
|
|
278
280
|
rowActions?: RowActionsConfig<T>;
|
|
279
281
|
getRowStyle?: (row: T, index: number) => React.CSSProperties;
|
|
282
|
+
tableBodyHeight?: string | number;
|
|
283
|
+
/**
|
|
284
|
+
* Approximate height of a single row in pixels.
|
|
285
|
+
* Used to calculate minimum table height based on page size.
|
|
286
|
+
* Helps maintain consistent layout and prevent shifting.
|
|
287
|
+
* @default 52
|
|
288
|
+
*/
|
|
289
|
+
rowHeight?: number;
|
|
290
|
+
/**
|
|
291
|
+
* Whether to maintain minimum height based on page size.
|
|
292
|
+
* When true, table maintains consistent height preventing layout shifts.
|
|
293
|
+
* When false, table height adjusts to content.
|
|
294
|
+
* @default true
|
|
295
|
+
*/
|
|
296
|
+
maintainMinHeight?: boolean;
|
|
280
297
|
mobileColumnsToShow?: number;
|
|
281
298
|
};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { CalendarTokenType } from './dateRangePicker.tokens';
|
|
3
2
|
type TimeSelectorProps = {
|
|
4
3
|
value: string;
|
|
5
4
|
onChange: (time: string) => void;
|
|
6
5
|
className?: string;
|
|
7
6
|
autoFocus?: boolean;
|
|
8
7
|
tabIndex?: number;
|
|
9
|
-
calendarToken?: CalendarTokenType;
|
|
10
8
|
};
|
|
11
9
|
declare const TimeSelector: React.ForwardRefExoticComponent<TimeSelectorProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
10
|
export default TimeSelector;
|
|
@@ -83,7 +83,7 @@ export type CalendarTokenType = {
|
|
|
83
83
|
border: CSSObject['border'];
|
|
84
84
|
borderRadius: CSSObject['borderRadius'];
|
|
85
85
|
boxShadow: CSSObject['boxShadow'];
|
|
86
|
-
|
|
86
|
+
header: {
|
|
87
87
|
padding: {
|
|
88
88
|
x: CSSObject['padding'];
|
|
89
89
|
y: CSSObject['padding'];
|
|
@@ -92,12 +92,9 @@ export type CalendarTokenType = {
|
|
|
92
92
|
gap: CSSObject['gap'];
|
|
93
93
|
label: {
|
|
94
94
|
color: CSSObject['color'];
|
|
95
|
-
width: CSSObject['width'];
|
|
96
95
|
fontSize: CSSObject['fontSize'];
|
|
97
96
|
fontWeight: CSSObject['fontWeight'];
|
|
98
97
|
};
|
|
99
|
-
fontSize: CSSObject['fontSize'];
|
|
100
|
-
fontWeight: CSSObject['fontWeight'];
|
|
101
98
|
};
|
|
102
99
|
};
|
|
103
100
|
calendarGrid: {
|
|
@@ -136,8 +133,8 @@ export type CalendarTokenType = {
|
|
|
136
133
|
fontWeight: CSSObject['fontWeight'];
|
|
137
134
|
fontSize: CSSObject['fontSize'];
|
|
138
135
|
lineHeight: CSSObject['lineHeight'];
|
|
139
|
-
|
|
140
|
-
[key in CalendarState]: CSSObject['
|
|
136
|
+
border: {
|
|
137
|
+
[key in CalendarState]: CSSObject['border'];
|
|
141
138
|
};
|
|
142
139
|
borderRadius: CSSObject['borderRadius'];
|
|
143
140
|
};
|
|
@@ -166,14 +163,8 @@ export type CalendarTokenType = {
|
|
|
166
163
|
todayDay: {
|
|
167
164
|
fontWeight: CSSObject['fontWeight'];
|
|
168
165
|
};
|
|
169
|
-
hoverState: {
|
|
170
|
-
boxShadow: CSSObject['boxShadow'];
|
|
171
|
-
borderRadius: CSSObject['borderRadius'];
|
|
172
|
-
};
|
|
173
166
|
disabledDay: {
|
|
174
|
-
|
|
175
|
-
cursor: CSSObject['cursor'];
|
|
176
|
-
pointerEvents: CSSObject['pointerEvents'];
|
|
167
|
+
color: CSSObject['color'];
|
|
177
168
|
};
|
|
178
169
|
};
|
|
179
170
|
text: {
|
|
@@ -189,16 +180,13 @@ export type CalendarTokenType = {
|
|
|
189
180
|
todayDay: {
|
|
190
181
|
color: CSSObject['color'];
|
|
191
182
|
};
|
|
183
|
+
disabledDate: {
|
|
184
|
+
color: CSSObject['color'];
|
|
185
|
+
};
|
|
192
186
|
};
|
|
193
187
|
todayIndicator: {
|
|
194
188
|
width: CSSObject['width'];
|
|
195
|
-
height: CSSObject['height'];
|
|
196
189
|
backgroundColor: CSSObject['backgroundColor'];
|
|
197
|
-
borderRadius: CSSObject['borderRadius'];
|
|
198
|
-
position: CSSObject['position'];
|
|
199
|
-
bottom: CSSObject['bottom'];
|
|
200
|
-
left: CSSObject['left'];
|
|
201
|
-
transform: CSSObject['transform'];
|
|
202
190
|
};
|
|
203
191
|
};
|
|
204
192
|
};
|
|
@@ -17,6 +17,11 @@ export type NavbarItem = {
|
|
|
17
17
|
onClick?: () => void;
|
|
18
18
|
href?: string;
|
|
19
19
|
isSelected?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* When true, the item appears in the Sidebar mobile navigation drawer.
|
|
22
|
+
* Desktop always renders all items regardless of this flag.
|
|
23
|
+
*/
|
|
24
|
+
showOnMobile?: boolean;
|
|
20
25
|
};
|
|
21
26
|
export type SectionProps = {
|
|
22
27
|
section: DirectoryData;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Menu dropdown content animations
|
|
3
|
+
*/
|
|
4
|
+
export declare const menuContentAnimations = "\n transform-origin: var(--radix-dropdown-menu-content-transform-origin);\n\n &[data-side='bottom'][data-state='open'] {\n animation: slideInFromTop 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='bottom'][data-state='closed'] {\n animation: slideOutToTop 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n &[data-side='top'][data-state='open'] {\n animation: slideInFromBottom 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='top'][data-state='closed'] {\n animation: slideOutToBottom 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n &[data-side='right'][data-state='open'] {\n animation: slideInFromLeft 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='right'][data-state='closed'] {\n animation: slideOutToLeft 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n &[data-side='left'][data-state='open'] {\n animation: slideInFromRight 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='left'][data-state='closed'] {\n animation: slideOutToRight 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n /* Shadcn-style keyframes with zoom + slide + fade */\n @keyframes slideInFromTop {\n from {\n opacity: 0;\n transform: translateY(-8px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n }\n\n @keyframes slideOutToTop {\n from {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n to {\n opacity: 0;\n transform: translateY(-8px) scale(0.95);\n }\n }\n\n @keyframes slideInFromBottom {\n from {\n opacity: 0;\n transform: translateY(8px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n }\n\n @keyframes slideOutToBottom {\n from {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n to {\n opacity: 0;\n transform: translateY(8px) scale(0.95);\n }\n }\n\n @keyframes slideInFromLeft {\n from {\n opacity: 0;\n transform: translateX(-8px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n }\n\n @keyframes slideOutToLeft {\n from {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n to {\n opacity: 0;\n transform: translateX(-8px) scale(0.95);\n }\n }\n\n @keyframes slideInFromRight {\n from {\n opacity: 0;\n transform: translateX(8px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n }\n\n @keyframes slideOutToRight {\n from {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n to {\n opacity: 0;\n transform: translateX(8px) scale(0.95);\n }\n }\n";
|
|
5
|
+
/**
|
|
6
|
+
* Submenu animations
|
|
7
|
+
*/
|
|
8
|
+
export declare const submenuContentAnimations = "\n transform-origin: var(--radix-dropdown-menu-content-transform-origin);\n\n &[data-side='right'][data-state='open'] {\n animation: slideInFromLeft 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='right'][data-state='closed'] {\n animation: slideOutToLeft 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n &[data-side='left'][data-state='open'] {\n animation: slideInFromRight 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='left'][data-state='closed'] {\n animation: slideOutToRight 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const modalBackdropAnimations: (isAnimatingIn: boolean) => import('styled-components').RuleSet<object>;
|
|
2
|
+
export declare const modalContentAnimations: (isAnimatingIn: boolean) => import('styled-components').RuleSet<object>;
|
|
3
|
+
export declare const ANIMATION_DURATION = 500;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultiSelect Dropdown Animations
|
|
3
|
+
*
|
|
4
|
+
* Shadcn-style animations with zoom + slide + fade
|
|
5
|
+
* - Combined animation in single keyframe
|
|
6
|
+
* - Side-aware based on dropdown position
|
|
7
|
+
* - Smooth spring easing
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Main dropdown content animations
|
|
11
|
+
*/
|
|
12
|
+
export declare const dropdownContentAnimations = "\n transform-origin: var(--radix-dropdown-menu-content-transform-origin);\n\n /* Opening animations - Shadcn style with zoom */\n &[data-side='bottom'][data-state='open'] {\n animation: slideInFromTop 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='bottom'][data-state='closed'] {\n animation: slideOutToTop 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n &[data-side='top'][data-state='open'] {\n animation: slideInFromBottom 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='top'][data-state='closed'] {\n animation: slideOutToBottom 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n &[data-side='right'][data-state='open'] {\n animation: slideInFromLeft 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='right'][data-state='closed'] {\n animation: slideOutToLeft 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n &[data-side='left'][data-state='open'] {\n animation: slideInFromRight 400ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n &[data-side='left'][data-state='closed'] {\n animation: slideOutToRight 300ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n\n /* Shadcn-style keyframes with zoom + slide + fade */\n @keyframes slideInFromTop {\n from {\n opacity: 0;\n transform: translateY(-8px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n }\n\n @keyframes slideOutToTop {\n from {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n to {\n opacity: 0;\n transform: translateY(-8px) scale(0.95);\n }\n }\n\n @keyframes slideInFromBottom {\n from {\n opacity: 0;\n transform: translateY(8px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n }\n\n @keyframes slideOutToBottom {\n from {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n to {\n opacity: 0;\n transform: translateY(8px) scale(0.95);\n }\n }\n\n @keyframes slideInFromLeft {\n from {\n opacity: 0;\n transform: translateX(-8px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n }\n\n @keyframes slideOutToLeft {\n from {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n to {\n opacity: 0;\n transform: translateX(-8px) scale(0.95);\n }\n }\n\n @keyframes slideInFromRight {\n from {\n opacity: 0;\n transform: translateX(8px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n }\n\n @keyframes slideOutToRight {\n from {\n opacity: 1;\n transform: translateX(0) scale(1);\n }\n to {\n opacity: 0;\n transform: translateX(8px) scale(0.95);\n }\n }\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const popoverContentAnimations: import('styled-components').RuleSet<object>;
|
|
@@ -84,6 +84,11 @@ type PrimitiveInputProps = StateStyles & {
|
|
|
84
84
|
overflowY?: CSSObject['overflowY'];
|
|
85
85
|
contentCentered?: boolean;
|
|
86
86
|
cursor?: CSSObject['cursor'];
|
|
87
|
+
transition?: CSSObject['transition'];
|
|
88
|
+
transitionProperty?: CSSObject['transitionProperty'];
|
|
89
|
+
transitionDuration?: CSSObject['transitionDuration'];
|
|
90
|
+
transitionTimingFunction?: CSSObject['transitionTimingFunction'];
|
|
91
|
+
transitionDelay?: CSSObject['transitionDelay'];
|
|
87
92
|
placeholderStyles?: CSSObject;
|
|
88
93
|
};
|
|
89
94
|
export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & PrimitiveInputProps & {
|
|
@@ -79,6 +79,11 @@ type PrimitiveTextareaProps = StateStyles & {
|
|
|
79
79
|
overflowY?: CSSObject['overflowY'];
|
|
80
80
|
contentCentered?: boolean;
|
|
81
81
|
cursor?: CSSObject['cursor'];
|
|
82
|
+
transition?: CSSObject['transition'];
|
|
83
|
+
transitionProperty?: CSSObject['transitionProperty'];
|
|
84
|
+
transitionDuration?: CSSObject['transitionDuration'];
|
|
85
|
+
transitionTimingFunction?: CSSObject['transitionTimingFunction'];
|
|
86
|
+
transitionDelay?: CSSObject['transitionDelay'];
|
|
82
87
|
placeholderStyles?: CSSObject;
|
|
83
88
|
resize?: CSSObject['resize'];
|
|
84
89
|
fontFamily?: CSSObject['fontFamily'];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const radioAnimations: import('styled-components').RuleSet<object>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MobileNavigationItem as MobileNavigationItemType } from '../types';
|
|
3
|
+
import { MobileNavigationTokenType } from './mobile.tokens';
|
|
4
|
+
type MobileNavigationItemProps = {
|
|
5
|
+
item: MobileNavigationItemType;
|
|
6
|
+
index?: number;
|
|
7
|
+
tokens: MobileNavigationTokenType;
|
|
8
|
+
onSelect: (item: MobileNavigationItemType) => void;
|
|
9
|
+
};
|
|
10
|
+
declare const MobileNavigationItem: React.ForwardRefExoticComponent<MobileNavigationItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export default MobileNavigationItem;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MobileNavigationTokenType } from './mobile.tokens';
|
|
2
|
+
type MoreButtonProps = {
|
|
3
|
+
tokens: MobileNavigationTokenType;
|
|
4
|
+
onClick: () => void;
|
|
5
|
+
};
|
|
6
|
+
declare const MoreButton: import('react').ForwardRefExoticComponent<MoreButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export default MoreButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { MobileNavigationTokenType } from './mobile.tokens';
|
|
3
|
+
type PrimaryActionButtonProps = {
|
|
4
|
+
tokens: MobileNavigationTokenType;
|
|
5
|
+
buttonProps?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>;
|
|
6
|
+
};
|
|
7
|
+
declare const PrimaryActionButton: React.ForwardRefExoticComponent<PrimaryActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
export default PrimaryActionButton;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MobileNavigationItem } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Custom hook to manage ordered items with smart property updates.
|
|
4
|
+
* Only resets order when items are added/removed, otherwise preserves order
|
|
5
|
+
* and just updates properties (like isSelected).
|
|
6
|
+
*
|
|
7
|
+
* This hook is extracted because:
|
|
8
|
+
* 1. It encapsulates complex state logic
|
|
9
|
+
* 2. The logic is reusable across different navigation contexts
|
|
10
|
+
* 3. It keeps the component clean and focused on rendering
|
|
11
|
+
*/
|
|
12
|
+
export declare const useOrderedItems: <T extends {
|
|
13
|
+
label: string;
|
|
14
|
+
}>(items: T[]) => readonly [T[], import('react').Dispatch<import('react').SetStateAction<T[]>>];
|
|
15
|
+
/**
|
|
16
|
+
* Custom hook for item selection with smart swapping logic.
|
|
17
|
+
* Handles the complex behavior of swapping secondary items with primary items.
|
|
18
|
+
*
|
|
19
|
+
* This hook is extracted because:
|
|
20
|
+
* 1. It encapsulates business logic for item swapping
|
|
21
|
+
* 2. It reduces component complexity
|
|
22
|
+
* 3. The logic is testable in isolation
|
|
23
|
+
*/
|
|
24
|
+
export declare const useItemSelection: (orderedItems: MobileNavigationItem[], setOrderedItems: (items: MobileNavigationItem[]) => void, primaryItems: MobileNavigationItem[], hasSecondaryItems: boolean, onCollapse: () => void) => (item: MobileNavigationItem, isSecondaryItem?: boolean) => void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { CSSObject } from 'styled-components';
|
|
2
|
+
import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
3
|
+
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
4
|
+
export type MobileNavigationState = 'default' | 'active';
|
|
5
|
+
/**
|
|
6
|
+
* Mobile Navigation Tokens following the pattern: [target].CSSProp.[variant].[state]
|
|
7
|
+
*
|
|
8
|
+
* Structure matches Sidebar pattern for consistency:
|
|
9
|
+
* - Base properties: backgroundColor, drawer.*
|
|
10
|
+
* - Layout surfaces: padding/gap (container), row.*
|
|
11
|
+
* - Interactive elements: item.*, primaryAction.*
|
|
12
|
+
* - Interactive elements have state-based styling: [state] = default | active
|
|
13
|
+
*
|
|
14
|
+
* Note: This is mobile-only, so no responsive breakpoints needed.
|
|
15
|
+
* All navigation items (including the More button) use the same item tokens.
|
|
16
|
+
*
|
|
17
|
+
* Pattern examples:
|
|
18
|
+
* - padding.[axis] (wrapper spacing for all rows)
|
|
19
|
+
* - row.padding.[axis] (individual row spacing)
|
|
20
|
+
* - item.backgroundColor.[state] (item background per state)
|
|
21
|
+
* - primaryAction.width (primary action button dimensions)
|
|
22
|
+
*/
|
|
23
|
+
export type MobileNavigationTokenType = {
|
|
24
|
+
backgroundColor: CSSObject['backgroundColor'];
|
|
25
|
+
drawer: {
|
|
26
|
+
borderRadius: CSSObject['borderRadius'];
|
|
27
|
+
borderTop: CSSObject['border'];
|
|
28
|
+
};
|
|
29
|
+
padding: {
|
|
30
|
+
x: CSSObject['padding'];
|
|
31
|
+
y: CSSObject['padding'];
|
|
32
|
+
};
|
|
33
|
+
gap: CSSObject['gap'];
|
|
34
|
+
row: {
|
|
35
|
+
padding: {
|
|
36
|
+
x: CSSObject['padding'];
|
|
37
|
+
y: CSSObject['padding'];
|
|
38
|
+
};
|
|
39
|
+
gap: CSSObject['gap'];
|
|
40
|
+
item: {
|
|
41
|
+
width: CSSObject['width'];
|
|
42
|
+
height: CSSObject['height'];
|
|
43
|
+
borderRadius: CSSObject['borderRadius'];
|
|
44
|
+
gap: CSSObject['gap'];
|
|
45
|
+
backgroundColor: {
|
|
46
|
+
[key in MobileNavigationState]: CSSObject['backgroundColor'];
|
|
47
|
+
};
|
|
48
|
+
color: {
|
|
49
|
+
[key in MobileNavigationState]: CSSObject['color'];
|
|
50
|
+
};
|
|
51
|
+
fontWeight: CSSObject['fontWeight'];
|
|
52
|
+
icon: {
|
|
53
|
+
width: CSSObject['width'];
|
|
54
|
+
height: CSSObject['height'];
|
|
55
|
+
borderRadius: CSSObject['borderRadius'];
|
|
56
|
+
transition: CSSObject['transition'];
|
|
57
|
+
};
|
|
58
|
+
text: {
|
|
59
|
+
fontSize: CSSObject['fontSize'];
|
|
60
|
+
fontWeight: CSSObject['fontWeight'];
|
|
61
|
+
textAlign: CSSObject['textAlign'];
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
primaryAction: {
|
|
65
|
+
width: CSSObject['width'];
|
|
66
|
+
height: CSSObject['height'];
|
|
67
|
+
borderRadius: CSSObject['borderRadius'];
|
|
68
|
+
background: CSSObject['background'];
|
|
69
|
+
boxShadow: CSSObject['boxShadow'];
|
|
70
|
+
color: CSSObject['color'];
|
|
71
|
+
icon: {
|
|
72
|
+
width: CSSObject['width'];
|
|
73
|
+
height: CSSObject['height'];
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
export type ResponsiveMobileNavigationTokens = {
|
|
79
|
+
[key in keyof BreakpointType]: MobileNavigationTokenType;
|
|
80
|
+
};
|
|
81
|
+
export declare const getMobileNavigationTokens: (foundationToken: FoundationTokenType) => ResponsiveMobileNavigationTokens;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MobileNavigationItem } from '../types';
|
|
2
|
+
import { MobileNavigationTokenType } from './mobile.tokens';
|
|
3
|
+
export declare const calculateMobileNavigationSnapPoints: (secondaryRowCount: number, viewportHeight: number | undefined, tokens: MobileNavigationTokenType, viewportHeightMultiplier: number) => Array<string | number>;
|
|
4
|
+
export declare const getMobileNavigationLayout: (items: MobileNavigationItem[], viewportHeight: number | undefined, tokens: MobileNavigationTokenType, primaryVisibleLimit: number, viewportHeightMultiplier: number, options?: {
|
|
5
|
+
primaryReservedSlots?: number;
|
|
6
|
+
}) => {
|
|
7
|
+
primaryItems: MobileNavigationItem[];
|
|
8
|
+
secondaryItems: MobileNavigationItem[];
|
|
9
|
+
hasSecondaryItems: boolean;
|
|
10
|
+
snapPoints: (string | number)[];
|
|
11
|
+
};
|
|
12
|
+
export declare const getMobileNavigationSecondaryRows: (secondaryItems: MobileNavigationItem[], primaryVisibleLimit: number) => MobileNavigationItem[][];
|
|
13
|
+
export declare const getMobileNavigationFillerCount: (itemsInRow: number, primaryVisibleLimit: number) => number;
|
|
14
|
+
export declare const splitPrimaryItems: (primaryItems: MobileNavigationItem[], showPrimaryAction: boolean) => {
|
|
15
|
+
leftItems: MobileNavigationItem[];
|
|
16
|
+
rightItems: MobileNavigationItem[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Swap two items in an array by their labels
|
|
20
|
+
*/
|
|
21
|
+
export declare const swapItemsByLabel: <T extends {
|
|
22
|
+
label: string;
|
|
23
|
+
}>(items: T[], itemLabel1: string, itemLabel2: string) => T[];
|
|
24
|
+
/**
|
|
25
|
+
* Update item properties without changing order
|
|
26
|
+
*/
|
|
27
|
+
export declare const updateItemProperties: <T extends {
|
|
28
|
+
label: string;
|
|
29
|
+
}>(orderedItems: T[], newItems: T[]) => T[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { DirectoryData } from '../Directory/types';
|
|
2
|
+
import { DirectoryData, NavbarItem } from '../Directory/types';
|
|
3
3
|
import { MerchantInfo } from '../Topbar/types';
|
|
4
4
|
export type LeftPanelItem = {
|
|
5
5
|
label: string;
|
|
@@ -37,6 +37,22 @@ export type SidebarProps = {
|
|
|
37
37
|
merchantInfo?: MerchantInfo;
|
|
38
38
|
rightActions?: ReactNode;
|
|
39
39
|
enableTopbarAutoHide?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Controlled state: Show/hide topbar
|
|
42
|
+
* When provided, topbar operates in controlled mode - parent must handle visibility updates
|
|
43
|
+
*/
|
|
44
|
+
isTopbarVisible?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Callback fired when topbar visibility should change
|
|
47
|
+
* In controlled mode: Parent should update isTopbarVisible prop based on this callback
|
|
48
|
+
* In uncontrolled mode: Optional callback for visibility change notifications
|
|
49
|
+
*/
|
|
50
|
+
onTopbarVisibilityChange?: (isVisible: boolean) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Uncontrolled mode: Initial topbar visibility (defaults to true)
|
|
53
|
+
* Only used when isTopbarVisible is not provided
|
|
54
|
+
*/
|
|
55
|
+
defaultIsTopbarVisible?: boolean;
|
|
40
56
|
/**
|
|
41
57
|
* Controlled state: Current expanded state of the sidebar
|
|
42
58
|
* When provided, sidebar operates in controlled mode - parent must handle state updates
|
|
@@ -53,4 +69,22 @@ export type SidebarProps = {
|
|
|
53
69
|
* Only used when isExpanded is not provided
|
|
54
70
|
*/
|
|
55
71
|
defaultIsExpanded?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Show primary action button in mobile navigation
|
|
74
|
+
*/
|
|
75
|
+
showPrimaryActionButton?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Props for the primary action button in mobile navigation
|
|
78
|
+
* Extends HTML button attributes
|
|
79
|
+
*/
|
|
80
|
+
primaryActionButtonProps?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>;
|
|
81
|
+
};
|
|
82
|
+
export type MobileNavigationItem = NavbarItem & {
|
|
83
|
+
sectionLabel?: string;
|
|
84
|
+
};
|
|
85
|
+
export type SidebarMobileNavigationProps = {
|
|
86
|
+
items: MobileNavigationItem[];
|
|
87
|
+
onHeightChange?: (height: string) => void;
|
|
88
|
+
showPrimaryActionButton?: boolean;
|
|
89
|
+
primaryActionButtonProps?: Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'>;
|
|
56
90
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { TenantItem } from './types';
|
|
1
|
+
import { MobileNavigationItem, TenantItem } from './types';
|
|
2
2
|
import { SidebarTokenType } from './sidebar.tokens';
|
|
3
|
+
import { DirectoryData } from '../Directory/types';
|
|
3
4
|
export declare const arrangeTenants: (tenants: TenantItem[], selectedLabel: string, maxVisible: number) => {
|
|
4
5
|
visibleTenants: TenantItem[];
|
|
5
6
|
hiddenTenants: TenantItem[];
|
|
@@ -25,3 +26,40 @@ export declare const getDefaultMerchantInfo: () => {
|
|
|
25
26
|
};
|
|
26
27
|
export declare const useTopbarAutoHide: (enableTopbarAutoHide: boolean) => boolean;
|
|
27
28
|
export declare const isControlledSidebar: (isExpanded: boolean | undefined) => boolean;
|
|
29
|
+
export declare const getMobileNavigationItems: (directory: DirectoryData[]) => MobileNavigationItem[];
|
|
30
|
+
/**
|
|
31
|
+
* Parse CSS unit values to numbers (e.g., "16px" -> 16)
|
|
32
|
+
* Returns 0 for invalid values
|
|
33
|
+
*/
|
|
34
|
+
export declare const parseUnitValue: (value: string | number | undefined) => number;
|
|
35
|
+
/**
|
|
36
|
+
* Parse CSS values to numbers, allowing null for invalid values
|
|
37
|
+
* Returns null for invalid values (more flexible than parseUnitValue)
|
|
38
|
+
*/
|
|
39
|
+
export declare const parseCssValue: (value: string | number | null | undefined) => number | null;
|
|
40
|
+
export declare const MOBILE_NAVIGATION_COLLAPSED_HEIGHT: string;
|
|
41
|
+
export declare const MOBILE_NAVIGATION_SAFE_AREA: string;
|
|
42
|
+
export declare const getMobileNavigationLayout: (items: MobileNavigationItem[], viewportHeight?: number, options?: {
|
|
43
|
+
primaryReservedSlots?: number;
|
|
44
|
+
}) => {
|
|
45
|
+
primaryItems: MobileNavigationItem[];
|
|
46
|
+
secondaryItems: MobileNavigationItem[];
|
|
47
|
+
hasSecondaryItems: boolean;
|
|
48
|
+
snapPoints: (string | number)[];
|
|
49
|
+
};
|
|
50
|
+
export declare const getMobileNavigationSecondaryRows: (secondaryItems: MobileNavigationItem[]) => MobileNavigationItem[][];
|
|
51
|
+
export declare const getMobileNavigationFillerCount: (itemsInRow: number) => number;
|
|
52
|
+
export declare const getMobileNavigationRowPadding: ({ isSecondary, isLastRow, }: {
|
|
53
|
+
isSecondary: boolean;
|
|
54
|
+
isLastRow: boolean;
|
|
55
|
+
}) => {
|
|
56
|
+
paddingTop: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
57
|
+
paddingRight: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
58
|
+
paddingBottom: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
59
|
+
paddingLeft: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
60
|
+
};
|
|
61
|
+
export declare const MOBILE_NAVIGATION_BUTTON_DIMENSIONS: {
|
|
62
|
+
width: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
63
|
+
height: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
64
|
+
};
|
|
65
|
+
export declare const MOBILE_NAVIGATION_GAP: number | (string & {}) | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "normal" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | "-webkit-fit-content" | "-webkit-max-content" | "auto" | "fit-content" | "intrinsic" | "max-content" | "min-content" | "min-intrinsic" | undefined;
|
|
@@ -2,7 +2,7 @@ import { CSSObject } from 'styled-components';
|
|
|
2
2
|
import { ChangeType, StatCardVariant } from './types';
|
|
3
3
|
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
4
4
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
5
|
-
export type StatCardState = 'default' | 'hover'
|
|
5
|
+
export type StatCardState = 'default' | 'hover';
|
|
6
6
|
export type StatCardTokenType = {
|
|
7
7
|
height: CSSObject['height'];
|
|
8
8
|
maxWidth: CSSObject['maxWidth'];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TagColor, TagShape, TagSize, TagVariant } from './types';
|
|
2
|
+
declare const Tag: import('react').ForwardRefExoticComponent<Omit<import('../Primitives/Block/Block').BlockProps, "children"> & {
|
|
3
|
+
text: string;
|
|
4
|
+
variant?: TagVariant;
|
|
5
|
+
color?: TagColor;
|
|
6
|
+
size?: TagSize;
|
|
7
|
+
shape?: TagShape;
|
|
8
|
+
leftSlot?: import('react').ReactNode;
|
|
9
|
+
rightSlot?: import('react').ReactNode;
|
|
10
|
+
splitTagPosition?: "left" | "right";
|
|
11
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export default Tag;
|
|
@@ -2,6 +2,7 @@ import { CSSObject } from 'styled-components';
|
|
|
2
2
|
import { TagColor, TagShape, TagSize, TagVariant } from './types';
|
|
3
3
|
import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
4
4
|
import { FoundationTokenType } from '../../tokens/theme.token';
|
|
5
|
+
import { Theme } from '../../context/ThemeProvider';
|
|
5
6
|
/**
|
|
6
7
|
* Tag Tokens following the pattern: [target].CSSProp.[size].[variant].[subType]
|
|
7
8
|
*
|
|
@@ -52,5 +53,5 @@ export type TagTokensType = Readonly<{
|
|
|
52
53
|
export type ResponsiveTagTokens = {
|
|
53
54
|
[key in keyof BreakpointType]: TagTokensType;
|
|
54
55
|
};
|
|
55
|
-
export declare const getTagTokens: (foundationToken: FoundationTokenType) => ResponsiveTagTokens;
|
|
56
|
+
export declare const getTagTokens: (foundationToken: FoundationTokenType, theme?: Theme | string) => ResponsiveTagTokens;
|
|
56
57
|
export default getTagTokens;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tooltipContentAnimations: import('styled-components').RuleSet<object>;
|
|
@@ -11,9 +11,16 @@ export type MerchantInfo = {
|
|
|
11
11
|
};
|
|
12
12
|
export type TopbarProps = {
|
|
13
13
|
children?: ReactNode;
|
|
14
|
+
/** Sidebar expansion state */
|
|
14
15
|
isExpanded?: boolean;
|
|
15
16
|
onToggleExpansion?: () => void;
|
|
16
17
|
showToggleButton?: boolean;
|
|
18
|
+
/** Controlled mode: Show/hide topbar */
|
|
19
|
+
isVisible?: boolean;
|
|
20
|
+
/** Callback when visibility changes (controlled mode) */
|
|
21
|
+
onVisibilityChange?: (visible: boolean) => void;
|
|
22
|
+
/** Uncontrolled mode: Initial topbar visibility (defaults to true) */
|
|
23
|
+
defaultIsVisible?: boolean;
|
|
17
24
|
sidebarTopSlot?: ReactNode;
|
|
18
25
|
topbar?: ReactNode;
|
|
19
26
|
title?: string;
|