@m3-baseui/react-tailwind 1.3.0 → 2.0.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/{badge.js → components/badge/index.js} +4 -4
- package/dist/components/badge/index.js.map +1 -0
- package/dist/{bottom-app-bar.d.ts → components/bottom-app-bar/index.d.ts} +22 -21
- package/dist/{bottom-app-bar.js → components/bottom-app-bar/index.js} +4 -4
- package/dist/components/bottom-app-bar/index.js.map +1 -0
- package/dist/{bottom-sheet.d.ts → components/bottom-sheet/index.d.ts} +37 -36
- package/dist/{bottom-sheet.js → components/bottom-sheet/index.js} +4 -4
- package/dist/components/bottom-sheet/index.js.map +1 -0
- package/dist/{button.js → components/button/index.js} +3 -3
- package/dist/components/button/index.js.map +1 -0
- package/dist/{button-group.js → components/button-group/index.js} +4 -4
- package/dist/components/button-group/index.js.map +1 -0
- package/dist/{card.js → components/card/index.js} +4 -4
- package/dist/components/card/index.js.map +1 -0
- package/dist/{carousel.js → components/carousel/index.js} +4 -4
- package/dist/components/carousel/index.js.map +1 -0
- package/dist/{checkbox.d.ts → components/checkbox/index.d.ts} +22 -21
- package/dist/{checkbox.js → components/checkbox/index.js} +3 -3
- package/dist/components/checkbox/index.js.map +1 -0
- package/dist/{chip.js → components/chip/index.js} +3 -3
- package/dist/components/chip/index.js.map +1 -0
- package/dist/components/date-picker/index.d.ts +189 -0
- package/dist/{date-picker.js → components/date-picker/index.js} +4 -4
- package/dist/components/date-picker/index.js.map +1 -0
- package/dist/components/dialog/index.d.ts +116 -0
- package/dist/components/dialog/index.js +103 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/{divider.js → components/divider/index.js} +3 -3
- package/dist/components/divider/index.js.map +1 -0
- package/dist/{fab.d.ts → components/fab/index.d.ts} +29 -15
- package/dist/components/fab/index.js +79 -0
- package/dist/components/fab/index.js.map +1 -0
- package/dist/{fab-menu.d.ts → components/fab-menu/index.d.ts} +0 -21
- package/dist/{fab-menu.js → components/fab-menu/index.js} +49 -18
- package/dist/components/fab-menu/index.js.map +1 -0
- package/dist/{icon-button.js → components/icon-button/index.js} +3 -3
- package/dist/components/icon-button/index.js.map +1 -0
- package/dist/components/item/index.d.ts +95 -0
- package/dist/{item.js → components/item/index.js} +12 -6
- package/dist/components/item/index.js.map +1 -0
- package/dist/{list.d.ts → components/list/index.d.ts} +4 -4
- package/dist/{list.js → components/list/index.js} +12 -6
- package/dist/components/list/index.js.map +1 -0
- package/dist/{loading-indicator.js → components/loading-indicator/index.js} +4 -4
- package/dist/components/loading-indicator/index.js.map +1 -0
- package/dist/{menu.d.ts → components/menu/index.d.ts} +61 -60
- package/dist/components/menu/index.js +179 -0
- package/dist/components/menu/index.js.map +1 -0
- package/dist/components/navigation-bar/index.d.ts +92 -0
- package/dist/{navigation-bar.js → components/navigation-bar/index.js} +3 -3
- package/dist/components/navigation-bar/index.js.map +1 -0
- package/dist/{navigation-drawer.js → components/navigation-drawer/index.js} +4 -4
- package/dist/components/navigation-drawer/index.js.map +1 -0
- package/dist/components/navigation-rail/index.d.ts +102 -0
- package/dist/{navigation-rail.js → components/navigation-rail/index.js} +4 -4
- package/dist/components/navigation-rail/index.js.map +1 -0
- package/dist/components/progress/index.d.ts +127 -0
- package/dist/components/progress/index.js +101 -0
- package/dist/components/progress/index.js.map +1 -0
- package/dist/{radio.d.ts → components/radio/index.d.ts} +17 -16
- package/dist/{radio.js → components/radio/index.js} +3 -3
- package/dist/components/radio/index.js.map +1 -0
- package/dist/{search.d.ts → components/search/index.d.ts} +62 -61
- package/dist/{search.js → components/search/index.js} +4 -4
- package/dist/components/search/index.js.map +1 -0
- package/dist/{segmented-button.d.ts → components/segmented-button/index.d.ts} +32 -31
- package/dist/{segmented-button.js → components/segmented-button/index.js} +4 -4
- package/dist/components/segmented-button/index.js.map +1 -0
- package/dist/components/select/index.d.ts +253 -0
- package/dist/components/select/index.js +271 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/{side-sheet.js → components/side-sheet/index.js} +4 -4
- package/dist/components/side-sheet/index.js.map +1 -0
- package/dist/{slider.d.ts → components/slider/index.d.ts} +52 -51
- package/dist/{slider.js → components/slider/index.js} +4 -4
- package/dist/components/slider/index.js.map +1 -0
- package/dist/{snackbar.d.ts → components/snackbar/index.d.ts} +42 -41
- package/dist/{snackbar.js → components/snackbar/index.js} +9 -4
- package/dist/components/snackbar/index.js.map +1 -0
- package/dist/{split-button.js → components/split-button/index.js} +4 -4
- package/dist/components/split-button/index.js.map +1 -0
- package/dist/components/switch/index.d.ts +73 -0
- package/dist/{switch.js → components/switch/index.js} +3 -3
- package/dist/components/switch/index.js.map +1 -0
- package/dist/{tabs.js → components/tabs/index.js} +4 -4
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/{textfield.d.ts → components/textfield/index.d.ts} +7 -1
- package/dist/{textfield.js → components/textfield/index.js} +35 -13
- package/dist/components/textfield/index.js.map +1 -0
- package/dist/components/time-picker/index.d.ts +153 -0
- package/dist/{time-picker.js → components/time-picker/index.js} +28 -13
- package/dist/components/time-picker/index.js.map +1 -0
- package/dist/{toolbar.js → components/toolbar/index.js} +4 -4
- package/dist/components/toolbar/index.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +143 -0
- package/dist/components/tooltip/index.js +80 -0
- package/dist/components/tooltip/index.js.map +1 -0
- package/dist/{top-app-bar.js → components/top-app-bar/index.js} +4 -4
- package/dist/components/top-app-bar/index.js.map +1 -0
- package/dist/index.d.ts +40 -39
- package/dist/index.js +489 -129
- package/dist/index.js.map +1 -1
- package/package.json +151 -151
- package/styles/preset.css +75 -7
- package/styles/theme.css +2 -0
- package/styles/tokens.css +2 -0
- package/dist/badge.js.map +0 -1
- package/dist/bottom-app-bar.js.map +0 -1
- package/dist/bottom-sheet.js.map +0 -1
- package/dist/button-group.js.map +0 -1
- package/dist/button.js.map +0 -1
- package/dist/card.js.map +0 -1
- package/dist/carousel.js.map +0 -1
- package/dist/checkbox.js.map +0 -1
- package/dist/chip.js.map +0 -1
- package/dist/date-picker.d.ts +0 -188
- package/dist/date-picker.js.map +0 -1
- package/dist/dialog.d.ts +0 -86
- package/dist/dialog.js +0 -68
- package/dist/dialog.js.map +0 -1
- package/dist/divider.js.map +0 -1
- package/dist/fab-menu.js.map +0 -1
- package/dist/fab.js +0 -47
- package/dist/fab.js.map +0 -1
- package/dist/icon-button.js.map +0 -1
- package/dist/item.d.ts +0 -94
- package/dist/item.js.map +0 -1
- package/dist/list.js.map +0 -1
- package/dist/loading-indicator.js.map +0 -1
- package/dist/menu.js +0 -114
- package/dist/menu.js.map +0 -1
- package/dist/navigation-bar.d.ts +0 -91
- package/dist/navigation-bar.js.map +0 -1
- package/dist/navigation-drawer.js.map +0 -1
- package/dist/navigation-rail.d.ts +0 -101
- package/dist/navigation-rail.js.map +0 -1
- package/dist/progress.d.ts +0 -118
- package/dist/progress.js +0 -41
- package/dist/progress.js.map +0 -1
- package/dist/radio.js.map +0 -1
- package/dist/search.js.map +0 -1
- package/dist/segmented-button.js.map +0 -1
- package/dist/select.d.ts +0 -125
- package/dist/select.js +0 -99
- package/dist/select.js.map +0 -1
- package/dist/side-sheet.js.map +0 -1
- package/dist/slider.js.map +0 -1
- package/dist/snackbar.js.map +0 -1
- package/dist/split-button.js.map +0 -1
- package/dist/switch.d.ts +0 -72
- package/dist/switch.js.map +0 -1
- package/dist/tabs.js.map +0 -1
- package/dist/textfield.js.map +0 -1
- package/dist/time-picker.d.ts +0 -144
- package/dist/time-picker.js.map +0 -1
- package/dist/toolbar.js.map +0 -1
- package/dist/tooltip.d.ts +0 -61
- package/dist/tooltip.js +0 -52
- package/dist/tooltip.js.map +0 -1
- package/dist/top-app-bar.js.map +0 -1
- /package/dist/{badge.d.ts → components/badge/index.d.ts} +0 -0
- /package/dist/{button.d.ts → components/button/index.d.ts} +0 -0
- /package/dist/{button-group.d.ts → components/button-group/index.d.ts} +0 -0
- /package/dist/{card.d.ts → components/card/index.d.ts} +0 -0
- /package/dist/{carousel.d.ts → components/carousel/index.d.ts} +0 -0
- /package/dist/{chip.d.ts → components/chip/index.d.ts} +0 -0
- /package/dist/{divider.d.ts → components/divider/index.d.ts} +0 -0
- /package/dist/{icon-button.d.ts → components/icon-button/index.d.ts} +0 -0
- /package/dist/{loading-indicator.d.ts → components/loading-indicator/index.d.ts} +0 -0
- /package/dist/{navigation-drawer.d.ts → components/navigation-drawer/index.d.ts} +0 -0
- /package/dist/{side-sheet.d.ts → components/side-sheet/index.d.ts} +0 -0
- /package/dist/{split-button.d.ts → components/split-button/index.d.ts} +0 -0
- /package/dist/{tabs.d.ts → components/tabs/index.d.ts} +0 -0
- /package/dist/{toolbar.d.ts → components/toolbar/index.d.ts} +0 -0
- /package/dist/{top-app-bar.d.ts → components/top-app-bar/index.d.ts} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createNavigationRail } from '@m3-baseui/core';
|
|
3
3
|
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
4
|
|
|
5
|
-
// src/navigation-rail.ts
|
|
5
|
+
// src/components/navigation-rail/navigation-rail.ts
|
|
6
6
|
var TYPESCALE = [
|
|
7
7
|
"display-large",
|
|
8
8
|
"display-medium",
|
|
@@ -31,7 +31,7 @@ var tv = (options, config) => tv$1(options, {
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
// src/navigation-rail.ts
|
|
34
|
+
// src/components/navigation-rail/navigation-rail.ts
|
|
35
35
|
var navigationRailTv = tv({
|
|
36
36
|
slots: {
|
|
37
37
|
root: "flex flex-col items-center gap-3 h-full w-20 py-5 bg-surface",
|
|
@@ -88,5 +88,5 @@ var NavigationRail = createNavigationRail({
|
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
export { NavigationRail, navigationRailTv };
|
|
91
|
-
//# sourceMappingURL=
|
|
92
|
-
//# sourceMappingURL=
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tv.ts","../../../src/components/navigation-rail/navigation-rail.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,mBAAmB,EAAA,CAAG;AAAA,EACjC,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,8DAAA;AAAA,IACN,MAAA,EAAQ,uCAAA;AAAA,IACR,IAAA,EAAM;AAAA,MACJ,0EAAA;AAAA,MACA,iEAAA;AAAA;AAAA,MAEA;AAAA,KACF;AAAA,IACA,QAAA,EAAU,oDAAA;AAAA,IACV,SAAA,EAAW;AAAA,MACT,8DAAA;AAAA,MACA,8CAAA;AAAA,MACA,6CAAA;AAAA,MACA,4IAAA;AAAA,MACA,wDAAA;AAAA,MACA,gEAAA;AAAA,MACA,2DAAA;AAAA;AAAA,MAEA;AAAA,KACF;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,mEAAA;AAAA,MACA,8CAAA;AAAA;AAAA,MAEA,gBAAA;AAAA,MACA,kDAAA;AAAA;AAAA;AAAA;AAAA,MAIA,8CAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL,2CAAA;AAAA,MACA,8CAAA;AAAA,MACA,qEAAA;AAAA;AAAA,MAEA,8CAAA;AAAA,MACA;AAAA;AACF;AAEJ,CAAC;AAED,IAAM,IAAI,gBAAA,EAAiB;AACpB,IAAM,iBAAiB,oBAAA,CAAqB;AAAA,EACjD,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,MAAA,EAAQ,EAAE,MAAA,EAAO;AAAA,EACjB,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,QAAA,EAAU,EAAE,QAAA,EAAS;AAAA,EACrB,SAAA,EAAW,EAAE,SAAA,EAAU;AAAA,EACvB,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,KAAA,EAAO,EAAE,KAAA;AACX,CAAC","file":"index.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 * navigation-rail.ts — tailwind-variants slots for the M3 NavigationRail.\n *\n * 80dp vertical rail on `surface`. The selected destination surfaces\n * `data-pressed` (Base UI Toggle); the pill, icon and label colors key off it\n * via the `group` on each item. State layer is the pill `::before`; the pointer\n * ripple is added by the factory. `Root` renders an optional leading `header`\n * (menu button / FAB). Same DOM + `data-*` as the VE build (mirrors NavigationBar).\n */\nimport { createNavigationRail } from '@m3-baseui/core';\nimport { tv } from '../../tv';\n\nexport const navigationRailTv = tv({\n slots: {\n root: 'flex flex-col items-center gap-3 h-full w-20 py-5 bg-surface',\n header: 'flex flex-col items-center gap-3 mb-1',\n item: [\n 'group relative flex flex-col items-center justify-center gap-1 px-1 py-1',\n 'bg-transparent border-0 cursor-pointer select-none outline-none',\n // M3 disabled is per-token (icon + label dimmed below), not a blanket fade.\n 'data-[disabled]:pointer-events-none',\n ],\n iconWrap: 'relative flex items-center justify-center w-14 h-8',\n indicator: [\n 'absolute inset-0 rounded-full bg-transparent overflow-hidden',\n 'transition-colors duration-150 ease-standard',\n 'group-data-[pressed]:bg-secondary-container',\n 'before:absolute before:inset-0 before:bg-current before:opacity-0 before:pointer-events-none before:transition-opacity before:duration-100',\n 'group-hover:before:opacity-[var(--md-sys-state-hover)]',\n 'group-focus-visible:before:opacity-[var(--md-sys-state-focus)]',\n 'group-active:before:opacity-[var(--md-sys-state-pressed)]',\n // No state layer on a disabled destination.\n 'group-data-[disabled]:before:opacity-0',\n ],\n icon: [\n 'relative flex items-center justify-center text-on-surface-variant',\n 'transition-colors duration-150 ease-standard',\n // Raw <svg> icons render at 24dp (Material Symbols set their own size).\n '[&_svg]:size-6',\n 'group-data-[pressed]:text-on-secondary-container',\n // M3 disabled: icon dims to on-surface/0.38. The item is the only `.group`,\n // so the disabled+active override tests both attributes on that single\n // element (see NavigationBar for the rationale).\n 'group-data-[disabled]:text-on-surface/[0.38]',\n 'group-[&[data-disabled][data-pressed]]:text-on-surface/[0.38]',\n ],\n label: [\n 'text-label-medium text-on-surface-variant',\n 'transition-colors duration-150 ease-standard',\n 'group-data-[pressed]:text-on-surface group-data-[pressed]:font-bold',\n // M3 disabled: label dims to on-surface/0.38 (same-element override).\n 'group-data-[disabled]:text-on-surface/[0.38]',\n 'group-[&[data-disabled][data-pressed]]:text-on-surface/[0.38]',\n ],\n },\n});\n\nconst s = navigationRailTv();\nexport const NavigationRail = createNavigationRail({\n root: s.root(),\n header: s.header(),\n item: s.item(),\n iconWrap: s.iconWrap(),\n indicator: s.indicator(),\n icon: s.icon(),\n label: s.label(),\n});\n"]}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as _m3_baseui_core from '@m3-baseui/core';
|
|
3
|
+
export { CircularProgressProps, LinearProgressProps } from '@m3-baseui/core';
|
|
4
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
5
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
6
|
+
import * as tailwind_merge from 'tailwind-merge';
|
|
7
|
+
|
|
8
|
+
declare const linearTv: tailwind_variants.TVReturnType<{
|
|
9
|
+
[key: string]: {
|
|
10
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
11
|
+
track?: tailwind_merge.ClassNameValue;
|
|
12
|
+
root?: tailwind_merge.ClassNameValue;
|
|
13
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
14
|
+
indicatorSecondary?: tailwind_merge.ClassNameValue;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
} | {
|
|
18
|
+
[x: string]: {
|
|
19
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
|
20
|
+
track?: tailwind_merge.ClassNameValue;
|
|
21
|
+
root?: tailwind_merge.ClassNameValue;
|
|
22
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
23
|
+
indicatorSecondary?: tailwind_merge.ClassNameValue;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
} | {}, {
|
|
27
|
+
root: string[];
|
|
28
|
+
track: string[];
|
|
29
|
+
indicator: string[];
|
|
30
|
+
indicatorSecondary: string[];
|
|
31
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
32
|
+
[key: string]: {
|
|
33
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
34
|
+
track?: tailwind_merge.ClassNameValue;
|
|
35
|
+
root?: tailwind_merge.ClassNameValue;
|
|
36
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
37
|
+
indicatorSecondary?: tailwind_merge.ClassNameValue;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
} | {}>, {
|
|
41
|
+
[key: string]: {
|
|
42
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
43
|
+
track?: tailwind_merge.ClassNameValue;
|
|
44
|
+
root?: tailwind_merge.ClassNameValue;
|
|
45
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
46
|
+
indicatorSecondary?: tailwind_merge.ClassNameValue;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
} | {}, {
|
|
50
|
+
root: string[];
|
|
51
|
+
track: string[];
|
|
52
|
+
indicator: string[];
|
|
53
|
+
indicatorSecondary: string[];
|
|
54
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
55
|
+
root: string[];
|
|
56
|
+
track: string[];
|
|
57
|
+
indicator: string[];
|
|
58
|
+
indicatorSecondary: string[];
|
|
59
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
60
|
+
[key: string]: {
|
|
61
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
62
|
+
track?: tailwind_merge.ClassNameValue;
|
|
63
|
+
root?: tailwind_merge.ClassNameValue;
|
|
64
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
65
|
+
indicatorSecondary?: tailwind_merge.ClassNameValue;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
} | {}>, unknown, unknown, undefined>>;
|
|
69
|
+
declare const circularTv: tailwind_variants.TVReturnType<{
|
|
70
|
+
[key: string]: {
|
|
71
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
72
|
+
track?: tailwind_merge.ClassNameValue;
|
|
73
|
+
root?: tailwind_merge.ClassNameValue;
|
|
74
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
} | {
|
|
78
|
+
[x: string]: {
|
|
79
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
|
80
|
+
track?: tailwind_merge.ClassNameValue;
|
|
81
|
+
root?: tailwind_merge.ClassNameValue;
|
|
82
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
} | {}, {
|
|
86
|
+
root: string[];
|
|
87
|
+
track: string[];
|
|
88
|
+
indicator: string[];
|
|
89
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
90
|
+
[key: string]: {
|
|
91
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
92
|
+
track?: tailwind_merge.ClassNameValue;
|
|
93
|
+
root?: tailwind_merge.ClassNameValue;
|
|
94
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
} | {}>, {
|
|
98
|
+
[key: string]: {
|
|
99
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
100
|
+
track?: tailwind_merge.ClassNameValue;
|
|
101
|
+
root?: tailwind_merge.ClassNameValue;
|
|
102
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
} | {}, {
|
|
106
|
+
root: string[];
|
|
107
|
+
track: string[];
|
|
108
|
+
indicator: string[];
|
|
109
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
110
|
+
root: string[];
|
|
111
|
+
track: string[];
|
|
112
|
+
indicator: string[];
|
|
113
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
114
|
+
[key: string]: {
|
|
115
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
116
|
+
track?: tailwind_merge.ClassNameValue;
|
|
117
|
+
root?: tailwind_merge.ClassNameValue;
|
|
118
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
} | {}>, unknown, unknown, undefined>>;
|
|
122
|
+
declare const Progress: {
|
|
123
|
+
Linear: react.ForwardRefExoticComponent<_m3_baseui_core.LinearProgressOwnProps & Omit<react.HTMLAttributes<HTMLDivElement>, "value" | "defaultValue"> & react.RefAttributes<HTMLDivElement>>;
|
|
124
|
+
Circular: react.ForwardRefExoticComponent<_m3_baseui_core.CircularProgressOwnProps & Omit<react.HTMLAttributes<HTMLSpanElement>, "value" | "defaultValue"> & react.RefAttributes<HTMLSpanElement>>;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export { Progress, circularTv, linearTv };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createProgress } from '@m3-baseui/core';
|
|
3
|
+
import { tv } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
// src/components/progress/progress.ts
|
|
6
|
+
var linearTv = tv({
|
|
7
|
+
slots: {
|
|
8
|
+
// The track-stop dot (primary, full track height) sits at the inline-end via
|
|
9
|
+
// `after:`. It's a determinate-only M3 concept, so it's hidden while
|
|
10
|
+
// indeterminate. Logical `end-0` mirrors with the indicator under `dir="rtl"`.
|
|
11
|
+
// Height comes from the factory (inline) so `thickness` is honored.
|
|
12
|
+
root: [
|
|
13
|
+
"group relative block w-full overflow-hidden rounded-full",
|
|
14
|
+
// The dot is `--m3-thickness` tall (stroke height) and centered, so it stays
|
|
15
|
+
// correct when the wavy track grows taller than the stroke.
|
|
16
|
+
"after:content-[''] after:absolute after:end-0 after:top-1/2 after:-translate-y-1/2",
|
|
17
|
+
"after:h-[var(--m3-thickness,100%)] after:aspect-square after:rounded-full after:bg-primary",
|
|
18
|
+
// Self variant (not `group-data-*`): the dot is on the root element itself,
|
|
19
|
+
// which carries `data-indeterminate` — it isn't a descendant of `.group`.
|
|
20
|
+
"data-[indeterminate]:after:hidden"
|
|
21
|
+
],
|
|
22
|
+
// Positioning container only; the inactive track is the `before:` pseudo so a
|
|
23
|
+
// 4dp gap separates it from the active indicator (`--m3-progress` + 4px). The
|
|
24
|
+
// gap uses logical inline insets so it tracks the indicator (which Base UI
|
|
25
|
+
// anchors at inline-start) under `dir="rtl"`. Indeterminate has no fraction,
|
|
26
|
+
// so the inactive track spans the full width. The flat track stays
|
|
27
|
+
// `--m3-thickness` tall and centered even when the wavy root is taller.
|
|
28
|
+
track: [
|
|
29
|
+
"absolute inset-0",
|
|
30
|
+
"before:content-[''] before:absolute before:top-1/2 before:-translate-y-1/2 before:end-0",
|
|
31
|
+
"before:h-[var(--m3-thickness,100%)]",
|
|
32
|
+
"before:[inset-inline-start:calc(var(--m3-progress,0%)_+_4px)]",
|
|
33
|
+
"before:bg-surface-container-highest before:rounded-full",
|
|
34
|
+
"group-data-[indeterminate]:before:start-0"
|
|
35
|
+
],
|
|
36
|
+
// Primary bar. Determinate: width from Base UI. Indeterminate: full width,
|
|
37
|
+
// scaled + slid by the disjoint `primary` keyframe (origin at the start edge).
|
|
38
|
+
// Wavy determinate: a scrolling sine tile masks the solid bar into a wave.
|
|
39
|
+
indicator: [
|
|
40
|
+
"absolute inset-y-0 left-0 origin-left bg-primary rounded-full",
|
|
41
|
+
"transition-[width] duration-200 ease-standard",
|
|
42
|
+
"group-data-[indeterminate]:w-full group-data-[indeterminate]:transition-none",
|
|
43
|
+
"group-data-[indeterminate]:animate-m3-linear-primary",
|
|
44
|
+
"group-data-[wavy]:rounded-none",
|
|
45
|
+
"group-data-[wavy]:[-webkit-mask-image:var(--m3-wave)] group-data-[wavy]:[mask-image:var(--m3-wave)]",
|
|
46
|
+
"group-data-[wavy]:[-webkit-mask-repeat:repeat-x] group-data-[wavy]:[mask-repeat:repeat-x]",
|
|
47
|
+
"group-data-[wavy]:[-webkit-mask-size:40px_100%] group-data-[wavy]:[mask-size:40px_100%]",
|
|
48
|
+
"group-data-[wavy]:animate-m3-wave-flow",
|
|
49
|
+
// Reduced motion: freeze the loops and show a static ~40% bar / static wave.
|
|
50
|
+
"motion-reduce:group-data-[indeterminate]:w-2/5",
|
|
51
|
+
"motion-reduce:group-data-[indeterminate]:animate-none motion-reduce:group-data-[wavy]:animate-none"
|
|
52
|
+
],
|
|
53
|
+
// Second disjoint bar: only present visually while indeterminate.
|
|
54
|
+
indicatorSecondary: [
|
|
55
|
+
"absolute inset-y-0 left-0 w-full origin-left bg-primary rounded-full hidden",
|
|
56
|
+
"group-data-[indeterminate]:block group-data-[indeterminate]:animate-m3-linear-secondary",
|
|
57
|
+
// Reduced motion: a single static bar reads better than two frozen ones.
|
|
58
|
+
"motion-reduce:group-data-[indeterminate]:hidden"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
var circularTv = tv({
|
|
63
|
+
slots: {
|
|
64
|
+
// Size comes from the factory (inline width/height) so `size` is honored.
|
|
65
|
+
// Indeterminate rotates the whole ring; the arc grows/shrinks via the
|
|
66
|
+
// indicator's own `dash` animation (M3 "advance").
|
|
67
|
+
root: [
|
|
68
|
+
"group inline-flex items-center justify-center",
|
|
69
|
+
"[&_svg]:block [&_svg]:size-full",
|
|
70
|
+
"data-[indeterminate]:animate-m3-circular-rotate",
|
|
71
|
+
"motion-reduce:data-[indeterminate]:animate-none"
|
|
72
|
+
],
|
|
73
|
+
// Both ends are rounded (M3); the inactive track sits behind with a 4dp gap.
|
|
74
|
+
track: [
|
|
75
|
+
"stroke-surface-container-highest [stroke-linecap:round]",
|
|
76
|
+
"transition-[stroke-dasharray,stroke-dashoffset] duration-300 ease-standard"
|
|
77
|
+
],
|
|
78
|
+
indicator: [
|
|
79
|
+
"stroke-primary [stroke-linecap:round]",
|
|
80
|
+
"transition-[stroke-dasharray,stroke-dashoffset] duration-300 ease-standard",
|
|
81
|
+
"group-data-[indeterminate]:animate-m3-circular-dash group-data-[indeterminate]:transition-none",
|
|
82
|
+
// Reduced motion: freeze the arc at its static 25% length (no rotation).
|
|
83
|
+
"motion-reduce:group-data-[indeterminate]:animate-none"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
var l = linearTv();
|
|
88
|
+
var c = circularTv();
|
|
89
|
+
var Progress = createProgress({
|
|
90
|
+
linear: {
|
|
91
|
+
root: l.root(),
|
|
92
|
+
track: l.track(),
|
|
93
|
+
indicator: l.indicator(),
|
|
94
|
+
indicatorSecondary: l.indicatorSecondary()
|
|
95
|
+
},
|
|
96
|
+
circular: { root: c.root(), track: c.track(), indicator: c.indicator() }
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
export { Progress, circularTv, linearTv };
|
|
100
|
+
//# sourceMappingURL=index.js.map
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/progress/progress.ts"],"names":[],"mappings":";;;;;AAgBO,IAAM,WAAW,EAAA,CAAG;AAAA,EACzB,KAAA,EAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKL,IAAA,EAAM;AAAA,MACJ,0DAAA;AAAA;AAAA;AAAA,MAGA,oFAAA;AAAA,MACA,4FAAA;AAAA;AAAA;AAAA,MAGA;AAAA,KACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,KAAA,EAAO;AAAA,MACL,kBAAA;AAAA,MACA,yFAAA;AAAA,MACA,qCAAA;AAAA,MACA,+DAAA;AAAA,MACA,yDAAA;AAAA,MACA;AAAA,KACF;AAAA;AAAA;AAAA;AAAA,IAIA,SAAA,EAAW;AAAA,MACT,+DAAA;AAAA,MACA,+CAAA;AAAA,MACA,8EAAA;AAAA,MACA,sDAAA;AAAA,MACA,gCAAA;AAAA,MACA,qGAAA;AAAA,MACA,2FAAA;AAAA,MACA,yFAAA;AAAA,MACA,wCAAA;AAAA;AAAA,MAEA,gDAAA;AAAA,MACA;AAAA,KACF;AAAA;AAAA,IAEA,kBAAA,EAAoB;AAAA,MAClB,6EAAA;AAAA,MACA,yFAAA;AAAA;AAAA,MAEA;AAAA;AACF;AAEJ,CAAC;AAEM,IAAM,aAAa,EAAA,CAAG;AAAA,EAC3B,KAAA,EAAO;AAAA;AAAA;AAAA;AAAA,IAIL,IAAA,EAAM;AAAA,MACJ,+CAAA;AAAA,MACA,iCAAA;AAAA,MACA,iDAAA;AAAA,MACA;AAAA,KACF;AAAA;AAAA,IAEA,KAAA,EAAO;AAAA,MACL,yDAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,SAAA,EAAW;AAAA,MACT,uCAAA;AAAA,MACA,4EAAA;AAAA,MACA,gGAAA;AAAA;AAAA,MAEA;AAAA;AACF;AAEJ,CAAC;AAED,IAAM,IAAI,QAAA,EAAS;AACnB,IAAM,IAAI,UAAA,EAAW;AACd,IAAM,WAAW,cAAA,CAAe;AAAA,EACrC,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,IACb,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,IACf,SAAA,EAAW,EAAE,SAAA,EAAU;AAAA,IACvB,kBAAA,EAAoB,EAAE,kBAAA;AAAmB,GAC3C;AAAA,EACA,QAAA,EAAU,EAAE,IAAA,EAAM,CAAA,CAAE,IAAA,EAAK,EAAG,KAAA,EAAO,CAAA,CAAE,KAAA,EAAM,EAAG,SAAA,EAAW,CAAA,CAAE,WAAU;AACvE,CAAC","file":"index.js","sourcesContent":["/**\n * progress.ts — tailwind-variants slots for the M3 Progress indicators.\n *\n * Linear: a `surface-container-highest` inactive track with a `primary` active\n * indicator (height from the factory's `thickness`). Per M3 the inactive track\n * (`::before`) starts a 4dp gap past the active tip — positioned from the\n * `--m3-progress` fraction — and a `primary` track-stop dot (`::after`) sits at\n * the far end. Indeterminate keys off the Root's `data-indeterminate`: it drops\n * the gap/dot and runs the M3 disjoint two-bar motion (`m3-linear-primary` +\n * `m3-linear-secondary` in preset.css). Circular: a 40dp / 4dp `primary` ring\n * (size/thickness configurable); `data-indeterminate` rotates the ring while the\n * arc grows/shrinks (advance). Same DOM as the VE build.\n */\nimport { createProgress } from '@m3-baseui/core';\nimport { tv } from 'tailwind-variants';\n\nexport const linearTv = tv({\n slots: {\n // The track-stop dot (primary, full track height) sits at the inline-end via\n // `after:`. It's a determinate-only M3 concept, so it's hidden while\n // indeterminate. Logical `end-0` mirrors with the indicator under `dir=\"rtl\"`.\n // Height comes from the factory (inline) so `thickness` is honored.\n root: [\n 'group relative block w-full overflow-hidden rounded-full',\n // The dot is `--m3-thickness` tall (stroke height) and centered, so it stays\n // correct when the wavy track grows taller than the stroke.\n \"after:content-[''] after:absolute after:end-0 after:top-1/2 after:-translate-y-1/2\",\n 'after:h-[var(--m3-thickness,100%)] after:aspect-square after:rounded-full after:bg-primary',\n // Self variant (not `group-data-*`): the dot is on the root element itself,\n // which carries `data-indeterminate` — it isn't a descendant of `.group`.\n 'data-[indeterminate]:after:hidden',\n ],\n // Positioning container only; the inactive track is the `before:` pseudo so a\n // 4dp gap separates it from the active indicator (`--m3-progress` + 4px). The\n // gap uses logical inline insets so it tracks the indicator (which Base UI\n // anchors at inline-start) under `dir=\"rtl\"`. Indeterminate has no fraction,\n // so the inactive track spans the full width. The flat track stays\n // `--m3-thickness` tall and centered even when the wavy root is taller.\n track: [\n 'absolute inset-0',\n \"before:content-[''] before:absolute before:top-1/2 before:-translate-y-1/2 before:end-0\",\n 'before:h-[var(--m3-thickness,100%)]',\n 'before:[inset-inline-start:calc(var(--m3-progress,0%)_+_4px)]',\n 'before:bg-surface-container-highest before:rounded-full',\n 'group-data-[indeterminate]:before:start-0',\n ],\n // Primary bar. Determinate: width from Base UI. Indeterminate: full width,\n // scaled + slid by the disjoint `primary` keyframe (origin at the start edge).\n // Wavy determinate: a scrolling sine tile masks the solid bar into a wave.\n indicator: [\n 'absolute inset-y-0 left-0 origin-left bg-primary rounded-full',\n 'transition-[width] duration-200 ease-standard',\n 'group-data-[indeterminate]:w-full group-data-[indeterminate]:transition-none',\n 'group-data-[indeterminate]:animate-m3-linear-primary',\n 'group-data-[wavy]:rounded-none',\n 'group-data-[wavy]:[-webkit-mask-image:var(--m3-wave)] group-data-[wavy]:[mask-image:var(--m3-wave)]',\n 'group-data-[wavy]:[-webkit-mask-repeat:repeat-x] group-data-[wavy]:[mask-repeat:repeat-x]',\n 'group-data-[wavy]:[-webkit-mask-size:40px_100%] group-data-[wavy]:[mask-size:40px_100%]',\n 'group-data-[wavy]:animate-m3-wave-flow',\n // Reduced motion: freeze the loops and show a static ~40% bar / static wave.\n 'motion-reduce:group-data-[indeterminate]:w-2/5',\n 'motion-reduce:group-data-[indeterminate]:animate-none motion-reduce:group-data-[wavy]:animate-none',\n ],\n // Second disjoint bar: only present visually while indeterminate.\n indicatorSecondary: [\n 'absolute inset-y-0 left-0 w-full origin-left bg-primary rounded-full hidden',\n 'group-data-[indeterminate]:block group-data-[indeterminate]:animate-m3-linear-secondary',\n // Reduced motion: a single static bar reads better than two frozen ones.\n 'motion-reduce:group-data-[indeterminate]:hidden',\n ],\n },\n});\n\nexport const circularTv = tv({\n slots: {\n // Size comes from the factory (inline width/height) so `size` is honored.\n // Indeterminate rotates the whole ring; the arc grows/shrinks via the\n // indicator's own `dash` animation (M3 \"advance\").\n root: [\n 'group inline-flex items-center justify-center',\n '[&_svg]:block [&_svg]:size-full',\n 'data-[indeterminate]:animate-m3-circular-rotate',\n 'motion-reduce:data-[indeterminate]:animate-none',\n ],\n // Both ends are rounded (M3); the inactive track sits behind with a 4dp gap.\n track: [\n 'stroke-surface-container-highest [stroke-linecap:round]',\n 'transition-[stroke-dasharray,stroke-dashoffset] duration-300 ease-standard',\n ],\n indicator: [\n 'stroke-primary [stroke-linecap:round]',\n 'transition-[stroke-dasharray,stroke-dashoffset] duration-300 ease-standard',\n 'group-data-[indeterminate]:animate-m3-circular-dash group-data-[indeterminate]:transition-none',\n // Reduced motion: freeze the arc at its static 25% length (no rotation).\n 'motion-reduce:group-data-[indeterminate]:animate-none',\n ],\n },\n});\n\nconst l = linearTv();\nconst c = circularTv();\nexport const Progress = createProgress({\n linear: {\n root: l.root(),\n track: l.track(),\n indicator: l.indicator(),\n indicatorSecondary: l.indicatorSecondary(),\n },\n circular: { root: c.root(), track: c.track(), indicator: c.indicator() },\n});\nexport type {\n LinearProgressProps,\n CircularProgressProps,\n} from '@m3-baseui/core';\n"]}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as _base_ui_react from '@base-ui/react';
|
|
3
|
-
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
4
3
|
import * as tailwind_variants from 'tailwind-variants';
|
|
4
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
5
|
+
import * as tailwind_merge from 'tailwind-merge';
|
|
5
6
|
|
|
6
7
|
declare const radioTv: tailwind_variants.TVReturnType<{
|
|
7
8
|
[key: string]: {
|
|
8
|
-
[key: string]:
|
|
9
|
-
root?:
|
|
10
|
-
indicator?:
|
|
9
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
10
|
+
root?: tailwind_merge.ClassNameValue;
|
|
11
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
11
12
|
};
|
|
12
13
|
};
|
|
13
14
|
} | {
|
|
14
15
|
[x: string]: {
|
|
15
|
-
[x: string]:
|
|
16
|
-
root?:
|
|
17
|
-
indicator?:
|
|
16
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
|
17
|
+
root?: tailwind_merge.ClassNameValue;
|
|
18
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
21
|
} | {}, {
|
|
@@ -22,16 +23,16 @@ declare const radioTv: tailwind_variants.TVReturnType<{
|
|
|
22
23
|
indicator: string[];
|
|
23
24
|
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
24
25
|
[key: string]: {
|
|
25
|
-
[key: string]:
|
|
26
|
-
root?:
|
|
27
|
-
indicator?:
|
|
26
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
27
|
+
root?: tailwind_merge.ClassNameValue;
|
|
28
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
28
29
|
};
|
|
29
30
|
};
|
|
30
31
|
} | {}>, {
|
|
31
32
|
[key: string]: {
|
|
32
|
-
[key: string]:
|
|
33
|
-
root?:
|
|
34
|
-
indicator?:
|
|
33
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
34
|
+
root?: tailwind_merge.ClassNameValue;
|
|
35
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
35
36
|
};
|
|
36
37
|
};
|
|
37
38
|
} | {}, {
|
|
@@ -42,9 +43,9 @@ declare const radioTv: tailwind_variants.TVReturnType<{
|
|
|
42
43
|
indicator: string[];
|
|
43
44
|
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
44
45
|
[key: string]: {
|
|
45
|
-
[key: string]:
|
|
46
|
-
root?:
|
|
47
|
-
indicator?:
|
|
46
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
47
|
+
root?: tailwind_merge.ClassNameValue;
|
|
48
|
+
indicator?: tailwind_merge.ClassNameValue;
|
|
48
49
|
};
|
|
49
50
|
};
|
|
50
51
|
} | {}>, unknown, unknown, undefined>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createRadio, createRadioGroup } from '@m3-baseui/core';
|
|
3
3
|
import { tv } from 'tailwind-variants';
|
|
4
4
|
|
|
5
|
-
// src/radio.ts
|
|
5
|
+
// src/components/radio/radio.ts
|
|
6
6
|
var radioTv = tv({
|
|
7
7
|
slots: {
|
|
8
8
|
root: [
|
|
@@ -48,5 +48,5 @@ var Radio = createRadio({ root: r.root(), indicator: r.indicator() });
|
|
|
48
48
|
var RadioGroup = createRadioGroup("inline-flex flex-col gap-1");
|
|
49
49
|
|
|
50
50
|
export { Radio, RadioGroup, radioTv };
|
|
51
|
-
//# sourceMappingURL=
|
|
52
|
-
//# sourceMappingURL=
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/radio/radio.ts"],"names":[],"mappings":";;;;;AASO,IAAM,UAAU,EAAA,CAAG;AAAA,EACxB,KAAA,EAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,4EAAA;AAAA,MACA,4DAAA;AAAA;AAAA;AAAA,MAGA,2CAAA;AAAA,MACA,8CAAA;AAAA,MACA,2DAAA;AAAA;AAAA,MAEA,qBAAA;AAAA,MACA,uCAAA;AAAA;AAAA,MAEA,kFAAA;AAAA,MACA,+HAAA;AAAA,MACA,4FAAA;AAAA;AAAA,MAEA,sEAAA;AAAA,MACA,sCAAA;AAAA,MACA,oHAAA;AAAA,MACA,qHAAA;AAAA,MACA,kDAAA;AAAA,MACA,0DAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,SAAA,EAAW;AAAA,MACT,iEAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAKA,4BAAA;AAAA,MACA,wGAAA;AAAA,MACA,qDAAA;AAAA,MACA,6BAAA;AAAA,MACA;AAAA;AACF;AAEJ,CAAC;AAED,IAAM,IAAI,OAAA,EAAQ;AACX,IAAM,KAAA,GAAQ,WAAA,CAAY,EAAE,IAAA,EAAM,CAAA,CAAE,IAAA,EAAK,EAAG,SAAA,EAAW,CAAA,CAAE,SAAA,EAAU,EAAG;AAEtE,IAAM,UAAA,GAAa,iBAAiB,4BAA4B","file":"index.js","sourcesContent":["/**\n * radio.ts — tailwind-variants slots for the M3 Radio + RadioGroup.\n *\n * 20dp circle with a 40dp circular state layer; checked shows a 10dp primary dot\n * (the indicator) and recolors the ring. RadioGroup lays radios out in a column.\n */\nimport { createRadio, createRadioGroup } from '@m3-baseui/core';\nimport { tv } from 'tailwind-variants';\n\nexport const radioTv = tv({\n slots: {\n root: [\n 'group relative inline-flex items-center justify-center shrink-0 box-border',\n 'size-5 rounded-full border-2 cursor-pointer bg-transparent',\n // Ring is on-surface-variant; the state layer (text/currentColor) is\n // on-surface unselected, primary when selected (material-web).\n 'border-on-surface-variant text-on-surface',\n 'transition-colors duration-150 ease-standard',\n 'data-[checked]:border-primary data-[checked]:text-primary',\n // M3 pressed state layer inverts: unselected→primary, selected→on-surface\n 'active:text-primary',\n 'data-[checked]:active:text-on-surface',\n // M3 error: error ring + error state layer in every interaction state\n 'data-[error]:border-error data-[error]:text-error data-[error]:active:text-error',\n 'data-[error]:data-[checked]:border-error data-[error]:data-[checked]:text-error data-[error]:data-[checked]:active:text-error',\n 'focus-visible:outline-[3px] focus-visible:outline-offset-2 focus-visible:outline-secondary',\n // M3 disabled: ring (and dot) turn on-surface/38; no state layer.\n 'data-[disabled]:pointer-events-none data-[disabled]:before:opacity-0',\n 'data-[disabled]:border-on-surface/38',\n 'before:content-[\"\"] before:absolute before:left-1/2 before:top-1/2 before:-translate-x-1/2 before:-translate-y-1/2',\n 'before:size-10 before:rounded-full before:bg-current before:opacity-0 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 ],\n indicator: [\n 'block rounded-full bg-primary pointer-events-none origin-center',\n // M3 inner-circle-grow: the 10dp dot scales from center with\n // emphasized-decelerate over 300ms (token-backed), not width/height from 0.\n // Tailwind v4's `scale-*` sets the standalone `scale` property (not\n // `transform`), so the transition must name `scale` to animate the grow.\n 'size-2.5 scale-0 opacity-0',\n 'transition-[scale,opacity] ease-emphasized-decelerate duration-[var(--md-sys-motion-duration-medium2)]',\n 'data-[checked]:scale-100 data-[checked]:opacity-100',\n 'group-data-[error]:bg-error',\n 'group-data-[disabled]:bg-on-surface/38',\n ],\n },\n});\n\nconst r = radioTv();\nexport const Radio = createRadio({ root: r.root(), indicator: r.indicator() });\n\nexport const RadioGroup = createRadioGroup('inline-flex flex-col gap-1');\n"]}
|
|
@@ -1,38 +1,39 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as _base_ui_react from '@base-ui/react';
|
|
3
|
-
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
4
3
|
import * as tailwind_variants from 'tailwind-variants';
|
|
4
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
5
|
+
import * as tailwind_merge from 'tailwind-merge';
|
|
5
6
|
|
|
6
7
|
declare const searchTv: tailwind_variants.TVReturnType<{
|
|
7
8
|
[key: string]: {
|
|
8
|
-
[key: string]:
|
|
9
|
-
input?:
|
|
10
|
-
list?:
|
|
11
|
-
separator?:
|
|
12
|
-
popup?:
|
|
13
|
-
icon?:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
itemIndicator?:
|
|
17
|
-
groupLabel?:
|
|
18
|
-
|
|
19
|
-
empty?:
|
|
9
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
10
|
+
input?: tailwind_merge.ClassNameValue;
|
|
11
|
+
list?: tailwind_merge.ClassNameValue;
|
|
12
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
13
|
+
popup?: tailwind_merge.ClassNameValue;
|
|
14
|
+
icon?: tailwind_merge.ClassNameValue;
|
|
15
|
+
bar?: tailwind_merge.ClassNameValue;
|
|
16
|
+
clear?: tailwind_merge.ClassNameValue;
|
|
17
|
+
itemIndicator?: tailwind_merge.ClassNameValue;
|
|
18
|
+
groupLabel?: tailwind_merge.ClassNameValue;
|
|
19
|
+
item?: tailwind_merge.ClassNameValue;
|
|
20
|
+
empty?: tailwind_merge.ClassNameValue;
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
23
|
} | {
|
|
23
24
|
[x: string]: {
|
|
24
|
-
[x: string]:
|
|
25
|
-
input?:
|
|
26
|
-
list?:
|
|
27
|
-
separator?:
|
|
28
|
-
popup?:
|
|
29
|
-
icon?:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
itemIndicator?:
|
|
33
|
-
groupLabel?:
|
|
34
|
-
|
|
35
|
-
empty?:
|
|
25
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
|
26
|
+
input?: tailwind_merge.ClassNameValue;
|
|
27
|
+
list?: tailwind_merge.ClassNameValue;
|
|
28
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
29
|
+
popup?: tailwind_merge.ClassNameValue;
|
|
30
|
+
icon?: tailwind_merge.ClassNameValue;
|
|
31
|
+
bar?: tailwind_merge.ClassNameValue;
|
|
32
|
+
clear?: tailwind_merge.ClassNameValue;
|
|
33
|
+
itemIndicator?: tailwind_merge.ClassNameValue;
|
|
34
|
+
groupLabel?: tailwind_merge.ClassNameValue;
|
|
35
|
+
item?: tailwind_merge.ClassNameValue;
|
|
36
|
+
empty?: tailwind_merge.ClassNameValue;
|
|
36
37
|
};
|
|
37
38
|
};
|
|
38
39
|
} | {}, {
|
|
@@ -49,34 +50,34 @@ declare const searchTv: tailwind_variants.TVReturnType<{
|
|
|
49
50
|
groupLabel: string[];
|
|
50
51
|
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
51
52
|
[key: string]: {
|
|
52
|
-
[key: string]:
|
|
53
|
-
input?:
|
|
54
|
-
list?:
|
|
55
|
-
separator?:
|
|
56
|
-
popup?:
|
|
57
|
-
icon?:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
itemIndicator?:
|
|
61
|
-
groupLabel?:
|
|
62
|
-
|
|
63
|
-
empty?:
|
|
53
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
54
|
+
input?: tailwind_merge.ClassNameValue;
|
|
55
|
+
list?: tailwind_merge.ClassNameValue;
|
|
56
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
57
|
+
popup?: tailwind_merge.ClassNameValue;
|
|
58
|
+
icon?: tailwind_merge.ClassNameValue;
|
|
59
|
+
bar?: tailwind_merge.ClassNameValue;
|
|
60
|
+
clear?: tailwind_merge.ClassNameValue;
|
|
61
|
+
itemIndicator?: tailwind_merge.ClassNameValue;
|
|
62
|
+
groupLabel?: tailwind_merge.ClassNameValue;
|
|
63
|
+
item?: tailwind_merge.ClassNameValue;
|
|
64
|
+
empty?: tailwind_merge.ClassNameValue;
|
|
64
65
|
};
|
|
65
66
|
};
|
|
66
67
|
} | {}>, {
|
|
67
68
|
[key: string]: {
|
|
68
|
-
[key: string]:
|
|
69
|
-
input?:
|
|
70
|
-
list?:
|
|
71
|
-
separator?:
|
|
72
|
-
popup?:
|
|
73
|
-
icon?:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
itemIndicator?:
|
|
77
|
-
groupLabel?:
|
|
78
|
-
|
|
79
|
-
empty?:
|
|
69
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
70
|
+
input?: tailwind_merge.ClassNameValue;
|
|
71
|
+
list?: tailwind_merge.ClassNameValue;
|
|
72
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
73
|
+
popup?: tailwind_merge.ClassNameValue;
|
|
74
|
+
icon?: tailwind_merge.ClassNameValue;
|
|
75
|
+
bar?: tailwind_merge.ClassNameValue;
|
|
76
|
+
clear?: tailwind_merge.ClassNameValue;
|
|
77
|
+
itemIndicator?: tailwind_merge.ClassNameValue;
|
|
78
|
+
groupLabel?: tailwind_merge.ClassNameValue;
|
|
79
|
+
item?: tailwind_merge.ClassNameValue;
|
|
80
|
+
empty?: tailwind_merge.ClassNameValue;
|
|
80
81
|
};
|
|
81
82
|
};
|
|
82
83
|
} | {}, {
|
|
@@ -105,18 +106,18 @@ declare const searchTv: tailwind_variants.TVReturnType<{
|
|
|
105
106
|
groupLabel: string[];
|
|
106
107
|
}, undefined, tailwind_variants_dist_config_js.TVConfig<unknown, {
|
|
107
108
|
[key: string]: {
|
|
108
|
-
[key: string]:
|
|
109
|
-
input?:
|
|
110
|
-
list?:
|
|
111
|
-
separator?:
|
|
112
|
-
popup?:
|
|
113
|
-
icon?:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
itemIndicator?:
|
|
117
|
-
groupLabel?:
|
|
118
|
-
|
|
119
|
-
empty?:
|
|
109
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
110
|
+
input?: tailwind_merge.ClassNameValue;
|
|
111
|
+
list?: tailwind_merge.ClassNameValue;
|
|
112
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
113
|
+
popup?: tailwind_merge.ClassNameValue;
|
|
114
|
+
icon?: tailwind_merge.ClassNameValue;
|
|
115
|
+
bar?: tailwind_merge.ClassNameValue;
|
|
116
|
+
clear?: tailwind_merge.ClassNameValue;
|
|
117
|
+
itemIndicator?: tailwind_merge.ClassNameValue;
|
|
118
|
+
groupLabel?: tailwind_merge.ClassNameValue;
|
|
119
|
+
item?: tailwind_merge.ClassNameValue;
|
|
120
|
+
empty?: tailwind_merge.ClassNameValue;
|
|
120
121
|
};
|
|
121
122
|
};
|
|
122
123
|
} | {}>, unknown, unknown, undefined>>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { createSearch } from '@m3-baseui/core';
|
|
3
3
|
import { tv as tv$1 } from 'tailwind-variants';
|
|
4
4
|
|
|
5
|
-
// src/search.ts
|
|
5
|
+
// src/components/search/search.ts
|
|
6
6
|
var TYPESCALE = [
|
|
7
7
|
"display-large",
|
|
8
8
|
"display-medium",
|
|
@@ -31,7 +31,7 @@ var tv = (options, config) => tv$1(options, {
|
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
// src/search.ts
|
|
34
|
+
// src/components/search/search.ts
|
|
35
35
|
var searchTv = tv({
|
|
36
36
|
slots: {
|
|
37
37
|
bar: [
|
|
@@ -101,5 +101,5 @@ var Search = createSearch({
|
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
export { Search, searchTv };
|
|
104
|
-
//# sourceMappingURL=
|
|
105
|
-
//# sourceMappingURL=
|
|
104
|
+
//# sourceMappingURL=index.js.map
|
|
105
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/tv.ts","../../../src/components/search/search.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,WAAW,EAAA,CAAG;AAAA,EACzB,KAAA,EAAO;AAAA,IACL,GAAA,EAAK;AAAA,MACH,iEAAA;AAAA,MACA,wDAAA;AAAA,MACA,8CAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,IAAA,EAAM;AAAA,MACJ,0EAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL,4DAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL,gGAAA;AAAA,MACA,oEAAA;AAAA,MACA,4IAAA;AAAA,MACA,kDAAA;AAAA,MACA,0DAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO;AAAA,MACL,oFAAA;AAAA,MACA,uEAAA;AAAA,MACA,4FAAA;AAAA,MACA,gEAAA;AAAA,MACA,+BAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,IAAA,EAAM,CAAC,cAAc,CAAA;AAAA,IACrB,IAAA,EAAM;AAAA,MACJ,4FAAA;AAAA,MACA,yEAAA;AAAA,MACA,4IAAA;AAAA,MACA,kDAAA;AAAA,MACA,+DAAA;AAAA,MACA,8DAAA;AAAA,MACA,qDAAA;AAAA,MACA,6GAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,aAAA,EAAe;AAAA,MACb,yDAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,KAAA,EAAO,CAAC,oDAAoD,CAAA;AAAA,IAC5D,SAAA,EAAW,CAAC,uCAAuC,CAAA;AAAA,IACnD,UAAA,EAAY,CAAC,oDAAoD;AAAA;AAErE,CAAC;AAED,IAAM,IAAI,QAAA,EAAS;AACZ,IAAM,SAAS,YAAA,CAAa;AAAA,EACjC,GAAA,EAAK,EAAE,GAAA,EAAI;AAAA,EACX,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA,EACb,aAAA,EAAe,EAAE,aAAA,EAAc;AAAA,EAC/B,KAAA,EAAO,EAAE,KAAA,EAAM;AAAA,EACf,SAAA,EAAW,EAAE,SAAA,EAAU;AAAA,EACvB,UAAA,EAAY,EAAE,UAAA;AAChB,CAAC","file":"index.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 * search.ts — Tailwind classes for the M3 Search (search bar + docked view).\n *\n * Resting bar: surface-container-high pill (full corner, 56dp) with a leading\n * magnifier and a body-large input. The docked view is a surface-container-high\n * popup (elevation 3) whose suggestion rows carry a `before:` state layer keyed\n * to hover + Base UI's data-[highlighted]/data-[selected]. Same DOM + ripple as\n * the VE build.\n */\nimport { createSearch } from '@m3-baseui/core';\nimport { tv } from '../../tv';\n\nexport const searchTv = tv({\n slots: {\n bar: [\n 'flex items-center gap-1 h-14 min-w-[360px] max-w-full pl-4 pr-2',\n 'bg-surface-container-high text-on-surface rounded-full',\n 'transition-shadow duration-150 ease-standard',\n 'focus-within:shadow-level1',\n ],\n icon: [\n 'inline-flex shrink-0 items-center justify-center text-on-surface-variant',\n '[&>svg]:size-6',\n ],\n input: [\n 'flex-1 min-w-0 h-full bg-transparent border-0 outline-none',\n 'text-body-large text-on-surface placeholder:text-on-surface-variant',\n ],\n clear: [\n 'relative inline-flex shrink-0 items-center justify-center size-10 rounded-full overflow-hidden',\n 'text-on-surface-variant cursor-pointer outline-none [&>svg]:size-6',\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 ],\n popup: [\n 'w-[var(--anchor-width)] min-w-[360px] max-h-[min(72vh,480px)] overflow-y-auto py-2',\n 'bg-surface-container-high text-on-surface rounded-large shadow-level3',\n 'origin-[var(--transform-origin)] transition-[opacity,transform] duration-150 ease-standard',\n 'data-[starting-style]:opacity-0 data-[starting-style]:scale-95',\n 'data-[ending-style]:opacity-0',\n 'focus:outline-none',\n ],\n list: ['outline-none'],\n item: [\n 'group relative grid grid-cols-[24px_1fr_24px] items-center gap-4 h-14 px-4 overflow-hidden',\n 'cursor-pointer select-none outline-none text-body-large text-on-surface',\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 'data-[highlighted]:before:opacity-[var(--md-sys-state-hover)]',\n 'data-[selected]:before:opacity-[var(--md-sys-state-pressed)]',\n 'active:before:opacity-[var(--md-sys-state-pressed)]',\n 'data-[disabled]:text-on-surface/[0.38] data-[disabled]:before:opacity-0 data-[disabled]:pointer-events-none',\n '[&_[data-slot=search-leading]]:inline-flex [&_[data-slot=search-leading]]:text-on-surface-variant [&_[data-slot=search-leading]>svg]:size-6',\n ],\n itemIndicator: [\n 'inline-flex items-center justify-center text-on-surface',\n 'invisible group-data-[selected]:visible',\n ],\n empty: ['px-4 py-3 text-body-medium text-on-surface-variant'],\n separator: ['my-2 h-px border-0 bg-outline-variant'],\n groupLabel: ['px-4 py-2 text-label-small text-on-surface-variant'],\n },\n});\n\nconst s = searchTv();\nexport const Search = createSearch({\n bar: s.bar(),\n icon: s.icon(),\n input: s.input(),\n clear: s.clear(),\n popup: s.popup(),\n list: s.list(),\n item: s.item(),\n itemIndicator: s.itemIndicator(),\n empty: s.empty(),\n separator: s.separator(),\n groupLabel: s.groupLabel(),\n});\n"]}
|