@tinybigui/react 0.6.0 → 0.7.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/README.md +60 -40
- package/dist/index.cjs +253 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +184 -42
- package/dist/index.d.ts +184 -42
- package/dist/index.js +249 -98
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,11 +12,11 @@ A modern, accessible React component library implementing Google's Material Desi
|
|
|
12
12
|
|
|
13
13
|
## ✅ Status
|
|
14
14
|
|
|
15
|
-
> **
|
|
15
|
+
> **Latest Release: v0.7.0** (2026-06-09)
|
|
16
16
|
>
|
|
17
|
-
>
|
|
17
|
+
> **29 MD3 components** published to npm with full TypeScript support and WCAG 2.1 AA accessibility.
|
|
18
18
|
>
|
|
19
|
-
>
|
|
19
|
+
> Install with `npm install @tinybigui/react` — follow our [GitHub repository](https://github.com/buildinclicks/tinybigui) for updates!
|
|
20
20
|
|
|
21
21
|
---
|
|
22
22
|
|
|
@@ -127,46 +127,66 @@ See [THEMING.md](./THEMING.md) for the full customization guide.
|
|
|
127
127
|
|
|
128
128
|
### Phase 1a: Core Buttons ✅
|
|
129
129
|
|
|
130
|
-
| Component
|
|
131
|
-
|
|
|
132
|
-
| `Button`
|
|
133
|
-
| `IconButton`
|
|
134
|
-
| `FAB`
|
|
130
|
+
| Component | Status | Description |
|
|
131
|
+
| ------------- | ------ | ------------------------------------------------ |
|
|
132
|
+
| `Button` | ✅ | Filled, outlined, tonal, elevated, text variants |
|
|
133
|
+
| `IconButton` | ✅ | M3 Expressive 5-tier sizing, toggle mode |
|
|
134
|
+
| `FAB` | ✅ | M3 Expressive slot architecture, size scale |
|
|
135
|
+
| `FABMenu` | ✅ | Speed-dial with MD3 Expressive pill menu items |
|
|
136
|
+
| `ButtonGroup` | ✅ | Connected layout, single/multi-select |
|
|
137
|
+
| `SplitButton` | ✅ | Primary action + dropdown menu |
|
|
135
138
|
|
|
136
139
|
### Phase 1b: Form Components ✅
|
|
137
140
|
|
|
138
|
-
| Component | Status | Description
|
|
139
|
-
| ------------ | ------ |
|
|
140
|
-
| `TextField` | ✅ |
|
|
141
|
-
| `Checkbox` | ✅ |
|
|
142
|
-
| `Radio` | ✅ | Radio button input
|
|
143
|
-
| `RadioGroup` | ✅ |
|
|
144
|
-
| `Switch` | ✅ | Toggle
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|
|
|
151
|
-
| `
|
|
152
|
-
| `
|
|
153
|
-
| `
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
141
|
+
| Component | Status | Description |
|
|
142
|
+
| ------------ | ------ | ----------------------------------------- |
|
|
143
|
+
| `TextField` | ✅ | Filled and outlined, floating label |
|
|
144
|
+
| `Checkbox` | ✅ | Checked, unchecked, indeterminate |
|
|
145
|
+
| `Radio` | ✅ | Radio button input |
|
|
146
|
+
| `RadioGroup` | ✅ | Vertical and horizontal orientation |
|
|
147
|
+
| `Switch` | ✅ | Toggle with variants-vs-states arch. |
|
|
148
|
+
| `Slider` | ✅ | Standard, centered, range; discrete stops |
|
|
149
|
+
|
|
150
|
+
### Phase 2: Navigation ✅
|
|
151
|
+
|
|
152
|
+
| Component | Status | Description |
|
|
153
|
+
| ------------------ | ------ | ------------------------------------ |
|
|
154
|
+
| `AppBar` | ✅ | Four size variants, scroll elevation |
|
|
155
|
+
| `Tabs` | ✅ | Primary and secondary tab variants |
|
|
156
|
+
| `NavigationDrawer` | ✅ | Modal and standard navigation drawer |
|
|
157
|
+
| `NavigationBar` | ✅ | Bottom navigation with badges |
|
|
158
|
+
| `Search` | ✅ | SearchBar and SearchView overlay |
|
|
159
|
+
|
|
160
|
+
### Phase 3: Feedback ✅
|
|
161
|
+
|
|
162
|
+
| Component | Status | Description |
|
|
163
|
+
| ------------- | ------ | --------------------------------------- |
|
|
164
|
+
| `Dialog` | ✅ | Basic and fullscreen modal dialogs |
|
|
165
|
+
| `Snackbar` | ✅ | Provider, stacking, imperative API |
|
|
166
|
+
| `Menu` | ✅ | Dropdown, context menu, submenus |
|
|
167
|
+
| `Progress` | ✅ | Linear and circular indicators |
|
|
168
|
+
| `BottomSheet` | ✅ | Standard and modal with snap points |
|
|
169
|
+
| `Tooltip` | ✅ | Plain and rich tooltip with positioning |
|
|
170
|
+
|
|
171
|
+
### Phase 4: Data Display ✅
|
|
172
|
+
|
|
173
|
+
| Component | Status | Description |
|
|
174
|
+
| ------------ | ------ | --------------------------------------- |
|
|
175
|
+
| `Card` | ✅ | Elevated, filled, outlined variants |
|
|
176
|
+
| `List` | ✅ | Static and interactive list items |
|
|
177
|
+
| `Chip` | ✅ | Assist, Filter, Input, Suggestion types |
|
|
178
|
+
| `Badge` | ✅ | Dot and count notification badges |
|
|
179
|
+
| `Divider` | ✅ | Horizontal/vertical, inset variants |
|
|
180
|
+
| `DatePicker` | ✅ | Docked, modal, and input variants |
|
|
181
|
+
| `TimePicker` | ✅ | 12h/24h clock dial, range selection |
|
|
182
|
+
|
|
183
|
+
### Planned
|
|
184
|
+
|
|
185
|
+
| Component | Status | Description |
|
|
186
|
+
| --------- | ------ | ----------- |
|
|
187
|
+
| `Table` | 📋 | Data table |
|
|
188
|
+
|
|
189
|
+
**Legend:** ✅ Complete · 🚧 In Progress · 📋 Planned
|
|
170
190
|
|
|
171
191
|
---
|
|
172
192
|
|
package/dist/index.cjs
CHANGED
|
@@ -9335,13 +9335,30 @@ var FABMenuHeadless = React.forwardRef(
|
|
|
9335
9335
|
}
|
|
9336
9336
|
);
|
|
9337
9337
|
FABMenuHeadless.displayName = "FABMenuHeadless";
|
|
9338
|
-
var fabMenuVariants = classVarianceAuthority.cva(["relative", "inline-flex"
|
|
9338
|
+
var fabMenuVariants = classVarianceAuthority.cva(["relative", "inline-flex"]);
|
|
9339
|
+
var fabMenuListVariants = classVarianceAuthority.cva(["absolute", "z-10", "flex", "gap-3"], {
|
|
9339
9340
|
variants: {
|
|
9340
9341
|
direction: {
|
|
9341
|
-
up: ["flex-col-reverse", "
|
|
9342
|
-
down: ["flex-col", "
|
|
9343
|
-
left: [
|
|
9344
|
-
|
|
9342
|
+
up: ["bottom-full", "mb-3", "end-0", "flex-col-reverse", "items-end", "origin-bottom"],
|
|
9343
|
+
down: ["top-full", "mt-3", "end-0", "flex-col", "items-end", "origin-top"],
|
|
9344
|
+
left: [
|
|
9345
|
+
"end-full",
|
|
9346
|
+
"me-3",
|
|
9347
|
+
"top-1/2",
|
|
9348
|
+
"-translate-y-1/2",
|
|
9349
|
+
"flex-row-reverse",
|
|
9350
|
+
"items-center",
|
|
9351
|
+
"origin-right"
|
|
9352
|
+
],
|
|
9353
|
+
right: [
|
|
9354
|
+
"start-full",
|
|
9355
|
+
"ms-3",
|
|
9356
|
+
"top-1/2",
|
|
9357
|
+
"-translate-y-1/2",
|
|
9358
|
+
"flex-row",
|
|
9359
|
+
"items-center",
|
|
9360
|
+
"origin-left"
|
|
9361
|
+
]
|
|
9345
9362
|
}
|
|
9346
9363
|
},
|
|
9347
9364
|
defaultVariants: {
|
|
@@ -9349,19 +9366,129 @@ var fabMenuVariants = classVarianceAuthority.cva(["relative", "inline-flex", "it
|
|
|
9349
9366
|
}
|
|
9350
9367
|
});
|
|
9351
9368
|
var fabMenuItemVariants = classVarianceAuthority.cva(
|
|
9352
|
-
[
|
|
9369
|
+
[
|
|
9370
|
+
// Layout — full-rounded pill, NO overflow-hidden (focus ring extends outside)
|
|
9371
|
+
"relative inline-flex items-center cursor-pointer select-none",
|
|
9372
|
+
"rounded-full",
|
|
9373
|
+
"h-14 pl-4 pr-5 gap-3",
|
|
9374
|
+
// 56dp height, 16dp leading, 20dp trailing, 12dp gap
|
|
9375
|
+
// Effects transition for color/bg/shadow
|
|
9376
|
+
"transition-[color,background-color,box-shadow]",
|
|
9377
|
+
"duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
9378
|
+
// Disabled — self-targeting data-[x]: selectors
|
|
9379
|
+
"data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38",
|
|
9380
|
+
"data-[disabled]:shadow-none data-[disabled]:cursor-not-allowed data-[disabled]:pointer-events-none"
|
|
9381
|
+
],
|
|
9353
9382
|
{
|
|
9354
9383
|
variants: {
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9384
|
+
/**
|
|
9385
|
+
* Color role — controls container background, text color, and elevation.
|
|
9386
|
+
* State-layer color must equal the on-color (see fabMenuItemStateLayerVariants).
|
|
9387
|
+
*
|
|
9388
|
+
* Elevation per state:
|
|
9389
|
+
* base → elevation-3
|
|
9390
|
+
* hover → elevation-4 (group-data-[hovered]/fab-menu-item)
|
|
9391
|
+
* focus → elevation-3 (doubled selector wins over hover)
|
|
9392
|
+
* pressed→ elevation-3 (doubled selector wins over hover)
|
|
9393
|
+
* disabled → shadow-none (self-targeting data-[disabled])
|
|
9394
|
+
*/
|
|
9395
|
+
color: {
|
|
9396
|
+
"primary-container": [
|
|
9397
|
+
"bg-primary-container text-on-primary-container",
|
|
9398
|
+
"shadow-elevation-3",
|
|
9399
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9400
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9401
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9402
|
+
],
|
|
9403
|
+
"secondary-container": [
|
|
9404
|
+
"bg-secondary-container text-on-secondary-container",
|
|
9405
|
+
"shadow-elevation-3",
|
|
9406
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9407
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9408
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9409
|
+
],
|
|
9410
|
+
"tertiary-container": [
|
|
9411
|
+
"bg-tertiary-container text-on-tertiary-container",
|
|
9412
|
+
"shadow-elevation-3",
|
|
9413
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9414
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9415
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9416
|
+
],
|
|
9417
|
+
primary: [
|
|
9418
|
+
"bg-primary text-on-primary",
|
|
9419
|
+
"shadow-elevation-3",
|
|
9420
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9421
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9422
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9423
|
+
],
|
|
9424
|
+
secondary: [
|
|
9425
|
+
"bg-secondary text-on-secondary",
|
|
9426
|
+
"shadow-elevation-3",
|
|
9427
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9428
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9429
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9430
|
+
],
|
|
9431
|
+
tertiary: [
|
|
9432
|
+
"bg-tertiary text-on-tertiary",
|
|
9433
|
+
"shadow-elevation-3",
|
|
9434
|
+
"group-data-[hovered]/fab-menu-item:shadow-elevation-4",
|
|
9435
|
+
"group-data-[focus-visible]/fab-menu-item:shadow-elevation-3",
|
|
9436
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:shadow-elevation-3"
|
|
9437
|
+
]
|
|
9358
9438
|
}
|
|
9359
9439
|
},
|
|
9360
9440
|
defaultVariants: {
|
|
9361
|
-
|
|
9441
|
+
color: "primary-container"
|
|
9362
9442
|
}
|
|
9363
9443
|
}
|
|
9364
9444
|
);
|
|
9445
|
+
var fabMenuItemStateLayerVariants = classVarianceAuthority.cva(
|
|
9446
|
+
[
|
|
9447
|
+
"absolute inset-0 rounded-[inherit] overflow-hidden pointer-events-none opacity-0",
|
|
9448
|
+
// Effects transition — opacity must not overshoot
|
|
9449
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
9450
|
+
// Hover: 8%
|
|
9451
|
+
"group-data-[hovered]/fab-menu-item:opacity-8",
|
|
9452
|
+
// Focus: 10%
|
|
9453
|
+
"group-data-[focus-visible]/fab-menu-item:opacity-10",
|
|
9454
|
+
// Pressed: 10% — doubled selector wins over hover's 8%
|
|
9455
|
+
"group-data-[pressed]/fab-menu-item:group-data-[pressed]/fab-menu-item:opacity-10",
|
|
9456
|
+
// No state layer when disabled
|
|
9457
|
+
"group-data-[disabled]/fab-menu-item:hidden"
|
|
9458
|
+
],
|
|
9459
|
+
{
|
|
9460
|
+
variants: {
|
|
9461
|
+
color: {
|
|
9462
|
+
"primary-container": "bg-on-primary-container",
|
|
9463
|
+
"secondary-container": "bg-on-secondary-container",
|
|
9464
|
+
"tertiary-container": "bg-on-tertiary-container",
|
|
9465
|
+
primary: "bg-on-primary",
|
|
9466
|
+
secondary: "bg-on-secondary",
|
|
9467
|
+
tertiary: "bg-on-tertiary"
|
|
9468
|
+
}
|
|
9469
|
+
},
|
|
9470
|
+
defaultVariants: { color: "primary-container" }
|
|
9471
|
+
}
|
|
9472
|
+
);
|
|
9473
|
+
var fabMenuItemFocusRingVariants = classVarianceAuthority.cva([
|
|
9474
|
+
"pointer-events-none absolute inset-[-3px] rounded-full",
|
|
9475
|
+
"outline outline-2 outline-offset-0 outline-secondary",
|
|
9476
|
+
// Effects transition — opacity change must not overshoot
|
|
9477
|
+
"transition-opacity duration-spring-standard-fast-effects ease-spring-standard-fast-effects",
|
|
9478
|
+
"opacity-0",
|
|
9479
|
+
"group-data-[focus-visible]/fab-menu-item:opacity-100"
|
|
9480
|
+
]);
|
|
9481
|
+
var fabMenuItemIconVariants = classVarianceAuthority.cva([
|
|
9482
|
+
"relative z-10 inline-flex shrink-0 items-center justify-center",
|
|
9483
|
+
"size-6",
|
|
9484
|
+
// 24dp per MD3 spec
|
|
9485
|
+
// Color transition uses effects token (no spatial overshoot on color)
|
|
9486
|
+
"transition-colors duration-spring-standard-fast-effects ease-spring-standard-fast-effects"
|
|
9487
|
+
]);
|
|
9488
|
+
var fabMenuItemLabelVariants = classVarianceAuthority.cva([
|
|
9489
|
+
"relative z-10 inline-flex items-center",
|
|
9490
|
+
"text-title-medium"
|
|
9491
|
+
]);
|
|
9365
9492
|
var FABMenu = React.forwardRef(
|
|
9366
9493
|
({
|
|
9367
9494
|
open: controlledOpen,
|
|
@@ -9400,7 +9527,7 @@ var FABMenu = React.forwardRef(
|
|
|
9400
9527
|
setIsOpen(false);
|
|
9401
9528
|
}, [setIsOpen]);
|
|
9402
9529
|
const prevIsOpenRef = React.useRef(void 0);
|
|
9403
|
-
React.
|
|
9530
|
+
React.useLayoutEffect(() => {
|
|
9404
9531
|
if (prevIsOpenRef.current === void 0) {
|
|
9405
9532
|
prevIsOpenRef.current = isOpen;
|
|
9406
9533
|
return;
|
|
@@ -9463,119 +9590,143 @@ var FABMenu = React.forwardRef(
|
|
|
9463
9590
|
}
|
|
9464
9591
|
return child;
|
|
9465
9592
|
});
|
|
9466
|
-
return /* @__PURE__ */ jsxRuntime.jsx(FABMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9593
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FABMenuContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: rootRef, className: cn(fabMenuVariants(), className), onKeyDown: handleKeyDown, children: [
|
|
9594
|
+
(isOpen || isExiting) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
9595
|
+
"div",
|
|
9596
|
+
{
|
|
9597
|
+
className: cn(fabMenuListVariants({ direction })),
|
|
9598
|
+
role: "group",
|
|
9599
|
+
"aria-label": `${ariaLabel} actions`,
|
|
9600
|
+
children: indexedChildren
|
|
9601
|
+
}
|
|
9602
|
+
),
|
|
9603
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9604
|
+
FAB,
|
|
9605
|
+
{
|
|
9606
|
+
ref: triggerRef,
|
|
9607
|
+
onPress: toggle,
|
|
9608
|
+
"aria-label": ariaLabel,
|
|
9609
|
+
"aria-expanded": isOpen,
|
|
9610
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9611
|
+
"svg",
|
|
9475
9612
|
{
|
|
9613
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9614
|
+
viewBox: "0 0 24 24",
|
|
9615
|
+
fill: "currentColor",
|
|
9476
9616
|
className: cn(
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
direction === "right" && "flex-row"
|
|
9617
|
+
// Expressive fast-spatial: FAB icon is small, high-emphasis — matches FAB enter motion
|
|
9618
|
+
"h-6 w-6 transition-transform",
|
|
9619
|
+
reducedMotion ? "" : "duration-expressive-fast-spatial ease-expressive-fast-spatial",
|
|
9620
|
+
isOpen && "rotate-45"
|
|
9482
9621
|
),
|
|
9483
|
-
|
|
9484
|
-
"
|
|
9485
|
-
children: indexedChildren
|
|
9622
|
+
"aria-hidden": "true",
|
|
9623
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })
|
|
9486
9624
|
}
|
|
9487
9625
|
),
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
onPress: toggle,
|
|
9493
|
-
"aria-label": ariaLabel,
|
|
9494
|
-
"aria-expanded": isOpen,
|
|
9495
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9496
|
-
"svg",
|
|
9497
|
-
{
|
|
9498
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9499
|
-
viewBox: "0 0 24 24",
|
|
9500
|
-
fill: "currentColor",
|
|
9501
|
-
className: cn(
|
|
9502
|
-
"duration-short4 ease-standard h-6 w-6 transition-transform",
|
|
9503
|
-
isOpen && "rotate-45"
|
|
9504
|
-
),
|
|
9505
|
-
"aria-hidden": "true",
|
|
9506
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" })
|
|
9507
|
-
}
|
|
9508
|
-
),
|
|
9509
|
-
className: cn(isOpen && "shadow-elevation-4")
|
|
9510
|
-
}
|
|
9511
|
-
)
|
|
9512
|
-
]
|
|
9513
|
-
}
|
|
9514
|
-
) });
|
|
9626
|
+
className: cn(isOpen && "shadow-elevation-4")
|
|
9627
|
+
}
|
|
9628
|
+
)
|
|
9629
|
+
] }) });
|
|
9515
9630
|
}
|
|
9516
9631
|
);
|
|
9517
9632
|
FABMenu.displayName = "FABMenu";
|
|
9518
9633
|
var FABMenuItem = React.forwardRef(
|
|
9519
|
-
({
|
|
9634
|
+
({
|
|
9635
|
+
icon,
|
|
9636
|
+
label,
|
|
9637
|
+
"aria-label": ariaLabel,
|
|
9638
|
+
onPress,
|
|
9639
|
+
color = "primary-container",
|
|
9640
|
+
isDisabled = false,
|
|
9641
|
+
className,
|
|
9642
|
+
index = 0
|
|
9643
|
+
}, forwardedRef) => {
|
|
9520
9644
|
const internalRef = React.useRef(null);
|
|
9521
9645
|
const buttonRef = forwardedRef ?? internalRef;
|
|
9522
|
-
const { isOpen, isExiting,
|
|
9646
|
+
const { isOpen, isExiting, reducedMotion, itemCount, direction } = useFABMenuContext();
|
|
9647
|
+
if (process.env.NODE_ENV === "development") {
|
|
9648
|
+
if (!label && !ariaLabel) {
|
|
9649
|
+
console.warn(
|
|
9650
|
+
"[FABMenuItem] Either `label` or `aria-label` must be provided for accessibility."
|
|
9651
|
+
);
|
|
9652
|
+
}
|
|
9653
|
+
}
|
|
9654
|
+
const [isPressed, setIsPressed] = React.useState(false);
|
|
9655
|
+
const handlePressStart = React.useCallback(() => setIsPressed(true), []);
|
|
9656
|
+
const handlePressEnd = React.useCallback(() => setIsPressed(false), []);
|
|
9657
|
+
const { isHovered, hoverProps } = reactAria.useHover({ isDisabled });
|
|
9658
|
+
const { isFocusVisible, focusProps } = reactAria.useFocusRing();
|
|
9523
9659
|
const { buttonProps } = reactAria.useButton(
|
|
9524
9660
|
{
|
|
9525
|
-
...onPress
|
|
9526
|
-
|
|
9527
|
-
|
|
9661
|
+
...onPress ? { onPress } : {},
|
|
9662
|
+
isDisabled,
|
|
9663
|
+
onPressStart: handlePressStart,
|
|
9664
|
+
onPressEnd: handlePressEnd,
|
|
9665
|
+
...ariaLabel ? { "aria-label": ariaLabel } : {},
|
|
9666
|
+
elementType: "button"
|
|
9528
9667
|
},
|
|
9529
9668
|
buttonRef
|
|
9530
9669
|
);
|
|
9531
|
-
const { onMouseDown: handleRipple, ripples } = useRipple({
|
|
9532
|
-
disabled: isDisabled
|
|
9533
|
-
});
|
|
9534
|
-
const mergedProps = utils.mergeProps(buttonProps, {
|
|
9535
|
-
type: "button",
|
|
9536
|
-
onMouseDown: handleRipple
|
|
9537
|
-
});
|
|
9670
|
+
const { onMouseDown: handleRipple, ripples } = useRipple({ disabled: isDisabled });
|
|
9538
9671
|
const staggerDelay = reducedMotion ? 0 : isExiting ? Math.max(0, itemCount - 1 - index) * 30 : index * 30;
|
|
9672
|
+
const DIRECTION_ORIGIN = {
|
|
9673
|
+
up: "origin-bottom",
|
|
9674
|
+
down: "origin-top",
|
|
9675
|
+
left: "origin-right",
|
|
9676
|
+
right: "origin-left"
|
|
9677
|
+
};
|
|
9678
|
+
const originClass = reducedMotion ? void 0 : DIRECTION_ORIGIN[direction];
|
|
9539
9679
|
const animationClass = reducedMotion ? void 0 : isOpen ? "animate-md-scale-in" : isExiting ? "animate-md-scale-out" : void 0;
|
|
9540
|
-
const
|
|
9541
|
-
|
|
9542
|
-
|
|
9680
|
+
const mergedButtonProps = reactAria.mergeProps(buttonProps, hoverProps, focusProps, {
|
|
9681
|
+
onMouseDown: handleRipple
|
|
9682
|
+
});
|
|
9683
|
+
const {
|
|
9684
|
+
isDisabled: _isDisabled,
|
|
9685
|
+
onPress: _onPress,
|
|
9686
|
+
onPressStart: _onPressStart,
|
|
9687
|
+
onPressEnd: _onPressEnd,
|
|
9688
|
+
onPressChange: _onPressChange,
|
|
9689
|
+
onPressUp: _onPressUp,
|
|
9690
|
+
...htmlButtonProps
|
|
9691
|
+
} = mergedButtonProps;
|
|
9543
9692
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
9544
|
-
"
|
|
9693
|
+
"button",
|
|
9545
9694
|
{
|
|
9695
|
+
...htmlButtonProps,
|
|
9696
|
+
ref: buttonRef,
|
|
9697
|
+
type: "button",
|
|
9698
|
+
...getInteractionDataAttributes({
|
|
9699
|
+
isHovered,
|
|
9700
|
+
isFocusVisible,
|
|
9701
|
+
isPressed,
|
|
9702
|
+
isDisabled
|
|
9703
|
+
}),
|
|
9704
|
+
"data-with-icon": icon ? "" : void 0,
|
|
9705
|
+
"data-with-label": label ? "" : void 0,
|
|
9546
9706
|
className: cn(
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9707
|
+
fabMenuItemVariants({ color }),
|
|
9708
|
+
// group/fab-menu-item: enables group-data-[x]/fab-menu-item child selectors in all slots
|
|
9709
|
+
"group/fab-menu-item",
|
|
9710
|
+
// Scale pivot toward the FAB so items appear to emanate from the trigger
|
|
9711
|
+
originClass,
|
|
9712
|
+
// Stagger animation class (animate-md-scale-in / animate-md-scale-out)
|
|
9713
|
+
animationClass,
|
|
9550
9714
|
className
|
|
9551
9715
|
),
|
|
9716
|
+
style: staggerDelay > 0 ? { animationDelay: `${staggerDelay}ms` } : void 0,
|
|
9552
9717
|
children: [
|
|
9553
|
-
|
|
9554
|
-
/* @__PURE__ */ jsxRuntime.
|
|
9555
|
-
"
|
|
9718
|
+
ripples,
|
|
9719
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9720
|
+
"span",
|
|
9556
9721
|
{
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
"relative flex size-10 items-center justify-center overflow-hidden rounded-xl",
|
|
9561
|
-
"bg-primary-container text-on-primary-container shadow-elevation-3",
|
|
9562
|
-
animationClass
|
|
9563
|
-
),
|
|
9564
|
-
style: staggerDelay > 0 ? { animationDelay: `${staggerDelay}ms` } : void 0,
|
|
9565
|
-
children: [
|
|
9566
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9567
|
-
"span",
|
|
9568
|
-
{
|
|
9569
|
-
"data-state-layer": true,
|
|
9570
|
-
className: "bg-on-primary-container duration-spring-standard-fast-effects ease-spring-standard-fast-effects pointer-events-none absolute inset-0 rounded-xl opacity-0 transition-opacity hover:opacity-8"
|
|
9571
|
-
}
|
|
9572
|
-
),
|
|
9573
|
-
ripples,
|
|
9574
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "relative z-10 inline-flex shrink-0", children: icon })
|
|
9575
|
-
]
|
|
9722
|
+
className: cn(fabMenuItemStateLayerVariants({ color })),
|
|
9723
|
+
"data-state-layer": true,
|
|
9724
|
+
"aria-hidden": "true"
|
|
9576
9725
|
}
|
|
9577
9726
|
),
|
|
9578
|
-
|
|
9727
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(fabMenuItemFocusRingVariants()), "aria-hidden": "true" }),
|
|
9728
|
+
icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(fabMenuItemIconVariants()), "aria-hidden": "true", children: icon }),
|
|
9729
|
+
label && /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(fabMenuItemLabelVariants()), children: label })
|
|
9579
9730
|
]
|
|
9580
9731
|
}
|
|
9581
9732
|
);
|
|
@@ -15282,7 +15433,12 @@ exports.datePickerScrimVariants = datePickerScrimVariants;
|
|
|
15282
15433
|
exports.datePickerSupportingTextVariants = datePickerSupportingTextVariants;
|
|
15283
15434
|
exports.datePickerWeekdayVariants = datePickerWeekdayVariants;
|
|
15284
15435
|
exports.dividerVariants = dividerVariants;
|
|
15436
|
+
exports.fabMenuItemFocusRingVariants = fabMenuItemFocusRingVariants;
|
|
15437
|
+
exports.fabMenuItemIconVariants = fabMenuItemIconVariants;
|
|
15438
|
+
exports.fabMenuItemLabelVariants = fabMenuItemLabelVariants;
|
|
15439
|
+
exports.fabMenuItemStateLayerVariants = fabMenuItemStateLayerVariants;
|
|
15285
15440
|
exports.fabMenuItemVariants = fabMenuItemVariants;
|
|
15441
|
+
exports.fabMenuListVariants = fabMenuListVariants;
|
|
15286
15442
|
exports.fabMenuVariants = fabMenuVariants;
|
|
15287
15443
|
exports.generateMD3Theme = generateMD3Theme;
|
|
15288
15444
|
exports.getColorValue = getColorValue;
|