@veevarts/design-system 1.12.0-alpha.2 → 1.12.0-alpha.3
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/index.cjs +8 -8
- package/dist/index.js +741 -734
- package/dist/patterns/Summary/types.d.ts +12 -5
- package/dist/patterns/Summary/useIsMobile.d.ts +17 -0
- package/package.json +1 -1
|
@@ -115,12 +115,15 @@ export interface SummaryProps {
|
|
|
115
115
|
};
|
|
116
116
|
/**
|
|
117
117
|
* Whether the summary can collapse — the header shows a `×` and the whole
|
|
118
|
-
* header toggles Open/Closed. Defaults to `variant === 'mobile'` (
|
|
119
|
-
*
|
|
120
|
-
* behaviour.
|
|
118
|
+
* header toggles Open/Closed. Defaults to `variant === 'mobile'` (including
|
|
119
|
+
* the auto-detected mobile variant — see `variant`). Pass explicitly to
|
|
120
|
+
* override the automatic behaviour.
|
|
121
121
|
*/
|
|
122
122
|
collapsible?: boolean;
|
|
123
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Controlled open/closed state. Defaults to **closed** when collapsible (the
|
|
125
|
+
* mobile sheet rests collapsed) and always open on the non-collapsible card.
|
|
126
|
+
*/
|
|
124
127
|
isOpen?: boolean;
|
|
125
128
|
/** Fires when the header (open) — or the closed bar's Total (closed) — is activated to toggle. */
|
|
126
129
|
onToggleOpen?: () => void;
|
|
@@ -128,7 +131,11 @@ export interface SummaryProps {
|
|
|
128
131
|
primaryAction?: SummaryPrimaryAction;
|
|
129
132
|
/** When provided, item rows show a red trash remove control. */
|
|
130
133
|
onRemoveItem?: (id: string) => void;
|
|
131
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* Layout: full card (`'main'`) or the bottom-sheet / compact bar (`'mobile'`).
|
|
136
|
+
* When OMITTED the layout is auto-detected from the viewport (below `md`
|
|
137
|
+
* → `'mobile'`, `md`+ → `'main'`). Pass explicitly to pin a layout.
|
|
138
|
+
*/
|
|
132
139
|
variant?: 'main' | 'mobile';
|
|
133
140
|
/** Mobile bottom-bar cart button + badge count. */
|
|
134
141
|
cart?: {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Below Tailwind's `md` (768px): phones / small tablets get the bottom-sheet,
|
|
3
|
+
* everything `md`+ gets the bordered card. Exported so the threshold is shared
|
|
4
|
+
* and overridable.
|
|
5
|
+
*/
|
|
6
|
+
export declare const MOBILE_MEDIA_QUERY = "(max-width: 767px)";
|
|
7
|
+
/**
|
|
8
|
+
* Pure, SSR-safe read of a media query. Returns `false` when `matchMedia` is
|
|
9
|
+
* unavailable (server / jsdom), so callers default to the non-mobile layout.
|
|
10
|
+
*/
|
|
11
|
+
export declare const mediaMatches: (query: string) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Subscribe to a media query and re-render on viewport changes. Initialises
|
|
14
|
+
* from `mediaMatches` (so the first paint already reflects the viewport on the
|
|
15
|
+
* client) and updates live as the screen crosses the breakpoint.
|
|
16
|
+
*/
|
|
17
|
+
export declare const useIsMobile: (query?: string) => boolean;
|