@m3-baseui/react-tailwind 1.0.4 → 1.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/dist/bottom-app-bar.d.ts +62 -0
- package/dist/bottom-app-bar.js +51 -0
- package/dist/bottom-app-bar.js.map +1 -0
- package/dist/bottom-sheet.d.ts +101 -0
- package/dist/bottom-sheet.js +70 -0
- package/dist/bottom-sheet.js.map +1 -0
- package/dist/button-group.d.ts +48 -0
- package/dist/button-group.js +58 -0
- package/dist/button-group.js.map +1 -0
- package/dist/carousel.d.ts +115 -0
- package/dist/carousel.js +63 -0
- package/dist/carousel.js.map +1 -0
- package/dist/chip.js +5 -2
- package/dist/chip.js.map +1 -1
- package/dist/date-picker.d.ts +188 -0
- package/dist/date-picker.js +151 -0
- package/dist/date-picker.js.map +1 -0
- package/dist/fab-menu.d.ts +132 -0
- package/dist/fab-menu.js +116 -0
- package/dist/fab-menu.js.map +1 -0
- package/dist/icon-button.js +4 -1
- package/dist/icon-button.js.map +1 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +654 -11
- package/dist/index.js.map +1 -1
- package/dist/loading-indicator.d.ts +68 -0
- package/dist/loading-indicator.js +61 -0
- package/dist/loading-indicator.js.map +1 -0
- package/dist/menu.d.ts +5 -5
- package/dist/navigation-bar.d.ts +5 -5
- package/dist/navigation-rail.d.ts +101 -0
- package/dist/navigation-rail.js +92 -0
- package/dist/navigation-rail.js.map +1 -0
- package/dist/search.d.ts +148 -0
- package/dist/search.js +105 -0
- package/dist/search.js.map +1 -0
- package/dist/segmented-button.d.ts +5 -5
- package/dist/select.d.ts +5 -5
- package/dist/side-sheet.d.ts +112 -0
- package/dist/side-sheet.js +90 -0
- package/dist/side-sheet.js.map +1 -0
- package/dist/split-button.d.ts +201 -0
- package/dist/split-button.js +126 -0
- package/dist/split-button.js.map +1 -0
- package/dist/time-picker.d.ts +144 -0
- package/dist/time-picker.js +101 -0
- package/dist/time-picker.js.map +1 -0
- package/dist/toolbar.d.ts +73 -0
- package/dist/toolbar.js +55 -0
- package/dist/toolbar.js.map +1 -0
- package/dist/top-app-bar.d.ts +147 -0
- package/dist/top-app-bar.js +68 -0
- package/dist/top-app-bar.js.map +1 -0
- package/package.json +71 -1
- package/styles/preset.css +15 -0
package/dist/icon-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/icon-button.ts"],"names":[],"mappings":";;;;;AAYA,IAAM,MAAA,GAAS;AAAA,EACb,IAAI,EAAE,MAAA,EAAQ,OAAO,OAAA,EAAS,KAAA,EAAO,MAAM,MAAA,EAAO;AAAA;AAAA,EAClD,GAAG,EAAE,MAAA,EAAQ,OAAO,OAAA,EAAS,MAAA,EAAQ,MAAM,MAAA,EAAO;AAAA;AAAA,EAClD,GAAG,EAAE,MAAA,EAAQ,QAAQ,OAAA,EAAS,MAAA,EAAQ,MAAM,MAAA,EAAO;AAAA;AAAA,EACnD,GAAG,EAAE,MAAA,EAAQ,QAAQ,OAAA,EAAS,MAAA,EAAQ,MAAM,MAAA,EAAO;AAAA;AAAA,EACnD,IAAI,EAAE,MAAA,EAAQ,QAAQ,OAAA,EAAS,MAAA,EAAQ,MAAM,MAAA;AAAO;AACtD,CAAA;AAEA,IAAM,cAAA,GAAiB,MAAA,CAAO,OAAA,CAAQ,MAAM,CAAA,CAAE,OAAA;AAAA,EAAQ,CAAC,CAAC,IAAA,EAAM,CAAC,MAC7D,MAAA,CAAO,OAAA,CAAQ,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,CAAC,KAAA,EAAO,KAAK,CAAA,MAAO;AAAA,IACzC,IAAA;AAAA,IACA,KAAA;AAAA,IACA,KAAA,EAAO;AAAA,GACT,CAAE;AACJ,CAAA;AAEO,IAAM,aAAa,EAAA,CAAG;AAAA,EAC3B,IAAA,EAAM;AAAA,IACJ,2DAAA;AAAA,
|
|
1
|
+
{"version":3,"sources":["../src/icon-button.ts"],"names":[],"mappings":";;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IAAA,EAAM,GAAA;AAAA,IACN,KAAA,EAAO;AAAA;AAEX,CAAC;AAEM,IAAM,UAAA,GAAa,gBAAA;AAAA,EAAiB,CAAC,EAAE,OAAA,EAAS,QAAA,EAAU,IAAA,EAAM,KAAA,EAAM,KAC3E,UAAA,CAAW,EAAE,OAAA,EAAS,QAAA,EAAU,IAAA,EAAM,OAAO;AAC/C","file":"icon-button.js","sourcesContent":["/**\n * icon-button.ts — tailwind-variants resolver for the M3 Icon Button.\n *\n * 40×40 circular target with a centered icon. The `selected` variant supports\n * toggle icon buttons; when `selected` is undefined the variant's default\n * (filled/active) look is used. Emits the same DOM + ripple as the VE build.\n */\nimport { createIconButton } from '@m3-baseui/core';\nimport { tv } from 'tailwind-variants';\n\n// M3 Expressive container widths (px) per size × width. Tailwind v4's dynamic\n// spacing scale resolves any integer (e.g. w-13 = 52px, w-46 = 184px).\nconst WIDTHS = {\n xs: { narrow: 'w-7', default: 'w-8', wide: 'w-10' }, // 28 / 32 / 40\n s: { narrow: 'w-8', default: 'w-10', wide: 'w-13' }, // 32 / 40 / 52\n m: { narrow: 'w-12', default: 'w-14', wide: 'w-18' }, // 48 / 56 / 72\n l: { narrow: 'w-16', default: 'w-24', wide: 'w-32' }, // 64 / 96 / 128\n xl: { narrow: 'w-26', default: 'w-34', wide: 'w-46' }, // 104 / 136 / 184\n} as const;\n\nconst widthCompounds = Object.entries(WIDTHS).flatMap(([size, w]) =>\n Object.entries(w).map(([width, klass]) => ({\n size: size as keyof typeof WIDTHS,\n width: width as 'narrow' | 'default' | 'wide',\n class: klass,\n })),\n);\n\nexport const iconButton = tv({\n base: [\n 'relative inline-flex items-center justify-center shrink-0',\n // No `overflow-hidden`: it would clip the 48dp touch target on small sizes.\n // The state layer is already rounded (before:rounded-[inherit]); the ripple\n // self-clips.\n 'rounded-full cursor-pointer select-none border-0 bg-transparent',\n 'transition-[box-shadow,background-color,color] duration-200 ease-standard',\n // State layer overlay\n 'before:absolute before:inset-0 before:rounded-[inherit] before:bg-current before:opacity-0 before:pointer-events-none',\n 'before:transition-opacity before:duration-100',\n 'hover:before:opacity-[var(--md-sys-state-hover)]',\n 'focus-visible:before:opacity-[var(--md-sys-state-focus)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n 'data-[pressed]:before:opacity-[var(--md-sys-state-pressed)]',\n // Focus ring (M3: 3px secondary, 2px offset)\n 'focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary',\n // Disabled: no interaction, no state layer. Per-variant disabled colors\n // (container on-surface/12, icon on-surface/38) live on each variant.\n 'disabled:pointer-events-none disabled:before:opacity-0',\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0',\n ],\n variants: {\n // Disabled icon is on-surface/38 for every variant; filled/tonal disabled\n // container is on-surface/12; outlined disabled outline is on-surface/12\n // (material-web parity).\n variant: {\n standard: [\n 'text-on-surface-variant',\n 'disabled:text-on-surface/38 data-[disabled]:text-on-surface/38',\n ],\n filled: [\n 'bg-primary text-on-primary',\n 'disabled:bg-on-surface/12 disabled:text-on-surface/38',\n 'data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38',\n ],\n tonal: [\n 'bg-secondary-container text-on-secondary-container',\n 'disabled:bg-on-surface/12 disabled:text-on-surface/38',\n 'data-[disabled]:bg-on-surface/12 data-[disabled]:text-on-surface/38',\n ],\n outlined: [\n 'border border-outline text-on-surface-variant',\n 'disabled:border-on-surface/12 disabled:text-on-surface/38',\n 'data-[disabled]:border-on-surface/12 data-[disabled]:text-on-surface/38',\n ],\n },\n selected: {\n true: '',\n false: '',\n },\n // Container height + icon size per M3 Expressive size. Width comes from the\n // (size, width) compound variants below.\n size: {\n xs: 'h-8 [&>svg]:size-5',\n s: 'h-10 [&>svg]:size-6',\n m: 'h-14 [&>svg]:size-6',\n l: 'h-24 [&>svg]:size-8',\n xl: 'h-[136px] [&>svg]:size-10',\n },\n width: {\n narrow: '',\n default: '',\n wide: '',\n },\n },\n compoundVariants: [\n ...widthCompounds,\n { variant: 'standard', selected: true, class: 'text-primary' },\n { variant: 'filled', selected: false, class: 'bg-surface-container-highest text-primary' },\n {\n variant: 'tonal',\n selected: false,\n class: 'bg-surface-container-highest text-on-surface-variant',\n },\n {\n variant: 'outlined',\n selected: true,\n class: [\n 'bg-inverse-surface text-inverse-on-surface border-transparent',\n // M3 disabled + selected: faint on-surface/12 container, no outline\n // (icon falls back to on-surface/38 from the variant). NOT transparent.\n 'disabled:bg-on-surface/12 disabled:border-transparent',\n 'data-[disabled]:bg-on-surface/12 data-[disabled]:border-transparent',\n ],\n },\n ],\n defaultVariants: {\n variant: 'standard',\n size: 's',\n width: 'default',\n },\n});\n\nexport const IconButton = createIconButton(({ variant, selected, size, width }) =>\n iconButton({ variant, selected, size, width }),\n);\nexport type { IconButtonProps, IconButtonVariant } from '@m3-baseui/core';\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,16 +13,30 @@ export { Select, selectTv } from './select.js';
|
|
|
13
13
|
export { TextField, textFieldTv } from './textfield.js';
|
|
14
14
|
export { NavigationBar, navigationBarTv } from './navigation-bar.js';
|
|
15
15
|
export { Fab, fabTv } from './fab.js';
|
|
16
|
+
export { FabMenu, fabMenuTv } from './fab-menu.js';
|
|
16
17
|
export { Divider, dividerTv } from './divider.js';
|
|
17
18
|
export { Progress, circularTv, linearTv } from './progress.js';
|
|
19
|
+
export { LoadingIndicator, loadingIndicatorTv } from './loading-indicator.js';
|
|
18
20
|
export { List, listTv } from './list.js';
|
|
19
21
|
export { Snackbar, snackbarTv } from './snackbar.js';
|
|
20
22
|
export { Item, itemTv } from './item.js';
|
|
21
23
|
export { Badge, badgeTv } from './badge.js';
|
|
22
24
|
export { Card, cardTv } from './card.js';
|
|
23
25
|
export { SegmentedButton, segmentedButtonTv } from './segmented-button.js';
|
|
26
|
+
export { ButtonGroup, buttonGroup } from './button-group.js';
|
|
27
|
+
export { SplitButton, splitButtonTv } from './split-button.js';
|
|
24
28
|
export { NavigationDrawer, navigationDrawerTv } from './navigation-drawer.js';
|
|
25
|
-
export {
|
|
29
|
+
export { TopAppBar, topAppBarTv } from './top-app-bar.js';
|
|
30
|
+
export { BottomAppBar, bottomAppBarTv } from './bottom-app-bar.js';
|
|
31
|
+
export { NavigationRail, navigationRailTv } from './navigation-rail.js';
|
|
32
|
+
export { BottomSheet, bottomSheetTv } from './bottom-sheet.js';
|
|
33
|
+
export { SideSheet, sideSheetTv } from './side-sheet.js';
|
|
34
|
+
export { Search, searchTv } from './search.js';
|
|
35
|
+
export { DatePicker, datePickerTv } from './date-picker.js';
|
|
36
|
+
export { TimePicker, timePickerTv } from './time-picker.js';
|
|
37
|
+
export { BadgeProps, BadgeSize, BottomAppBarProps, BottomSheetVariant, ButtonGroupProps, ButtonGroupVariant, ButtonProps, ButtonVariant, CardProps, CardVariant, CarouselVariant, ChipProps, ChipVariant, CircularProgressProps, ContrastLevel, DividerInset, DividerOrientation, DividerProps, FabColor, FabMenuItemProps, FabMenuTriggerProps, FabProps, FabSize, IconButtonProps, IconButtonVariant, ItemProps, LinearProgressProps, ListItemLines, ListItemProps, LoadingIndicatorProps, NavigationDrawerVariant, Ripple, SchemeVariant, SideSheetSide, SideSheetVariant, TabsVariant, TextFieldProps, TextFieldVariant, ThemeMode, ThemeProvider, ThemeProviderProps, TimePickerVariant, TimeValue, ToolbarOrientation, ToolbarProps, ToolbarVariant, TopAppBarProps, TopAppBarVariant, applyScheme, generateScheme, schemeToCssText, useSnackbar, useTheme } from '@m3-baseui/core';
|
|
38
|
+
export { Toolbar, toolbarTv } from './toolbar.js';
|
|
39
|
+
export { Carousel, carouselTv } from './carousel.js';
|
|
26
40
|
import '@base-ui/react';
|
|
27
41
|
import 'react';
|
|
28
42
|
import 'tailwind-variants';
|