@m3-baseui/react-tailwind 1.0.2 → 1.0.4
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/card.js +2 -0
- package/dist/card.js.map +1 -1
- package/dist/checkbox.d.ts +5 -5
- package/dist/divider.js +2 -1
- package/dist/divider.js.map +1 -1
- package/dist/index.js +31 -9
- package/dist/index.js.map +1 -1
- package/dist/item.d.ts +5 -5
- package/dist/navigation-bar.d.ts +5 -5
- package/dist/navigation-bar.js +20 -4
- package/dist/navigation-bar.js.map +1 -1
- package/dist/progress.d.ts +12 -12
- package/dist/progress.js.map +1 -1
- package/dist/segmented-button.d.ts +10 -10
- package/dist/slider.d.ts +5 -5
- package/dist/slider.js +1 -1
- package/dist/slider.js.map +1 -1
- package/dist/snackbar.d.ts +5 -5
- package/dist/snackbar.js +1 -1
- package/dist/snackbar.js.map +1 -1
- package/dist/textfield.js +5 -2
- package/dist/textfield.js.map +1 -1
- package/package.json +1 -1
- package/styles/preset.css +2 -1
package/dist/card.js
CHANGED
|
@@ -43,6 +43,8 @@ var cardTv = tv({
|
|
|
43
43
|
interactive: {
|
|
44
44
|
true: [
|
|
45
45
|
"group overflow-hidden cursor-pointer select-none text-left w-full outline-none",
|
|
46
|
+
// Animate the elevation lift/settle to match the VE box-shadow transition.
|
|
47
|
+
"transition-shadow duration-150 ease-standard",
|
|
46
48
|
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
47
49
|
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
48
50
|
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
package/dist/card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/tv.ts","../src/card.ts"],"names":["baseTv"],"mappings":";;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,g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AS,WAAA,OAAkB,MAAA,CAAO,EAAE,OAAA,EAAS,WAAA,EAAa;AACrE,CAAC","file":"card.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * card.ts — tailwind-variants slots for the M3 Card.\n *\n * 12dp corners. `elevated` is surface-container-low + level1, `filled` is\n * surface-container-highest (level0), `outlined` is surface + outline-variant.\n * Interactive cards add the `currentColor` state-layer `::before` (the pointer\n * ripple is added by the factory), a focus ring and per-token disabled dimming.\n * Same DOM + `data-*` as the VE build.\n */\nimport { createCard } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const cardTv = tv({\n base: 'relative box-border rounded-medium text-on-surface',\n variants: {\n variant: {\n elevated: 'bg-surface-container-low shadow-level1',\n filled: 'bg-surface-container-highest',\n outlined: 'bg-surface border border-outline-variant',\n },\n interactive: {\n true: [\n 'group overflow-hidden cursor-pointer select-none text-left w-full outline-none',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none 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 'focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary',\n // M3 disabled: drop the shadow + state layer, dim the content per-token.\n 'disabled:pointer-events-none disabled:before:opacity-0 disabled:shadow-none disabled:text-on-surface/38',\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0 data-[disabled]:shadow-none data-[disabled]:text-on-surface/38',\n ],\n false: '',\n },\n },\n compoundVariants: [\n // M3 interactive elevated: lifts to level2 on hover, settles to level1 on press.\n {\n variant: 'elevated',\n interactive: true,\n class: 'hover:shadow-level2 active:shadow-level1',\n },\n ],\n defaultVariants: {\n variant: 'elevated',\n interactive: false,\n },\n});\n\nexport const Card = createCard({\n root: ({ variant, interactive }) => cardTv({ variant, interactive }),\n});\nexport type { CardProps, CardVariant } from '@m3-baseui/core';\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/tv.ts","../src/card.ts"],"names":["baseTv"],"mappings":";;;;;AAeA,IAAM,SAAA,GAAY;AAAA,EAChB,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,gBAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,YAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA;AAEO,IAAM,EAAA,GAAS,CAAC,OAAA,EAAS,MAAA,KAC9BA,KAAO,OAAA,EAAS;AAAA,EACd,GAAG,MAAA;AAAA,EACH,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ;AAAA,MACN,WAAA,EAAa;AAAA,QACX,WAAA,EAAa,CAAC,EAAE,IAAA,EAAM,CAAC,GAAG,SAAS,GAAG;AAAA;AACxC;AACF;AAEJ,CAAC,CAAA;;;AC/BI,IAAM,SAAS,EAAA,CAAG;AAAA,EACvB,IAAA,EAAM,oDAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,OAAA,EAAS;AAAA,MACP,QAAA,EAAU,wCAAA;AAAA,MACV,MAAA,EAAQ,8BAAA;AAAA,MACR,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,WAAA,EAAa;AAAA,MACX,IAAA,EAAM;AAAA,QACJ,gFAAA;AAAA;AAAA,QAEA,8CAAA;AAAA,QACA,4IAAA;AAAA,QACA,kDAAA;AAAA,QACA,0DAAA;AAAA,QACA,qDAAA;AAAA,QACA,4FAAA;AAAA;AAAA,QAEA,yGAAA;AAAA,QACA;AAAA,OACF;AAAA,MACA,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,gBAAA,EAAkB;AAAA;AAAA,IAEhB;AAAA,MACE,OAAA,EAAS,UAAA;AAAA,MACT,WAAA,EAAa,IAAA;AAAA,MACb,KAAA,EAAO;AAAA;AACT,GACF;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,OAAA,EAAS,UAAA;AAAA,IACT,WAAA,EAAa;AAAA;AAEjB,CAAC;AAEM,IAAM,OAAO,UAAA,CAAW;AAAA,EAC7B,IAAA,EAAM,CAAC,EAAE,OAAA,EAAS,WAAA,OAAkB,MAAA,CAAO,EAAE,OAAA,EAAS,WAAA,EAAa;AACrE,CAAC","file":"card.js","sourcesContent":["/**\n * tv.ts — a tailwind-variants factory pre-configured for the M3 typescale.\n *\n * The Tailwind v4 preset exposes the 15 typescale roles as `text-<role>`\n * font-size utilities (e.g. `text-body-small`, `text-label-large`). Stock\n * tailwind-merge does not know these custom names, so it groups them with the\n * `text-<color>` utilities and drops one when a slot sets both a color *and* a\n * typescale (the common M3 case). That silently strips either the color or the\n * type, breaking token compliance.\n *\n * Teaching tailwind-merge that the typescale names belong to the `font-size`\n * group keeps color and type independent, so both survive the merge.\n */\nimport { type TV, tv as baseTv } from 'tailwind-variants';\n\nconst TYPESCALE = [\n 'display-large',\n 'display-medium',\n 'display-small',\n 'headline-large',\n 'headline-medium',\n 'headline-small',\n 'title-large',\n 'title-medium',\n 'title-small',\n 'body-large',\n 'body-medium',\n 'body-small',\n 'label-large',\n 'label-medium',\n 'label-small',\n] as const;\n\nexport const tv: TV = (options, config) =>\n baseTv(options, {\n ...config,\n twMergeConfig: {\n extend: {\n classGroups: {\n 'font-size': [{ text: [...TYPESCALE] }],\n },\n },\n },\n });\n","/**\n * card.ts — tailwind-variants slots for the M3 Card.\n *\n * 12dp corners. `elevated` is surface-container-low + level1, `filled` is\n * surface-container-highest (level0), `outlined` is surface + outline-variant.\n * Interactive cards add the `currentColor` state-layer `::before` (the pointer\n * ripple is added by the factory), a focus ring and per-token disabled dimming.\n * Same DOM + `data-*` as the VE build.\n */\nimport { createCard } from '@m3-baseui/core';\nimport { tv } from './tv';\n\nexport const cardTv = tv({\n base: 'relative box-border rounded-medium text-on-surface',\n variants: {\n variant: {\n elevated: 'bg-surface-container-low shadow-level1',\n filled: 'bg-surface-container-highest',\n outlined: 'bg-surface border border-outline-variant',\n },\n interactive: {\n true: [\n 'group overflow-hidden cursor-pointer select-none text-left w-full outline-none',\n // Animate the elevation lift/settle to match the VE box-shadow transition.\n 'transition-shadow duration-150 ease-standard',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none 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 'focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary',\n // M3 disabled: drop the shadow + state layer, dim the content per-token.\n 'disabled:pointer-events-none disabled:before:opacity-0 disabled:shadow-none disabled:text-on-surface/38',\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0 data-[disabled]:shadow-none data-[disabled]:text-on-surface/38',\n ],\n false: '',\n },\n },\n compoundVariants: [\n // M3 interactive elevated: lifts to level2 on hover, settles to level1 on press.\n {\n variant: 'elevated',\n interactive: true,\n class: 'hover:shadow-level2 active:shadow-level1',\n },\n ],\n defaultVariants: {\n variant: 'elevated',\n interactive: false,\n },\n});\n\nexport const Card = createCard({\n root: ({ variant, interactive }) => cardTv({ variant, interactive }),\n});\nexport type { CardProps, CardVariant } from '@m3-baseui/core';\n"]}
|
package/dist/checkbox.d.ts
CHANGED
|
@@ -6,16 +6,16 @@ import * as tailwind_variants from 'tailwind-variants';
|
|
|
6
6
|
declare const checkboxTv: tailwind_variants.TVReturnType<{
|
|
7
7
|
[key: string]: {
|
|
8
8
|
[key: string]: tailwind_variants.ClassValue | {
|
|
9
|
-
icon?: tailwind_variants.ClassValue;
|
|
10
9
|
root?: tailwind_variants.ClassValue;
|
|
10
|
+
icon?: tailwind_variants.ClassValue;
|
|
11
11
|
indicator?: tailwind_variants.ClassValue;
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
} | {
|
|
15
15
|
[x: string]: {
|
|
16
16
|
[x: string]: tailwind_variants.ClassValue | {
|
|
17
|
-
icon?: tailwind_variants.ClassValue;
|
|
18
17
|
root?: tailwind_variants.ClassValue;
|
|
18
|
+
icon?: tailwind_variants.ClassValue;
|
|
19
19
|
indicator?: tailwind_variants.ClassValue;
|
|
20
20
|
};
|
|
21
21
|
};
|
|
@@ -26,16 +26,16 @@ declare const checkboxTv: tailwind_variants.TVReturnType<{
|
|
|
26
26
|
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
27
27
|
[key: string]: {
|
|
28
28
|
[key: string]: tailwind_variants.ClassValue | {
|
|
29
|
-
icon?: tailwind_variants.ClassValue;
|
|
30
29
|
root?: tailwind_variants.ClassValue;
|
|
30
|
+
icon?: tailwind_variants.ClassValue;
|
|
31
31
|
indicator?: tailwind_variants.ClassValue;
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
} | {}>, {
|
|
35
35
|
[key: string]: {
|
|
36
36
|
[key: string]: tailwind_variants.ClassValue | {
|
|
37
|
-
icon?: tailwind_variants.ClassValue;
|
|
38
37
|
root?: tailwind_variants.ClassValue;
|
|
38
|
+
icon?: tailwind_variants.ClassValue;
|
|
39
39
|
indicator?: tailwind_variants.ClassValue;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
@@ -50,8 +50,8 @@ declare const checkboxTv: tailwind_variants.TVReturnType<{
|
|
|
50
50
|
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
51
51
|
[key: string]: {
|
|
52
52
|
[key: string]: tailwind_variants.ClassValue | {
|
|
53
|
-
icon?: tailwind_variants.ClassValue;
|
|
54
53
|
root?: tailwind_variants.ClassValue;
|
|
54
|
+
icon?: tailwind_variants.ClassValue;
|
|
55
55
|
indicator?: tailwind_variants.ClassValue;
|
|
56
56
|
};
|
|
57
57
|
};
|
package/dist/divider.js
CHANGED
|
@@ -19,7 +19,8 @@ var dividerTv = tv({
|
|
|
19
19
|
compoundVariants: [
|
|
20
20
|
{ orientation: "horizontal", inset: "inset", class: "ms-4" },
|
|
21
21
|
{ orientation: "horizontal", inset: "middle", class: "mx-4" },
|
|
22
|
-
|
|
22
|
+
// Logical block-start margin mirrors the VE recipe's `marginBlockStart`.
|
|
23
|
+
{ orientation: "vertical", inset: "inset", class: "[margin-block-start:1rem]" },
|
|
23
24
|
{ orientation: "vertical", inset: "middle", class: "my-4" }
|
|
24
25
|
],
|
|
25
26
|
defaultVariants: {
|
package/dist/divider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/divider.ts"],"names":[],"mappings":";;;;;AAWO,IAAM,YAAY,EAAA,CAAG;AAAA,EAC1B,IAAA,EAAM,mDAAA;AAAA,EACN,QAAA,EAAU;AAAA,IACR,WAAA,EAAa;AAAA,MACX,UAAA,EAAY,aAAA;AAAA,MACZ,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,EAAA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sourcesContent":["/**\n * divider.ts — tailwind-variants for the M3 Divider.\n *\n * 1dp `outline-variant` rule. `self-stretch` fills the cross axis in flex\n * layouts; horizontal is 1dp tall, vertical 1dp wide. The inset variants add a\n * 16dp leading (`inset`) or both-ends (`middle`) margin along the main axis.\n * Same DOM + `role=\"separator\"` as the VE build.\n */\nimport { createDivider } from '@m3-baseui/core';\nimport { tv } from 'tailwind-variants';\n\nexport const dividerTv = tv({\n base: 'shrink-0 self-stretch border-0 bg-outline-variant',\n variants: {\n orientation: {\n horizontal: 'h-px w-auto',\n vertical: 'w-px h-auto',\n },\n inset: {\n full: '',\n inset: '',\n middle: '',\n },\n },\n compoundVariants: [\n { orientation: 'horizontal', inset: 'inset', class: 'ms-4' },\n { orientation: 'horizontal', inset: 'middle', class: 'mx-4' },\n // Logical block-start margin mirrors the VE recipe's `marginBlockStart`.\n { orientation: 'vertical', inset: 'inset', class: '[margin-block-start:1rem]' },\n { orientation: 'vertical', inset: 'middle', class: 'my-4' },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n inset: 'full',\n },\n});\n\nexport const Divider = createDivider(({ inset, orientation }) => dividerTv({ inset, orientation }));\nexport type { DividerProps, DividerInset, DividerOrientation } from '@m3-baseui/core';\n"]}
|
package/dist/index.js
CHANGED
|
@@ -620,7 +620,7 @@ var sliderTv = tv7({
|
|
|
620
620
|
"before:size-10 before:rounded-full before:bg-primary before:opacity-0 before:transition-opacity before:duration-100",
|
|
621
621
|
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
622
622
|
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
623
|
-
"data-[dragging]:before:opacity-[var(--md-sys-state-
|
|
623
|
+
"data-[dragging]:before:opacity-[var(--md-sys-state-dragged)]",
|
|
624
624
|
"group-data-[disabled]:bg-on-surface/[0.38]"
|
|
625
625
|
],
|
|
626
626
|
value: "text-label-large text-on-surface-variant tabular-nums"
|
|
@@ -730,7 +730,8 @@ var textFieldTv = tv({
|
|
|
730
730
|
field: [
|
|
731
731
|
"rounded-t-extra-small bg-surface-container-highest",
|
|
732
732
|
"border-b-2 border-outline",
|
|
733
|
-
|
|
733
|
+
// M3 filled focus-active-indicator-height is 3dp (resting/error stay 2dp).
|
|
734
|
+
"group-data-[focused]:border-b-[3px] group-data-[focused]:border-primary group-data-[invalid]:border-error"
|
|
734
735
|
],
|
|
735
736
|
input: "pt-3",
|
|
736
737
|
label: [
|
|
@@ -741,7 +742,9 @@ var textFieldTv = tv({
|
|
|
741
742
|
outlined: {
|
|
742
743
|
field: [
|
|
743
744
|
"rounded-extra-small border border-outline",
|
|
744
|
-
|
|
745
|
+
// M3 outlined focus-outline-width is 3dp (matches Select's trigger);
|
|
746
|
+
// padding drops 2px so content stays steady as the 1dp border grows.
|
|
747
|
+
"group-data-[focused]:border-[3px] group-data-[focused]:border-primary group-data-[focused]:px-[14px]",
|
|
745
748
|
"group-data-[invalid]:border-error"
|
|
746
749
|
],
|
|
747
750
|
label: [
|
|
@@ -776,7 +779,8 @@ var navigationBarTv = tv({
|
|
|
776
779
|
item: [
|
|
777
780
|
"group relative flex flex-1 flex-col items-center justify-center gap-1 px-1 pt-3 pb-4",
|
|
778
781
|
"bg-transparent border-0 cursor-pointer select-none outline-none",
|
|
779
|
-
|
|
782
|
+
// M3 disabled is per-token (icon + label dimmed below), not a blanket fade.
|
|
783
|
+
"data-[disabled]:pointer-events-none"
|
|
780
784
|
],
|
|
781
785
|
iconWrap: "relative flex items-center justify-center w-16 h-8",
|
|
782
786
|
indicator: [
|
|
@@ -786,17 +790,32 @@ var navigationBarTv = tv({
|
|
|
786
790
|
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
787
791
|
"group-hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
788
792
|
"group-focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|
|
789
|
-
"group-active:before:opacity-[var(--md-sys-state-pressed)]"
|
|
793
|
+
"group-active:before:opacity-[var(--md-sys-state-pressed)]",
|
|
794
|
+
// No state layer on a disabled destination.
|
|
795
|
+
"group-data-[disabled]:before:opacity-0"
|
|
790
796
|
],
|
|
791
797
|
icon: [
|
|
792
798
|
"relative flex items-center justify-center text-on-surface-variant",
|
|
793
799
|
"transition-colors duration-150 ease-standard",
|
|
794
|
-
|
|
800
|
+
// Raw <svg> icons render at 24dp (Material Symbols set their own size).
|
|
801
|
+
"[&_svg]:size-6",
|
|
802
|
+
"group-data-[pressed]:text-on-secondary-container",
|
|
803
|
+
// M3 disabled: icon dims to on-surface/0.38. The item is the only `.group`,
|
|
804
|
+
// so the disabled+active override must test both attributes on that single
|
|
805
|
+
// element (`.group[data-disabled][data-pressed] &`) to outrank the equal-
|
|
806
|
+
// specificity data-[pressed] color — a stacked `group-data-*:group-data-*`
|
|
807
|
+
// would expect two nested groups and never match.
|
|
808
|
+
"group-data-[disabled]:text-on-surface/[0.38]",
|
|
809
|
+
"group-[&[data-disabled][data-pressed]]:text-on-surface/[0.38]"
|
|
795
810
|
],
|
|
796
811
|
label: [
|
|
797
812
|
"text-label-medium text-on-surface-variant",
|
|
798
813
|
"transition-colors duration-150 ease-standard",
|
|
799
|
-
"group-data-[pressed]:text-on-surface group-data-[pressed]:font-bold"
|
|
814
|
+
"group-data-[pressed]:text-on-surface group-data-[pressed]:font-bold",
|
|
815
|
+
// M3 disabled: label dims to on-surface/0.38. Same-element override (see the
|
|
816
|
+
// icon slot) keeps a disabled+active label dimmed.
|
|
817
|
+
"group-data-[disabled]:text-on-surface/[0.38]",
|
|
818
|
+
"group-[&[data-disabled][data-pressed]]:text-on-surface/[0.38]"
|
|
800
819
|
]
|
|
801
820
|
}
|
|
802
821
|
});
|
|
@@ -863,7 +882,8 @@ var dividerTv = tv({
|
|
|
863
882
|
compoundVariants: [
|
|
864
883
|
{ orientation: "horizontal", inset: "inset", class: "ms-4" },
|
|
865
884
|
{ orientation: "horizontal", inset: "middle", class: "mx-4" },
|
|
866
|
-
|
|
885
|
+
// Logical block-start margin mirrors the VE recipe's `marginBlockStart`.
|
|
886
|
+
{ orientation: "vertical", inset: "inset", class: "[margin-block-start:1rem]" },
|
|
867
887
|
{ orientation: "vertical", inset: "middle", class: "my-4" }
|
|
868
888
|
],
|
|
869
889
|
defaultVariants: {
|
|
@@ -976,7 +996,7 @@ var snackbarTv = tv({
|
|
|
976
996
|
],
|
|
977
997
|
content: "flex flex-col flex-1 min-w-0 gap-0.5",
|
|
978
998
|
title: "text-body-medium",
|
|
979
|
-
description: "text-body-
|
|
999
|
+
description: "text-body-medium",
|
|
980
1000
|
action: [
|
|
981
1001
|
"relative inline-flex items-center justify-center shrink-0 h-9 px-3 overflow-hidden",
|
|
982
1002
|
"rounded-extra-small bg-transparent border-0 cursor-pointer outline-none",
|
|
@@ -1054,6 +1074,8 @@ var cardTv = tv7({
|
|
|
1054
1074
|
interactive: {
|
|
1055
1075
|
true: [
|
|
1056
1076
|
"group overflow-hidden cursor-pointer select-none text-left w-full outline-none",
|
|
1077
|
+
// Animate the elevation lift/settle to match the VE box-shadow transition.
|
|
1078
|
+
"transition-shadow duration-150 ease-standard",
|
|
1057
1079
|
"before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100",
|
|
1058
1080
|
"hover:before:opacity-[var(--md-sys-state-hover)]",
|
|
1059
1081
|
"focus-visible:before:opacity-[var(--md-sys-state-focus)]",
|