@bug-on/m3-expressive 1.0.0 → 1.1.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/CHANGELOG.md +29 -2
- package/README.md +20 -18
- package/dist/assets/material-symbols-self-hosted.css +27 -26
- package/dist/buttons.d.mts +1 -1
- package/dist/buttons.d.ts +1 -1
- package/dist/buttons.js.map +1 -1
- package/dist/buttons.mjs.map +1 -1
- package/dist/core.d.mts +44 -44
- package/dist/core.d.ts +44 -44
- package/dist/core.js.map +1 -1
- package/dist/core.mjs.map +1 -1
- package/dist/feedback.d.mts +54 -54
- package/dist/feedback.d.ts +54 -54
- package/dist/feedback.js.map +1 -1
- package/dist/feedback.mjs.map +1 -1
- package/dist/index.css +3 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/dist/layout.d.mts +40 -40
- package/dist/layout.d.ts +40 -40
- package/dist/layout.js +5 -5
- package/dist/layout.js.map +1 -1
- package/dist/layout.mjs +5 -5
- package/dist/layout.mjs.map +1 -1
- package/dist/material-symbols-self-hosted.css +27 -26
- package/dist/navigation.js.map +1 -1
- package/dist/navigation.mjs.map +1 -1
- package/dist/overlays.d.mts +2 -2
- package/dist/overlays.d.ts +2 -2
- package/dist/overlays.js +2 -2
- package/dist/overlays.js.map +1 -1
- package/dist/overlays.mjs +2 -2
- package/dist/overlays.mjs.map +1 -1
- package/dist/pickers.d.mts +241 -243
- package/dist/pickers.d.ts +241 -243
- package/dist/pickers.js +1 -1
- package/dist/pickers.js.map +1 -1
- package/dist/pickers.mjs +1 -1
- package/dist/pickers.mjs.map +1 -1
- package/dist/{side-sheet-modal-BY6VCC8p.d.mts → side-sheet-modal-64FGhDxL.d.mts} +20 -21
- package/dist/{side-sheet-modal-CglP6KYA.d.ts → side-sheet-modal-Bd5Qqvp9.d.ts} +20 -21
- package/dist/{split-button-trailing-uncheckable-MXj_kyNt.d.mts → split-button-trailing-uncheckable-BRPuTqi1.d.mts} +140 -151
- package/dist/{split-button-trailing-uncheckable-C5CLCIKP.d.ts → split-button-trailing-uncheckable-CjOFCoyW.d.ts} +140 -151
- package/dist/typography.css +5 -0
- package/package.json +4 -4
package/dist/core.d.mts
CHANGED
|
@@ -6,9 +6,9 @@ export { M as MD3ColorStyle, a as MD3Shape, b as MD3Size, P as PolymorphicProps,
|
|
|
6
6
|
import { a as Typography, F as FontVariationAxes } from './typography-339RV6v7.mjs';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* useMediaQuery —
|
|
9
|
+
* useMediaQuery — SSR-safe responsive hook.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* Prevents hydration mismatch by initializing with `false`.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```tsx
|
|
@@ -18,20 +18,20 @@ import { a as Typography, F as FontVariationAxes } from './typography-339RV6v7.m
|
|
|
18
18
|
declare function useMediaQuery(query: string): boolean;
|
|
19
19
|
|
|
20
20
|
interface RippleOptions {
|
|
21
|
-
/**
|
|
21
|
+
/** Ripple animation duration (ms). Default: 600 */
|
|
22
22
|
duration?: number;
|
|
23
|
-
/**
|
|
23
|
+
/** Ripple color. Default: 'currentColor' */
|
|
24
24
|
color?: string;
|
|
25
|
-
/** Opacity.
|
|
25
|
+
/** Opacity. Default: 0.12 (MD3 standard) */
|
|
26
26
|
opacity?: number;
|
|
27
|
-
/**
|
|
27
|
+
/** Disable ripple (e.g. when component is disabled) */
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* useRipple — Material Design 3 Expressive Ripple Effect
|
|
32
32
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* Pure DOM hook with zero external animation dependencies.
|
|
34
|
+
* Note: Requires element to have `position: relative` and `overflow: hidden`.
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* ```tsx
|
|
@@ -47,19 +47,19 @@ declare function useRipple$1<T extends HTMLElement = HTMLElement>(options?: Ripp
|
|
|
47
47
|
/**
|
|
48
48
|
* MaterialSymbolsPreconnect
|
|
49
49
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* Injects preconnect resource hints for Google Fonts CDN into <head>.
|
|
51
|
+
* Place this component AS EARLY AS POSSIBLE in the app tree, ideally
|
|
52
|
+
* directly inside <head> or root layout.
|
|
53
53
|
*
|
|
54
54
|
* WHY THIS MATTERS:
|
|
55
|
-
*
|
|
56
|
-
* 1. Parse HTML -> download JS bundle -> execute CSS ->
|
|
57
|
-
* Preconnect hints
|
|
58
|
-
*
|
|
55
|
+
* If @import url() is inside a CSS file, browser must:
|
|
56
|
+
* 1. Parse HTML -> download JS bundle -> execute CSS -> hit @import -> start Google Fonts connection
|
|
57
|
+
* Preconnect hints allow browser to establish TCP handshake + TLS connection early at step 1,
|
|
58
|
+
* saving 100-500ms connection latency depending on network.
|
|
59
59
|
*
|
|
60
60
|
* USAGE:
|
|
61
61
|
* ```tsx
|
|
62
|
-
* // app/layout.tsx (Next.js)
|
|
62
|
+
* // app/layout.tsx (Next.js) or index.html equivalent
|
|
63
63
|
* import { MaterialSymbolsPreconnect } from '@bug-on/m3-expressive';
|
|
64
64
|
*
|
|
65
65
|
* export default function RootLayout({ children }) {
|
|
@@ -74,13 +74,13 @@ declare function useRipple$1<T extends HTMLElement = HTMLElement>(options?: Ripp
|
|
|
74
74
|
* }
|
|
75
75
|
* ```
|
|
76
76
|
*
|
|
77
|
-
* NOTE:
|
|
78
|
-
*
|
|
77
|
+
* NOTE: Use this component only with CDN mode.
|
|
78
|
+
* Self-hosted fonts do not require preconnecting to external origins.
|
|
79
79
|
*/
|
|
80
80
|
interface MaterialSymbolsPreconnectProps {
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
82
|
+
* Array of Material Symbols font variants to load.
|
|
83
|
+
* Include only variants used by application to minimize bandwidth.
|
|
84
84
|
* @default ["outlined"]
|
|
85
85
|
*/
|
|
86
86
|
variants?: Array<"outlined" | "rounded" | "sharp">;
|
|
@@ -162,84 +162,84 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
162
162
|
/**
|
|
163
163
|
* Props cho component {@link Icon}.
|
|
164
164
|
*
|
|
165
|
-
*
|
|
165
|
+
* All variable font axes are mapped directly to `font-variation-settings`.
|
|
166
166
|
*/
|
|
167
167
|
interface IconProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
168
168
|
/**
|
|
169
|
-
*
|
|
169
|
+
* Name of the Material Symbol in snake_case format.
|
|
170
170
|
* @example "home", "arrow_forward", "settings"
|
|
171
171
|
* @see https://fonts.google.com/icons
|
|
172
172
|
*/
|
|
173
173
|
name: string;
|
|
174
174
|
/**
|
|
175
|
-
*
|
|
175
|
+
* Geometric style variant — maps to font family.
|
|
176
176
|
* @default "outlined"
|
|
177
177
|
*/
|
|
178
178
|
variant?: "outlined" | "rounded" | "sharp";
|
|
179
179
|
/**
|
|
180
|
-
*
|
|
181
|
-
*
|
|
180
|
+
* `FILL` axis. `0` = outlined, `1` = filled.
|
|
181
|
+
* Features spring animation when `animateFill` is true.
|
|
182
182
|
* @default 0
|
|
183
183
|
*/
|
|
184
184
|
fill?: 0 | 1;
|
|
185
185
|
/**
|
|
186
|
-
*
|
|
186
|
+
* `wght` axis — stroke weight. Should match surrounding text weight.
|
|
187
187
|
* @default 400
|
|
188
188
|
*/
|
|
189
189
|
weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
191
|
+
* `GRAD` axis — fine-tunes visual weight without affecting layout dimensions.
|
|
192
|
+
* Use `-25` on dark backgrounds to offset light halation effects.
|
|
193
193
|
* @default 0
|
|
194
194
|
*/
|
|
195
195
|
grade?: -50 | -25 | 0 | 100 | 200;
|
|
196
196
|
/**
|
|
197
|
-
*
|
|
198
|
-
*
|
|
197
|
+
* `opsz` axis — optical size in dp. Used to set `font-size` if `size` is not specified.
|
|
198
|
+
* Match rendered pixel size for best quality.
|
|
199
199
|
* @default 24
|
|
200
200
|
*/
|
|
201
201
|
opticalSize?: 20 | 24 | 40 | 48;
|
|
202
202
|
/**
|
|
203
|
-
*
|
|
203
|
+
* Direct `font-size` override in px. `opsz` axis still respects `opticalSize`.
|
|
204
204
|
* @example size={18} opticalSize={20}
|
|
205
205
|
*/
|
|
206
206
|
size?: number | "inherit";
|
|
207
207
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
208
|
+
* Enables smooth spring animation when toggling FILL axis (uses `SPRING_TRANSITION_FAST`).
|
|
209
|
+
* Requires `motion` dependency.
|
|
210
210
|
* @default false
|
|
211
211
|
* @example <Icon name="favorite" fill={isLiked ? 1 : 0} animateFill />
|
|
212
212
|
*/
|
|
213
213
|
animateFill?: boolean;
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
|
-
*
|
|
216
|
+
* Material Symbols (variable font) Icon component.
|
|
217
217
|
*
|
|
218
|
-
*
|
|
218
|
+
* Make sure to import the icon font CSS before usage:
|
|
219
219
|
* ```ts
|
|
220
|
-
* import '@bug-on/m3-expressive/material-symbols.css';
|
|
220
|
+
* import '@bug-on/m3-expressive/material-symbols-cdn.css';
|
|
221
221
|
* ```
|
|
222
222
|
*
|
|
223
223
|
* @remarks
|
|
224
|
-
* -
|
|
225
|
-
* -
|
|
224
|
+
* - Use snake_case for icon names: `"arrow_forward"`, NOT `"ArrowForward"`.
|
|
225
|
+
* - `aria-hidden="true"` is attached automatically — provide screen reader labels on parent elements.
|
|
226
226
|
*
|
|
227
227
|
* @example
|
|
228
228
|
* ```tsx
|
|
229
|
-
* // Icon
|
|
229
|
+
* // Basic Icon
|
|
230
230
|
* <Icon name="home" />
|
|
231
231
|
*
|
|
232
|
-
* //
|
|
232
|
+
* // Visual customization (filled, heavy weight)
|
|
233
233
|
* <Icon name="favorite" variant="rounded" fill={1} weight={300} />
|
|
234
234
|
*
|
|
235
|
-
* //
|
|
235
|
+
* // Animated transition on state change
|
|
236
236
|
* <Icon name="bookmark" fill={saved ? 1 : 0} animateFill />
|
|
237
237
|
*
|
|
238
|
-
* //
|
|
238
|
+
* // Custom size override
|
|
239
239
|
* <Icon name="close" size={18} opticalSize={20} />
|
|
240
240
|
*
|
|
241
|
-
* //
|
|
242
|
-
* <Button icon={<Icon name="add" />}>
|
|
241
|
+
* // Combination with other components
|
|
242
|
+
* <Button icon={<Icon name="add" />}>Add to cart</Button>
|
|
243
243
|
* ```
|
|
244
244
|
*
|
|
245
245
|
* @see https://fonts.google.com/icons
|
package/dist/core.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ export { M as MD3ColorStyle, a as MD3Shape, b as MD3Size, P as PolymorphicProps,
|
|
|
6
6
|
import { a as Typography, F as FontVariationAxes } from './typography-339RV6v7.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* useMediaQuery —
|
|
9
|
+
* useMediaQuery — SSR-safe responsive hook.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* Prevents hydration mismatch by initializing with `false`.
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```tsx
|
|
@@ -18,20 +18,20 @@ import { a as Typography, F as FontVariationAxes } from './typography-339RV6v7.j
|
|
|
18
18
|
declare function useMediaQuery(query: string): boolean;
|
|
19
19
|
|
|
20
20
|
interface RippleOptions {
|
|
21
|
-
/**
|
|
21
|
+
/** Ripple animation duration (ms). Default: 600 */
|
|
22
22
|
duration?: number;
|
|
23
|
-
/**
|
|
23
|
+
/** Ripple color. Default: 'currentColor' */
|
|
24
24
|
color?: string;
|
|
25
|
-
/** Opacity.
|
|
25
|
+
/** Opacity. Default: 0.12 (MD3 standard) */
|
|
26
26
|
opacity?: number;
|
|
27
|
-
/**
|
|
27
|
+
/** Disable ripple (e.g. when component is disabled) */
|
|
28
28
|
disabled?: boolean;
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
31
|
* useRipple — Material Design 3 Expressive Ripple Effect
|
|
32
32
|
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* Pure DOM hook with zero external animation dependencies.
|
|
34
|
+
* Note: Requires element to have `position: relative` and `overflow: hidden`.
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* ```tsx
|
|
@@ -47,19 +47,19 @@ declare function useRipple$1<T extends HTMLElement = HTMLElement>(options?: Ripp
|
|
|
47
47
|
/**
|
|
48
48
|
* MaterialSymbolsPreconnect
|
|
49
49
|
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* Injects preconnect resource hints for Google Fonts CDN into <head>.
|
|
51
|
+
* Place this component AS EARLY AS POSSIBLE in the app tree, ideally
|
|
52
|
+
* directly inside <head> or root layout.
|
|
53
53
|
*
|
|
54
54
|
* WHY THIS MATTERS:
|
|
55
|
-
*
|
|
56
|
-
* 1. Parse HTML -> download JS bundle -> execute CSS ->
|
|
57
|
-
* Preconnect hints
|
|
58
|
-
*
|
|
55
|
+
* If @import url() is inside a CSS file, browser must:
|
|
56
|
+
* 1. Parse HTML -> download JS bundle -> execute CSS -> hit @import -> start Google Fonts connection
|
|
57
|
+
* Preconnect hints allow browser to establish TCP handshake + TLS connection early at step 1,
|
|
58
|
+
* saving 100-500ms connection latency depending on network.
|
|
59
59
|
*
|
|
60
60
|
* USAGE:
|
|
61
61
|
* ```tsx
|
|
62
|
-
* // app/layout.tsx (Next.js)
|
|
62
|
+
* // app/layout.tsx (Next.js) or index.html equivalent
|
|
63
63
|
* import { MaterialSymbolsPreconnect } from '@bug-on/m3-expressive';
|
|
64
64
|
*
|
|
65
65
|
* export default function RootLayout({ children }) {
|
|
@@ -74,13 +74,13 @@ declare function useRipple$1<T extends HTMLElement = HTMLElement>(options?: Ripp
|
|
|
74
74
|
* }
|
|
75
75
|
* ```
|
|
76
76
|
*
|
|
77
|
-
* NOTE:
|
|
78
|
-
*
|
|
77
|
+
* NOTE: Use this component only with CDN mode.
|
|
78
|
+
* Self-hosted fonts do not require preconnecting to external origins.
|
|
79
79
|
*/
|
|
80
80
|
interface MaterialSymbolsPreconnectProps {
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
82
|
+
* Array of Material Symbols font variants to load.
|
|
83
|
+
* Include only variants used by application to minimize bandwidth.
|
|
84
84
|
* @default ["outlined"]
|
|
85
85
|
*/
|
|
86
86
|
variants?: Array<"outlined" | "rounded" | "sharp">;
|
|
@@ -162,84 +162,84 @@ declare function cn(...inputs: ClassValue[]): string;
|
|
|
162
162
|
/**
|
|
163
163
|
* Props cho component {@link Icon}.
|
|
164
164
|
*
|
|
165
|
-
*
|
|
165
|
+
* All variable font axes are mapped directly to `font-variation-settings`.
|
|
166
166
|
*/
|
|
167
167
|
interface IconProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
168
168
|
/**
|
|
169
|
-
*
|
|
169
|
+
* Name of the Material Symbol in snake_case format.
|
|
170
170
|
* @example "home", "arrow_forward", "settings"
|
|
171
171
|
* @see https://fonts.google.com/icons
|
|
172
172
|
*/
|
|
173
173
|
name: string;
|
|
174
174
|
/**
|
|
175
|
-
*
|
|
175
|
+
* Geometric style variant — maps to font family.
|
|
176
176
|
* @default "outlined"
|
|
177
177
|
*/
|
|
178
178
|
variant?: "outlined" | "rounded" | "sharp";
|
|
179
179
|
/**
|
|
180
|
-
*
|
|
181
|
-
*
|
|
180
|
+
* `FILL` axis. `0` = outlined, `1` = filled.
|
|
181
|
+
* Features spring animation when `animateFill` is true.
|
|
182
182
|
* @default 0
|
|
183
183
|
*/
|
|
184
184
|
fill?: 0 | 1;
|
|
185
185
|
/**
|
|
186
|
-
*
|
|
186
|
+
* `wght` axis — stroke weight. Should match surrounding text weight.
|
|
187
187
|
* @default 400
|
|
188
188
|
*/
|
|
189
189
|
weight?: 100 | 200 | 300 | 400 | 500 | 600 | 700;
|
|
190
190
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
191
|
+
* `GRAD` axis — fine-tunes visual weight without affecting layout dimensions.
|
|
192
|
+
* Use `-25` on dark backgrounds to offset light halation effects.
|
|
193
193
|
* @default 0
|
|
194
194
|
*/
|
|
195
195
|
grade?: -50 | -25 | 0 | 100 | 200;
|
|
196
196
|
/**
|
|
197
|
-
*
|
|
198
|
-
*
|
|
197
|
+
* `opsz` axis — optical size in dp. Used to set `font-size` if `size` is not specified.
|
|
198
|
+
* Match rendered pixel size for best quality.
|
|
199
199
|
* @default 24
|
|
200
200
|
*/
|
|
201
201
|
opticalSize?: 20 | 24 | 40 | 48;
|
|
202
202
|
/**
|
|
203
|
-
*
|
|
203
|
+
* Direct `font-size` override in px. `opsz` axis still respects `opticalSize`.
|
|
204
204
|
* @example size={18} opticalSize={20}
|
|
205
205
|
*/
|
|
206
206
|
size?: number | "inherit";
|
|
207
207
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
208
|
+
* Enables smooth spring animation when toggling FILL axis (uses `SPRING_TRANSITION_FAST`).
|
|
209
|
+
* Requires `motion` dependency.
|
|
210
210
|
* @default false
|
|
211
211
|
* @example <Icon name="favorite" fill={isLiked ? 1 : 0} animateFill />
|
|
212
212
|
*/
|
|
213
213
|
animateFill?: boolean;
|
|
214
214
|
}
|
|
215
215
|
/**
|
|
216
|
-
*
|
|
216
|
+
* Material Symbols (variable font) Icon component.
|
|
217
217
|
*
|
|
218
|
-
*
|
|
218
|
+
* Make sure to import the icon font CSS before usage:
|
|
219
219
|
* ```ts
|
|
220
|
-
* import '@bug-on/m3-expressive/material-symbols.css';
|
|
220
|
+
* import '@bug-on/m3-expressive/material-symbols-cdn.css';
|
|
221
221
|
* ```
|
|
222
222
|
*
|
|
223
223
|
* @remarks
|
|
224
|
-
* -
|
|
225
|
-
* -
|
|
224
|
+
* - Use snake_case for icon names: `"arrow_forward"`, NOT `"ArrowForward"`.
|
|
225
|
+
* - `aria-hidden="true"` is attached automatically — provide screen reader labels on parent elements.
|
|
226
226
|
*
|
|
227
227
|
* @example
|
|
228
228
|
* ```tsx
|
|
229
|
-
* // Icon
|
|
229
|
+
* // Basic Icon
|
|
230
230
|
* <Icon name="home" />
|
|
231
231
|
*
|
|
232
|
-
* //
|
|
232
|
+
* // Visual customization (filled, heavy weight)
|
|
233
233
|
* <Icon name="favorite" variant="rounded" fill={1} weight={300} />
|
|
234
234
|
*
|
|
235
|
-
* //
|
|
235
|
+
* // Animated transition on state change
|
|
236
236
|
* <Icon name="bookmark" fill={saved ? 1 : 0} animateFill />
|
|
237
237
|
*
|
|
238
|
-
* //
|
|
238
|
+
* // Custom size override
|
|
239
239
|
* <Icon name="close" size={18} opticalSize={20} />
|
|
240
240
|
*
|
|
241
|
-
* //
|
|
242
|
-
* <Button icon={<Icon name="add" />}>
|
|
241
|
+
* // Combination with other components
|
|
242
|
+
* <Button icon={<Icon name="add" />}>Add to cart</Button>
|
|
243
243
|
* ```
|
|
244
244
|
*
|
|
245
245
|
* @see https://fonts.google.com/icons
|