@brightspot/ui 5.0.1 → 5.0.3-css-bloat.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/components/button-group/ButtonGroup.d.ts +14 -4
- package/dist/components/button-group/ButtonGroup.d.ts.map +1 -1
- package/dist/components/button-group/ButtonGroup.js +14 -4
- package/dist/components/button-group/ButtonGroup.js.map +1 -1
- package/dist/components/circular-progress/CircularProgress.js +2 -2
- package/dist/components/dropdown/DropdownItem.d.ts.map +1 -1
- package/dist/components/dropdown/DropdownItem.js +3 -4
- package/dist/components/dropdown/DropdownItem.js.map +1 -1
- package/dist/components/icon/Icon.d.ts.map +1 -1
- package/dist/components/icon/Icon.js +7 -4
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/linear-progress/LinearProgress.js +1 -1
- package/dist/components/tabs/Tab.js +1 -1
- package/dist/components/tabs/Tab.js.map +1 -1
- package/dist/components/upload/UploadItem.js +1 -1
- package/dist/components/upload/UploadItem.js.map +1 -1
- package/dist/components/widget/Widget.css +1 -1
- package/dist/components/widget/Widget.js +1 -1
- package/dist/custom-elements.json +781 -769
- package/dist/storybook/assets/{ActionBar.stories-IDc5Jeit.js → ActionBar.stories-DpBBnIiE.js} +1 -1
- package/dist/storybook/assets/{ActionItem.stories-FKbziuZR.js → ActionItem.stories-D-SD3oRh.js} +1 -1
- package/dist/storybook/assets/{Avatar.stories-BsAnn4F7.js → Avatar.stories-BDy6f75b.js} +1 -1
- package/dist/storybook/assets/{AvatarGroup.stories-BmNNGA4K.js → AvatarGroup.stories-D--M5Pyp.js} +5 -5
- package/dist/storybook/assets/{Badge.stories-BMb_-0Io.js → Badge.stories-BOAvuQtE.js} +1 -1
- package/dist/storybook/assets/{Button-D3vjfsjz.js → Button-DskBi-a0.js} +1 -1
- package/dist/storybook/assets/{Button.stories-VndkwLDv.js → Button.stories--V5okepx.js} +1 -1
- package/dist/storybook/assets/{ButtonGroup.stories-BvbNykTx.js → ButtonGroup.stories-DsuXsM9v.js} +48 -48
- package/dist/storybook/assets/{Celebrate.stories-DrrL3txs.js → Celebrate.stories-CgK_ukcB.js} +7 -7
- package/dist/storybook/assets/{Checkbox.stories-BS4H3-cO.js → Checkbox.stories-CahQXA2h.js} +1 -1
- package/dist/storybook/assets/{CircularProgress.stories-YQfbjx-O.js → CircularProgress.stories-BcZsN6ZV.js} +1 -1
- package/dist/storybook/assets/{ClipboardMixin.stories-DjsApoGs.js → ClipboardMixin.stories-iKXLs_Lx.js} +2 -2
- package/dist/storybook/assets/{Color-6BZIO3FS-D23VaL29.js → Color-6BZIO3FS-7ncXlNfS.js} +1 -1
- package/dist/storybook/assets/{Colors.stories-B0Eo-AgP.js → Colors.stories-CMI52WH8.js} +1 -1
- package/dist/storybook/assets/{CombinedEffects.stories-CJv4PhDZ.js → CombinedEffects.stories-pGE5o60x.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin-Bn8b1Qpq.js → ComponentStatesMixin-sjcdg7YH.js} +1 -1
- package/dist/storybook/assets/{ComponentStatesMixin.stories-CM9Nn1Vr.js → ComponentStatesMixin.stories-Dbxiy4qv.js} +3 -3
- package/dist/storybook/assets/{CopyToClipboard.stories-DdwTxinQ.js → CopyToClipboard.stories-BnYR5mPG.js} +1 -1
- package/dist/storybook/assets/{Debounce.stories-bdqs8xGz.js → Debounce.stories-nc7GvHdK.js} +3 -3
- package/dist/storybook/assets/{DocsRenderer-LL677BLK-CdjX43FI.js → DocsRenderer-LL677BLK-K-gJNtRC.js} +3 -3
- package/dist/storybook/assets/{Dropdown.stories-wY7jzy1b.js → Dropdown.stories-l-P53HBT.js} +3 -3
- package/dist/storybook/assets/{EmptyState.stories-FpHAx68-.js → EmptyState.stories-Bsui95Si.js} +15 -15
- package/dist/storybook/assets/{Events.stories-gJAakVdu.js → Events.stories-DcmUxFWp.js} +1 -1
- package/dist/storybook/assets/{Heading.stories-BqFtaYkf.js → Heading.stories-lvQ63fpM.js} +1 -1
- package/dist/storybook/assets/{HueRipple.stories-Bk1g8tT8.js → HueRipple.stories-BQ9jucCA.js} +1 -1
- package/dist/storybook/assets/{Icon.stories-sxRLpE9W.js → Icon.stories-DvL4qxSb.js} +7 -7
- package/dist/storybook/assets/{IconButton.stories-DjmbahEP.js → IconButton.stories-1W6ODsaX.js} +1 -1
- package/dist/storybook/assets/{LinearProgress.stories-DwJQwdLl.js → LinearProgress.stories-DUmR1GTa.js} +1 -1
- package/dist/storybook/assets/{Pagination.stories-Cp-E5mN-.js → Pagination.stories-Du0hsZpT.js} +3 -3
- package/dist/storybook/assets/{Popover.stories-BRW3tYFh.js → Popover.stories-DjJv1kBn.js} +18 -18
- package/dist/storybook/assets/{ReadyMixin-Btxswj_k.js → ReadyMixin-BNk5yZSB.js} +1 -1
- package/dist/storybook/assets/{RovingTabindexMixin.stories-CU7heX4w.js → RovingTabindexMixin.stories-DavyM2GK.js} +6 -6
- package/dist/storybook/assets/{Rtc.stories-CGkrXg7-.js → Rtc.stories-CfLCEC6Z.js} +1 -1
- package/dist/storybook/assets/{ScrollShadow.stories-HPqnieYi.js → ScrollShadow.stories-w4P92oTn.js} +1 -1
- package/dist/storybook/assets/{Switch.stories-SIix50Dz.js → Switch.stories-wLB1lmhw.js} +5 -5
- package/dist/storybook/assets/{Tab.stories-BJ0Dl--1.js → Tab.stories-DBpVHDFv.js} +1 -1
- package/dist/storybook/assets/{Tabs.stories-DEV7dhqr.js → Tabs.stories-pOx3oPd9.js} +1 -1
- package/dist/storybook/assets/{Throttle.stories-5l5dcEMx.js → Throttle.stories-BbNaSo1Q.js} +5 -5
- package/dist/storybook/assets/{Tooltip.stories-CJrvBRM9.js → Tooltip.stories-CYopQvk8.js} +1 -1
- package/dist/storybook/assets/{Upload.stories-HAndUW3D.js → Upload.stories-D7YbbCD8.js} +1 -1
- package/dist/storybook/assets/{UploadItem.stories-B-8IM6rL.js → UploadItem.stories-BCd0JZXJ.js} +1 -1
- package/dist/storybook/assets/{Welcome.stories-Cy7QZEXf.js → Welcome.stories-CmC1Tq-c.js} +1 -1
- package/dist/storybook/assets/{Widget.stories-DyTOXrSZ.js → Widget.stories-D6B4UeXS.js} +12 -12
- package/dist/storybook/assets/{WithTooltip-65CFNBJE-BF-px3XD.js → WithTooltip-65CFNBJE-DJFeVQni.js} +1 -1
- package/dist/storybook/assets/{blocks-B-r6Fucc.js → blocks-B3SR9dnr.js} +5 -5
- package/dist/storybook/assets/{formatter-EIJCOSYU-BhTCWHea.js → formatter-EIJCOSYU-ByY8vaiA.js} +1 -1
- package/dist/storybook/assets/if-defined-DzbkssR9.js +1 -0
- package/dist/storybook/assets/{iframe-XJ17FJi7.js → iframe-CMPv_g6-.js} +5 -5
- package/dist/storybook/assets/iframe-PeGbyIdX.css +1 -0
- package/dist/storybook/assets/{index-CQ_bLab5.js → index-DJyZoz0Z.js} +1 -1
- package/dist/storybook/assets/{onFind-RCD4BqgZ.js → onFind-B81tRmr7.js} +1 -1
- package/dist/storybook/assets/{onFind.stories-CD7vXuRn.js → onFind.stories-u0gQBbXV.js} +25 -25
- package/dist/storybook/assets/{onRemove.stories-Dm8HrW-w.js → onRemove.stories-Bo0PhHGT.js} +3 -3
- package/dist/storybook/assets/{onVisible.stories-CigtHPTK.js → onVisible.stories-Db1s-swH.js} +1 -1
- package/dist/storybook/assets/{style-map-C3PJ2niZ.js → style-map-968Ye5qo.js} +1 -1
- package/dist/storybook/assets/{syntaxhighlighter-ED5Y7EFY-DIlzdeob.js → syntaxhighlighter-ED5Y7EFY-yvF0gUqy.js} +1 -1
- package/dist/storybook/iframe.html +2 -2
- package/dist/storybook/project.json +1 -1
- package/dist/tailwind-plugin-button-group.js +43 -44
- package/dist/tailwind-plugin-button-group.js.map +1 -1
- package/dist/tailwind-plugin-button-group.ts +43 -43
- package/dist/tailwind-plugin-button.js +22 -2
- package/dist/tailwind-plugin-button.js.map +1 -1
- package/dist/tailwind-plugin-button.ts +22 -2
- package/dist/tailwind-plugin-dropdown.js +6 -2
- package/dist/tailwind-plugin-dropdown.js.map +1 -1
- package/dist/tailwind-plugin-dropdown.ts +6 -2
- package/dist/tailwind-plugin-pagination.js +12 -8
- package/dist/tailwind-plugin-pagination.js.map +1 -1
- package/dist/tailwind-plugin-pagination.ts +12 -8
- package/dist/tailwind-plugin-upload.js +3 -2
- package/dist/tailwind-plugin-upload.js.map +1 -1
- package/dist/tailwind-plugin-upload.ts +3 -2
- package/dist/tailwind.config.d.ts +1 -4
- package/dist/tailwind.config.d.ts.map +1 -1
- package/dist/tailwind.config.js +74 -6
- package/dist/tailwind.config.js.map +1 -1
- package/dist/tailwind.config.ts +74 -6
- package/docs/adr/0001-monolith-css-delivery.md +20 -0
- package/docs/adr/0002-complete-component-preset.md +26 -0
- package/docs/adr/0003-plugin-selector-isolation.md +24 -0
- package/docs/adr/0004-dynamic-icon-names-route-through-runtime-injectors.md +50 -0
- package/docs/adr/0005-rtl-conditional-overlay.md +44 -0
- package/docs/adr/0006-editor-has-runtime-perf.md +33 -0
- package/docs/components/ButtonGroup.md +15 -12
- package/package.json +4 -3
- package/src/legacy/tool-ui/src/AIInline.css +1 -1
- package/src/legacy/tool-ui/src/Admin.css +2 -2
- package/src/legacy/tool-ui/src/Base.css +1 -1
- package/src/legacy/tool-ui/src/BulkUpload.css +1 -1
- package/src/legacy/tool-ui/src/CIGCluster.css +1 -1
- package/src/legacy/tool-ui/src/Card.css +1 -1
- package/src/legacy/tool-ui/src/CodeMirror.css +4 -4
- package/src/legacy/tool-ui/src/ColorInputSpectrum.css +2 -2
- package/src/legacy/tool-ui/src/ComboInput.css +3 -3
- package/src/legacy/tool-ui/src/Compat.css +1 -1
- package/src/legacy/tool-ui/src/ContentEdit.css +12 -12
- package/src/legacy/tool-ui/src/ContentEditDrawer.css +6 -6
- package/src/legacy/tool-ui/src/ContentInputGroup.css +1 -1
- package/src/legacy/tool-ui/src/ContentReporting.css +2 -2
- package/src/legacy/tool-ui/src/ContentSelector.css +5 -5
- package/src/legacy/tool-ui/src/ContentSummary.css +1 -1
- package/src/legacy/tool-ui/src/ContentTemplatesWidget.css +1 -1
- package/src/legacy/tool-ui/src/ContentTools.css +1 -1
- package/src/legacy/tool-ui/src/Conversation.css +2 -2
- package/src/legacy/tool-ui/src/Crosslinker.css +3 -3
- package/src/legacy/tool-ui/src/DashboardWidget.css +1 -1
- package/src/legacy/tool-ui/src/Dialog.css +4 -2
- package/src/legacy/tool-ui/src/Diff.css +1 -1
- package/src/legacy/tool-ui/src/Dropdown.css +2 -2
- package/src/legacy/tool-ui/src/Enhancement.css +1 -1
- package/src/legacy/tool-ui/src/FileInput.css +2 -2
- package/src/legacy/tool-ui/src/FormFilter.css +3 -3
- package/src/legacy/tool-ui/src/FullscreenView.css +4 -4
- package/src/legacy/tool-ui/src/Guide.css +6 -6
- package/src/legacy/tool-ui/src/Hierarchy.css +4 -4
- package/src/legacy/tool-ui/src/ImageEditor.css +13 -13
- package/src/legacy/tool-ui/src/LinkCarousel.css +1 -1
- package/src/legacy/tool-ui/src/LiveBlog.css +2 -2
- package/src/legacy/tool-ui/src/LocationMap.css +1 -1
- package/src/legacy/tool-ui/src/MailPublishing.css +1 -1
- package/src/legacy/tool-ui/src/MenuView.css +4 -4
- package/src/legacy/tool-ui/src/Message.css +1 -1
- package/src/legacy/tool-ui/src/Page.css +35 -16
- package/src/legacy/tool-ui/src/Popup.css +8 -3
- package/src/legacy/tool-ui/src/ProseMirror.css +1 -1
- package/src/legacy/tool-ui/src/ProseMirrorContainer.css +1 -1
- package/src/legacy/tool-ui/src/ProseMirrorEnhancementMenu.css +2 -2
- package/src/legacy/tool-ui/src/ProseMirrorFindReplace.css +2 -2
- package/src/legacy/tool-ui/src/QueryField.css +1 -1
- package/src/legacy/tool-ui/src/RepeatableContentInputGroup.css +1 -1
- package/src/legacy/tool-ui/src/RepeatableContentSelector.css +1 -1
- package/src/legacy/tool-ui/src/RichText.css +1 -1
- package/src/legacy/tool-ui/src/SearchFields.css +1 -1
- package/src/legacy/tool-ui/src/SearchResult.css +3 -3
- package/src/legacy/tool-ui/src/SearchWidget.css +1 -1
- package/src/legacy/tool-ui/src/SearchWidgetAdvanced.css +1 -1
- package/src/legacy/tool-ui/src/StyleEmbeddedContent.css +3 -3
- package/src/legacy/tool-ui/src/TabBar.css +1 -1
- package/src/legacy/tool-ui/src/Table.css +1 -1
- package/src/legacy/tool-ui/src/Taxonomy.css +4 -4
- package/src/legacy/tool-ui/src/ThemeBundleEditor.css +1 -1
- package/src/legacy/tool-ui/src/TimedContent.css +2 -2
- package/src/legacy/tool-ui/src/ViewWatchers.css +1 -1
- package/src/legacy/tool-ui/src/Widget.css +1 -1
- package/src/legacy/tool-ui/src/Workflow.css +3 -3
- package/src/legacy/tool-ui/src/main/webapp/dist/{7718.a937b0cafa8cf7c039d2.css → 2111.70d9e2ee26ead4bd147b.css} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{2111.a937b0cafa8cf7c039d2.css → 7718.70d9e2ee26ead4bd147b.css} +1 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/{v4.de442a0b430071a7803d.js → v4.ab96a7dd75fa7af9c970.js} +2 -2
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.844c5f9e05e351ee0579.css +5 -0
- package/src/legacy/tool-ui/src/main/webapp/dist/{v5.5ce74760f3fb482bec5e.js → v5.e48c1d8f41b5e088bef0.js} +2 -2
- package/dist/storybook/assets/if-defined-CxLwFifW.js +0 -1
- package/dist/storybook/assets/iframe-D0roG0J-.css +0 -1
- package/src/legacy/tool-ui/src/main/webapp/dist/v5.68dab4082aba302779ed.css +0 -5
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v4.de442a0b430071a7803d.js.LICENSE.txt → v4.ab96a7dd75fa7af9c970.js.LICENSE.txt} +0 -0
- /package/src/legacy/tool-ui/src/main/webapp/dist/{v5.5ce74760f3fb482bec5e.js.LICENSE.txt → v5.e48c1d8f41b5e088bef0.js.LICENSE.txt} +0 -0
|
@@ -3,9 +3,15 @@ import plugin from 'tailwindcss/plugin';
|
|
|
3
3
|
* Button Group — Tailwind CSS plugin for grouping related buttons.
|
|
4
4
|
*
|
|
5
5
|
* Provides connected (joined) and spaced layouts with horizontal/vertical orientation.
|
|
6
|
-
* Supports both direct
|
|
7
|
-
* `btu-icon-button` uses `display: contents` so its inner button
|
|
8
|
-
* directly in the group's flex layout.
|
|
6
|
+
* Supports both direct `<button class="btu-button">` children and `btu-icon-button`
|
|
7
|
+
* children. `btu-icon-button` uses `display: contents` so its inner `<button>`
|
|
8
|
+
* participates directly in the group's flex layout.
|
|
9
|
+
*
|
|
10
|
+
* Selectors target the `button` element, not the `.btu-button` class. So an
|
|
11
|
+
* anchor styled as `.btu-button` (`<a class="btu-button">`) slotted directly
|
|
12
|
+
* into a connected group will NOT get the outer-corner radius. Use a real
|
|
13
|
+
* `<button>` (or `<btu-icon-button>`) for grouped controls; for link-styled
|
|
14
|
+
* ones, use the spaced variant.
|
|
9
15
|
*
|
|
10
16
|
* Selection uses a circular wipe transition: a `::after` pseudo-element with
|
|
11
17
|
* `clip-path: circle()` reveals the selection color from the center outward.
|
|
@@ -22,15 +28,13 @@ import plugin from 'tailwindcss/plugin';
|
|
|
22
28
|
* --button-group-selection-bg - Selection background color (auto-set per color variant)
|
|
23
29
|
* --button-group-selection-color - Selection text color (auto-set per color variant)
|
|
24
30
|
*/
|
|
25
|
-
module.exports = plugin(function ({ addComponents, addBase
|
|
31
|
+
module.exports = plugin(function ({ addComponents, addBase }) {
|
|
26
32
|
const connected = 'btu-button-group[variant="connected"]';
|
|
27
33
|
const connectedH = `${connected}[orientation="horizontal"]`;
|
|
28
34
|
const connectedV = `${connected}[orientation="vertical"]`;
|
|
29
35
|
const allSelected = `${connected}[data-all-selected]`;
|
|
30
36
|
const borderColor = 'var(--button-group-border-color, oklch(var(--btu-theme-gray-300)))';
|
|
31
37
|
const outerRadius = 'var(--button-group-border-radius, 0.5rem)';
|
|
32
|
-
const skipColors = new Set(['currentColor', 'transparent', 'white', 'black', 'ai']);
|
|
33
|
-
const colors = theme('colors') || {};
|
|
34
38
|
const components = {
|
|
35
39
|
// ─── Base ─────────────────────────────────────────────────────────
|
|
36
40
|
'.btu-button-group': {
|
|
@@ -52,31 +56,31 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
52
56
|
gap: 'var(--button-group-gap, var(--gap-s, 0.5rem))',
|
|
53
57
|
},
|
|
54
58
|
// ─── slot="end" auto-margin ──────────────────────────────────────
|
|
55
|
-
// Direct children and inner
|
|
56
|
-
'btu-button-group[orientation="horizontal"] > [slot="end"], btu-button-group[orientation="horizontal"] > [slot="end"] >
|
|
59
|
+
// Direct children and inner button (for display:contents wrappers like btu-icon-button)
|
|
60
|
+
'btu-button-group[orientation="horizontal"] > [slot="end"], btu-button-group[orientation="horizontal"] > [slot="end"] > button': {
|
|
57
61
|
marginInlineStart: 'auto',
|
|
58
62
|
},
|
|
59
|
-
'btu-button-group[orientation="vertical"] > [slot="end"], btu-button-group[orientation="vertical"] > [slot="end"] >
|
|
63
|
+
'btu-button-group[orientation="vertical"] > [slot="end"], btu-button-group[orientation="vertical"] > [slot="end"] > button': {
|
|
60
64
|
marginBlockStart: 'auto',
|
|
61
65
|
},
|
|
62
66
|
// ─── Size propagation via CSS ─────────────────────────────────────
|
|
63
|
-
'btu-button-group[size="small"]
|
|
67
|
+
'btu-button-group[size="small"] button': {
|
|
64
68
|
padding: 'var(--button-padding-sm)',
|
|
65
69
|
width: 'var(--button-size-sm, auto)',
|
|
66
70
|
height: 'var(--button-size-sm, auto)',
|
|
67
71
|
},
|
|
68
|
-
'btu-button-group[size="medium"]
|
|
72
|
+
'btu-button-group[size="medium"] button': {
|
|
69
73
|
padding: 'var(--button-padding-md)',
|
|
70
74
|
width: 'var(--button-size-md, auto)',
|
|
71
75
|
height: 'var(--button-size-md, auto)',
|
|
72
76
|
},
|
|
73
|
-
'btu-button-group[size="large"]
|
|
77
|
+
'btu-button-group[size="large"] button': {
|
|
74
78
|
padding: 'var(--button-padding-lg)',
|
|
75
79
|
width: 'var(--button-size-lg, auto)',
|
|
76
80
|
height: 'var(--button-size-lg, auto)',
|
|
77
81
|
},
|
|
78
82
|
// ─── Connected: convert outline buttons to border-based ───────────
|
|
79
|
-
[`${connected}
|
|
83
|
+
[`${connected} button`]: {
|
|
80
84
|
outline: 'none',
|
|
81
85
|
border: `1px solid ${borderColor}`,
|
|
82
86
|
transition: 'box-shadow 100ms ease, filter 100ms ease',
|
|
@@ -87,52 +91,54 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
87
91
|
},
|
|
88
92
|
},
|
|
89
93
|
// ─── Disabled buttons ─────────────────────────────────────────────
|
|
90
|
-
'.btu-button-group
|
|
94
|
+
'.btu-button-group button:disabled, .btu-button-group button[disabled]': {
|
|
91
95
|
opacity: '0.5',
|
|
92
96
|
cursor: 'default',
|
|
93
97
|
},
|
|
94
98
|
// ─── Selection wipe: disable button plugin's instant pressed toggle ─
|
|
95
99
|
// The ::after pseudo handles the pressed background via clip-path wipe,
|
|
96
100
|
// so the button itself must stay at its normal (non-pressed) color.
|
|
97
|
-
'
|
|
101
|
+
// Selection colors default to the button's own --button-tint-* shades,
|
|
102
|
+
// overridable via the documented --button-group-* properties.
|
|
103
|
+
'.btu-button-group button[aria-pressed]': {
|
|
98
104
|
'--button-pressed-color': 'initial',
|
|
99
105
|
'--button-pressed-text-color': 'initial',
|
|
100
106
|
isolation: 'isolate',
|
|
101
107
|
transition: 'color 150ms ease-in',
|
|
102
108
|
},
|
|
103
|
-
'.btu-button-group
|
|
109
|
+
'.btu-button-group button[aria-pressed]::after': {
|
|
104
110
|
content: '""',
|
|
105
111
|
position: 'absolute',
|
|
106
112
|
inset: '0',
|
|
107
113
|
zIndex: '-1',
|
|
108
114
|
borderRadius: 'inherit',
|
|
109
|
-
background: 'var(--button-group-selection-bg)',
|
|
115
|
+
background: 'var(--button-group-selection-bg, var(--button-tint-subtle))',
|
|
110
116
|
clipPath: 'circle(0% at center)',
|
|
111
117
|
transition: 'clip-path 150ms ease-in',
|
|
112
118
|
},
|
|
113
119
|
// ─── Selection wipe: active state ─────────────────────────────────
|
|
114
|
-
'.btu-button-group
|
|
115
|
-
color: 'var(--button-group-selection-color)',
|
|
120
|
+
'.btu-button-group button[aria-pressed="true"]': {
|
|
121
|
+
color: 'var(--button-group-selection-color, var(--button-tint-strong))',
|
|
116
122
|
transition: 'color 200ms ease-out',
|
|
117
123
|
},
|
|
118
|
-
'.btu-button-group
|
|
124
|
+
'.btu-button-group button[aria-pressed="true"]::after': {
|
|
119
125
|
clipPath: 'circle(75% at center)',
|
|
120
126
|
transition: 'clip-path 200ms ease-out',
|
|
121
127
|
},
|
|
122
128
|
// ─── Reduced motion ─────────────────────────────────────────────────
|
|
123
129
|
'@media (prefers-reduced-motion: reduce)': {
|
|
124
|
-
'.btu-button-group
|
|
130
|
+
'.btu-button-group button[aria-pressed]': {
|
|
125
131
|
transition: 'color 0.01ms ease',
|
|
126
132
|
},
|
|
127
|
-
'.btu-button-group
|
|
133
|
+
'.btu-button-group button[aria-pressed]::after': {
|
|
128
134
|
transition: 'clip-path 0.01ms ease',
|
|
129
135
|
},
|
|
130
|
-
[`${allSelected}
|
|
136
|
+
[`${allSelected} button[aria-pressed="true"]`]: {
|
|
131
137
|
animation: 'none',
|
|
132
138
|
},
|
|
133
139
|
},
|
|
134
140
|
// ─── Connected variant — horizontal ───────────────────────────────
|
|
135
|
-
[`${connectedH}
|
|
141
|
+
[`${connectedH} button`]: {
|
|
136
142
|
borderRadius: '0',
|
|
137
143
|
marginInlineEnd: '-1px',
|
|
138
144
|
position: 'relative',
|
|
@@ -143,17 +149,17 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
143
149
|
zIndex: '2',
|
|
144
150
|
},
|
|
145
151
|
},
|
|
146
|
-
[`${connectedH} > :first-child:is(
|
|
152
|
+
[`${connectedH} > :first-child:is(button), ${connectedH} > :first-child > button`]: {
|
|
147
153
|
borderStartStartRadius: outerRadius,
|
|
148
154
|
borderEndStartRadius: outerRadius,
|
|
149
155
|
},
|
|
150
|
-
[`${connectedH} > :last-child:is(
|
|
156
|
+
[`${connectedH} > :last-child:is(button), ${connectedH} > :last-child > button`]: {
|
|
151
157
|
borderStartEndRadius: outerRadius,
|
|
152
158
|
borderEndEndRadius: outerRadius,
|
|
153
159
|
marginInlineEnd: '0',
|
|
154
160
|
},
|
|
155
161
|
// ─── Connected variant — vertical ─────────────────────────────────
|
|
156
|
-
[`${connectedV}
|
|
162
|
+
[`${connectedV} button`]: {
|
|
157
163
|
borderRadius: '0',
|
|
158
164
|
marginBlockEnd: '-1px',
|
|
159
165
|
position: 'relative',
|
|
@@ -164,11 +170,11 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
164
170
|
zIndex: '2',
|
|
165
171
|
},
|
|
166
172
|
},
|
|
167
|
-
[`${connectedV} > :first-child:is(
|
|
173
|
+
[`${connectedV} > :first-child:is(button), ${connectedV} > :first-child > button`]: {
|
|
168
174
|
borderStartStartRadius: outerRadius,
|
|
169
175
|
borderStartEndRadius: outerRadius,
|
|
170
176
|
},
|
|
171
|
-
[`${connectedV} > :last-child:is(
|
|
177
|
+
[`${connectedV} > :last-child:is(button), ${connectedV} > :last-child > button`]: {
|
|
172
178
|
borderEndStartRadius: outerRadius,
|
|
173
179
|
borderEndEndRadius: outerRadius,
|
|
174
180
|
marginBlockEnd: '0',
|
|
@@ -182,32 +188,25 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
182
188
|
};
|
|
183
189
|
// ─── All-selected shimmer (connected only) ─────────────────────────
|
|
184
190
|
// Text color pulse + border color pulse on each button, staggered.
|
|
185
|
-
components[`${allSelected}
|
|
191
|
+
components[`${allSelected} button[aria-pressed="true"]`] = {
|
|
186
192
|
animation: 'btu-shimmer-all 500ms ease-in-out both',
|
|
187
193
|
animationDelay: 'calc((var(--_btn-index, 1) - 1) * 100ms)',
|
|
188
194
|
};
|
|
189
|
-
//
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
const pressedKey = key === 'gray' ? 'primary' : key;
|
|
194
|
-
components[`.btu-button-group .btu-button-${key}`] = {
|
|
195
|
-
'--button-group-selection-bg': `oklch(var(--btu-theme-${pressedKey}-50))`,
|
|
196
|
-
'--button-group-selection-color': `oklch(var(--btu-theme-${pressedKey}-800))`,
|
|
197
|
-
'--button-group-shimmer-highlight': `oklch(var(--btu-theme-${pressedKey}-200))`,
|
|
198
|
-
};
|
|
199
|
-
}
|
|
195
|
+
// Selection colors come from each button's own --button-tint-* shades
|
|
196
|
+
// (set by the button plugin per color variant). The documented
|
|
197
|
+
// --button-group-selection-* / --button-group-shimmer-highlight properties
|
|
198
|
+
// still override them.
|
|
200
199
|
addComponents(components);
|
|
201
200
|
// Keyframes must be added via addBase (not addComponents)
|
|
202
201
|
addBase({
|
|
203
202
|
'@keyframes btu-shimmer-all': {
|
|
204
203
|
'0%, 100%': {
|
|
205
|
-
color: 'var(--button-group-selection-color)',
|
|
204
|
+
color: 'var(--button-group-selection-color, var(--button-tint-strong))',
|
|
206
205
|
borderColor: 'var(--button-group-border-color, oklch(var(--btu-theme-gray-300)))',
|
|
207
206
|
},
|
|
208
207
|
'40%, 60%': {
|
|
209
|
-
color: 'var(--button-group-shimmer-highlight)',
|
|
210
|
-
borderColor: 'var(--button-group-shimmer-highlight)',
|
|
208
|
+
color: 'var(--button-group-shimmer-highlight, var(--button-tint-highlight))',
|
|
209
|
+
borderColor: 'var(--button-group-shimmer-highlight, var(--button-tint-highlight))',
|
|
211
210
|
},
|
|
212
211
|
},
|
|
213
212
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-plugin-button-group.js","sourceRoot":"","sources":["../src/tailwind-plugin-button-group.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAIvC
|
|
1
|
+
{"version":3,"file":"tailwind-plugin-button-group.js","sourceRoot":"","sources":["../src/tailwind-plugin-button-group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AA0C;KAC3D,CAAA;IAED,sEAAsE;IACtE,+DAA+D;IAC/D,2EAA2E;IAC3E,uBAAuB;IAEvB,aAAa,CAAC,UAAU,CAAC,CAAA;IAEzB,0DAA0D;IAC1D,OAAO,CAAC;QACN,4BAA4B,EAAE;YAC5B,UAAU,EAAE;gBACV,KAAK,EAAE,gEAAgE;gBACvE,WAAW,EAAE,oEAAoE;aAClF;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,qEAAqE;gBAC5E,WAAW,EAAE,qEAAqE;aACnF;SACF;KACF,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -6,9 +6,15 @@ declare let module: any
|
|
|
6
6
|
* Button Group — Tailwind CSS plugin for grouping related buttons.
|
|
7
7
|
*
|
|
8
8
|
* Provides connected (joined) and spaced layouts with horizontal/vertical orientation.
|
|
9
|
-
* Supports both direct
|
|
10
|
-
* `btu-icon-button` uses `display: contents` so its inner button
|
|
11
|
-
* directly in the group's flex layout.
|
|
9
|
+
* Supports both direct `<button class="btu-button">` children and `btu-icon-button`
|
|
10
|
+
* children. `btu-icon-button` uses `display: contents` so its inner `<button>`
|
|
11
|
+
* participates directly in the group's flex layout.
|
|
12
|
+
*
|
|
13
|
+
* Selectors target the `button` element, not the `.btu-button` class. So an
|
|
14
|
+
* anchor styled as `.btu-button` (`<a class="btu-button">`) slotted directly
|
|
15
|
+
* into a connected group will NOT get the outer-corner radius. Use a real
|
|
16
|
+
* `<button>` (or `<btu-icon-button>`) for grouped controls; for link-styled
|
|
17
|
+
* ones, use the spaced variant.
|
|
12
18
|
*
|
|
13
19
|
* Selection uses a circular wipe transition: a `::after` pseudo-element with
|
|
14
20
|
* `clip-path: circle()` reveals the selection color from the center outward.
|
|
@@ -26,15 +32,13 @@ declare let module: any
|
|
|
26
32
|
* --button-group-selection-color - Selection text color (auto-set per color variant)
|
|
27
33
|
*/
|
|
28
34
|
|
|
29
|
-
module.exports = plugin(function ({ addComponents, addBase
|
|
35
|
+
module.exports = plugin(function ({ addComponents, addBase }) {
|
|
30
36
|
const connected = 'btu-button-group[variant="connected"]'
|
|
31
37
|
const connectedH = `${connected}[orientation="horizontal"]`
|
|
32
38
|
const connectedV = `${connected}[orientation="vertical"]`
|
|
33
39
|
const allSelected = `${connected}[data-all-selected]`
|
|
34
40
|
const borderColor = 'var(--button-group-border-color, oklch(var(--btu-theme-gray-300)))'
|
|
35
41
|
const outerRadius = 'var(--button-group-border-radius, 0.5rem)'
|
|
36
|
-
const skipColors = new Set(['currentColor', 'transparent', 'white', 'black', 'ai'])
|
|
37
|
-
const colors: CSSRuleObject = theme('colors') || {}
|
|
38
42
|
|
|
39
43
|
const components: CSSRuleObject = {
|
|
40
44
|
// ─── Base ─────────────────────────────────────────────────────────
|
|
@@ -61,35 +65,35 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
61
65
|
},
|
|
62
66
|
|
|
63
67
|
// ─── slot="end" auto-margin ──────────────────────────────────────
|
|
64
|
-
// Direct children and inner
|
|
65
|
-
'btu-button-group[orientation="horizontal"] > [slot="end"], btu-button-group[orientation="horizontal"] > [slot="end"] >
|
|
68
|
+
// Direct children and inner button (for display:contents wrappers like btu-icon-button)
|
|
69
|
+
'btu-button-group[orientation="horizontal"] > [slot="end"], btu-button-group[orientation="horizontal"] > [slot="end"] > button':
|
|
66
70
|
{
|
|
67
71
|
marginInlineStart: 'auto',
|
|
68
72
|
},
|
|
69
|
-
'btu-button-group[orientation="vertical"] > [slot="end"], btu-button-group[orientation="vertical"] > [slot="end"] >
|
|
73
|
+
'btu-button-group[orientation="vertical"] > [slot="end"], btu-button-group[orientation="vertical"] > [slot="end"] > button':
|
|
70
74
|
{
|
|
71
75
|
marginBlockStart: 'auto',
|
|
72
76
|
},
|
|
73
77
|
|
|
74
78
|
// ─── Size propagation via CSS ─────────────────────────────────────
|
|
75
|
-
'btu-button-group[size="small"]
|
|
79
|
+
'btu-button-group[size="small"] button': {
|
|
76
80
|
padding: 'var(--button-padding-sm)',
|
|
77
81
|
width: 'var(--button-size-sm, auto)',
|
|
78
82
|
height: 'var(--button-size-sm, auto)',
|
|
79
83
|
},
|
|
80
|
-
'btu-button-group[size="medium"]
|
|
84
|
+
'btu-button-group[size="medium"] button': {
|
|
81
85
|
padding: 'var(--button-padding-md)',
|
|
82
86
|
width: 'var(--button-size-md, auto)',
|
|
83
87
|
height: 'var(--button-size-md, auto)',
|
|
84
88
|
},
|
|
85
|
-
'btu-button-group[size="large"]
|
|
89
|
+
'btu-button-group[size="large"] button': {
|
|
86
90
|
padding: 'var(--button-padding-lg)',
|
|
87
91
|
width: 'var(--button-size-lg, auto)',
|
|
88
92
|
height: 'var(--button-size-lg, auto)',
|
|
89
93
|
},
|
|
90
94
|
|
|
91
95
|
// ─── Connected: convert outline buttons to border-based ───────────
|
|
92
|
-
[`${connected}
|
|
96
|
+
[`${connected} button`]: {
|
|
93
97
|
outline: 'none',
|
|
94
98
|
border: `1px solid ${borderColor}`,
|
|
95
99
|
transition: 'box-shadow 100ms ease, filter 100ms ease',
|
|
@@ -101,7 +105,7 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
101
105
|
},
|
|
102
106
|
|
|
103
107
|
// ─── Disabled buttons ─────────────────────────────────────────────
|
|
104
|
-
'.btu-button-group
|
|
108
|
+
'.btu-button-group button:disabled, .btu-button-group button[disabled]': {
|
|
105
109
|
opacity: '0.5',
|
|
106
110
|
cursor: 'default',
|
|
107
111
|
},
|
|
@@ -109,49 +113,51 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
109
113
|
// ─── Selection wipe: disable button plugin's instant pressed toggle ─
|
|
110
114
|
// The ::after pseudo handles the pressed background via clip-path wipe,
|
|
111
115
|
// so the button itself must stay at its normal (non-pressed) color.
|
|
112
|
-
'
|
|
116
|
+
// Selection colors default to the button's own --button-tint-* shades,
|
|
117
|
+
// overridable via the documented --button-group-* properties.
|
|
118
|
+
'.btu-button-group button[aria-pressed]': {
|
|
113
119
|
'--button-pressed-color': 'initial',
|
|
114
120
|
'--button-pressed-text-color': 'initial',
|
|
115
121
|
isolation: 'isolate',
|
|
116
122
|
transition: 'color 150ms ease-in',
|
|
117
123
|
},
|
|
118
|
-
'.btu-button-group
|
|
124
|
+
'.btu-button-group button[aria-pressed]::after': {
|
|
119
125
|
content: '""',
|
|
120
126
|
position: 'absolute',
|
|
121
127
|
inset: '0',
|
|
122
128
|
zIndex: '-1',
|
|
123
129
|
borderRadius: 'inherit',
|
|
124
|
-
background: 'var(--button-group-selection-bg)',
|
|
130
|
+
background: 'var(--button-group-selection-bg, var(--button-tint-subtle))',
|
|
125
131
|
clipPath: 'circle(0% at center)',
|
|
126
132
|
transition: 'clip-path 150ms ease-in',
|
|
127
133
|
},
|
|
128
134
|
|
|
129
135
|
// ─── Selection wipe: active state ─────────────────────────────────
|
|
130
|
-
'.btu-button-group
|
|
131
|
-
color: 'var(--button-group-selection-color)',
|
|
136
|
+
'.btu-button-group button[aria-pressed="true"]': {
|
|
137
|
+
color: 'var(--button-group-selection-color, var(--button-tint-strong))',
|
|
132
138
|
transition: 'color 200ms ease-out',
|
|
133
139
|
},
|
|
134
140
|
|
|
135
|
-
'.btu-button-group
|
|
141
|
+
'.btu-button-group button[aria-pressed="true"]::after': {
|
|
136
142
|
clipPath: 'circle(75% at center)',
|
|
137
143
|
transition: 'clip-path 200ms ease-out',
|
|
138
144
|
},
|
|
139
145
|
|
|
140
146
|
// ─── Reduced motion ─────────────────────────────────────────────────
|
|
141
147
|
'@media (prefers-reduced-motion: reduce)': {
|
|
142
|
-
'.btu-button-group
|
|
148
|
+
'.btu-button-group button[aria-pressed]': {
|
|
143
149
|
transition: 'color 0.01ms ease',
|
|
144
150
|
},
|
|
145
|
-
'.btu-button-group
|
|
151
|
+
'.btu-button-group button[aria-pressed]::after': {
|
|
146
152
|
transition: 'clip-path 0.01ms ease',
|
|
147
153
|
},
|
|
148
|
-
[`${allSelected}
|
|
154
|
+
[`${allSelected} button[aria-pressed="true"]`]: {
|
|
149
155
|
animation: 'none',
|
|
150
156
|
},
|
|
151
157
|
},
|
|
152
158
|
|
|
153
159
|
// ─── Connected variant — horizontal ───────────────────────────────
|
|
154
|
-
[`${connectedH}
|
|
160
|
+
[`${connectedH} button`]: {
|
|
155
161
|
borderRadius: '0',
|
|
156
162
|
marginInlineEnd: '-1px',
|
|
157
163
|
position: 'relative',
|
|
@@ -162,18 +168,18 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
162
168
|
zIndex: '2',
|
|
163
169
|
},
|
|
164
170
|
},
|
|
165
|
-
[`${connectedH} > :first-child:is(
|
|
171
|
+
[`${connectedH} > :first-child:is(button), ${connectedH} > :first-child > button`]: {
|
|
166
172
|
borderStartStartRadius: outerRadius,
|
|
167
173
|
borderEndStartRadius: outerRadius,
|
|
168
174
|
},
|
|
169
|
-
[`${connectedH} > :last-child:is(
|
|
175
|
+
[`${connectedH} > :last-child:is(button), ${connectedH} > :last-child > button`]: {
|
|
170
176
|
borderStartEndRadius: outerRadius,
|
|
171
177
|
borderEndEndRadius: outerRadius,
|
|
172
178
|
marginInlineEnd: '0',
|
|
173
179
|
},
|
|
174
180
|
|
|
175
181
|
// ─── Connected variant — vertical ─────────────────────────────────
|
|
176
|
-
[`${connectedV}
|
|
182
|
+
[`${connectedV} button`]: {
|
|
177
183
|
borderRadius: '0',
|
|
178
184
|
marginBlockEnd: '-1px',
|
|
179
185
|
position: 'relative',
|
|
@@ -184,11 +190,11 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
184
190
|
zIndex: '2',
|
|
185
191
|
},
|
|
186
192
|
},
|
|
187
|
-
[`${connectedV} > :first-child:is(
|
|
193
|
+
[`${connectedV} > :first-child:is(button), ${connectedV} > :first-child > button`]: {
|
|
188
194
|
borderStartStartRadius: outerRadius,
|
|
189
195
|
borderStartEndRadius: outerRadius,
|
|
190
196
|
},
|
|
191
|
-
[`${connectedV} > :last-child:is(
|
|
197
|
+
[`${connectedV} > :last-child:is(button), ${connectedV} > :last-child > button`]: {
|
|
192
198
|
borderEndStartRadius: outerRadius,
|
|
193
199
|
borderEndEndRadius: outerRadius,
|
|
194
200
|
marginBlockEnd: '0',
|
|
@@ -204,21 +210,15 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
204
210
|
|
|
205
211
|
// ─── All-selected shimmer (connected only) ─────────────────────────
|
|
206
212
|
// Text color pulse + border color pulse on each button, staggered.
|
|
207
|
-
components[`${allSelected}
|
|
213
|
+
components[`${allSelected} button[aria-pressed="true"]`] = {
|
|
208
214
|
animation: 'btu-shimmer-all 500ms ease-in-out both',
|
|
209
215
|
animationDelay: 'calc((var(--_btn-index, 1) - 1) * 100ms)',
|
|
210
216
|
}
|
|
211
217
|
|
|
212
|
-
//
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
components[`.btu-button-group .btu-button-${key}`] = {
|
|
217
|
-
'--button-group-selection-bg': `oklch(var(--btu-theme-${pressedKey}-50))`,
|
|
218
|
-
'--button-group-selection-color': `oklch(var(--btu-theme-${pressedKey}-800))`,
|
|
219
|
-
'--button-group-shimmer-highlight': `oklch(var(--btu-theme-${pressedKey}-200))`,
|
|
220
|
-
}
|
|
221
|
-
}
|
|
218
|
+
// Selection colors come from each button's own --button-tint-* shades
|
|
219
|
+
// (set by the button plugin per color variant). The documented
|
|
220
|
+
// --button-group-selection-* / --button-group-shimmer-highlight properties
|
|
221
|
+
// still override them.
|
|
222
222
|
|
|
223
223
|
addComponents(components)
|
|
224
224
|
|
|
@@ -226,12 +226,12 @@ module.exports = plugin(function ({ addComponents, addBase, theme }) {
|
|
|
226
226
|
addBase({
|
|
227
227
|
'@keyframes btu-shimmer-all': {
|
|
228
228
|
'0%, 100%': {
|
|
229
|
-
color: 'var(--button-group-selection-color)',
|
|
229
|
+
color: 'var(--button-group-selection-color, var(--button-tint-strong))',
|
|
230
230
|
borderColor: 'var(--button-group-border-color, oklch(var(--btu-theme-gray-300)))',
|
|
231
231
|
},
|
|
232
232
|
'40%, 60%': {
|
|
233
|
-
color: 'var(--button-group-shimmer-highlight)',
|
|
234
|
-
borderColor: 'var(--button-group-shimmer-highlight)',
|
|
233
|
+
color: 'var(--button-group-shimmer-highlight, var(--button-tint-highlight))',
|
|
234
|
+
borderColor: 'var(--button-group-shimmer-highlight, var(--button-tint-highlight))',
|
|
235
235
|
},
|
|
236
236
|
},
|
|
237
237
|
})
|
|
@@ -19,6 +19,14 @@ import plugin from 'tailwindcss/plugin';
|
|
|
19
19
|
*
|
|
20
20
|
* Search toolbar icon button -> btu-button btu-button-text-hidden btu-button-fill-none
|
|
21
21
|
* btu-button-gray before:btu-icon before:btu-icon-search
|
|
22
|
+
*
|
|
23
|
+
* Each color variant exposes a few CSS custom properties so a parent (e.g.
|
|
24
|
+
* btu-button-group) can pick up the button's color family without having to
|
|
25
|
+
* name its color class:
|
|
26
|
+
*
|
|
27
|
+
* --button-tint-subtle - light shade (selected background)
|
|
28
|
+
* --button-tint-strong - dark shade (selected text)
|
|
29
|
+
* --button-tint-highlight - mid shade (accent/highlight)
|
|
22
30
|
*/
|
|
23
31
|
module.exports = plugin(function ({ addComponents, addUtilities, theme }) {
|
|
24
32
|
const textSizes = theme('fontSize');
|
|
@@ -41,6 +49,12 @@ module.exports = plugin(function ({ addComponents, addUtilities, theme }) {
|
|
|
41
49
|
'--button-text-color': '',
|
|
42
50
|
'--button-pressed': 'initial',
|
|
43
51
|
'--button-fill-none': 'initial',
|
|
52
|
+
// Baseline color-family tints so an uncolored .btu-button still has
|
|
53
|
+
// sensible values for components that read these (e.g. btu-button-group
|
|
54
|
+
// selection background). Per-color variants overwrite further below.
|
|
55
|
+
'--button-tint-subtle': 'oklch(var(--btu-theme-primary-50))',
|
|
56
|
+
'--button-tint-strong': 'oklch(var(--btu-theme-primary-800))',
|
|
57
|
+
'--button-tint-highlight': 'oklch(var(--btu-theme-primary-200))',
|
|
44
58
|
'--button-padding-xs': '0.25rem 0.5rem',
|
|
45
59
|
'--button-padding-sm': '0.5rem 0.875rem',
|
|
46
60
|
'--button-padding-md': '0.625rem 1rem',
|
|
@@ -145,6 +159,8 @@ module.exports = plugin(function ({ addComponents, addUtilities, theme }) {
|
|
|
145
159
|
if (key === 'currentColor' || key === 'transparent' || key === 'white' || key === 'black' || key === 'ai')
|
|
146
160
|
continue;
|
|
147
161
|
const ringColorKey = key === 'success' || key === 'error' ? key : 'primary';
|
|
162
|
+
// Gray buttons borrow primary for their pressed/selected tint.
|
|
163
|
+
const tintKey = key === 'gray' ? 'primary' : key;
|
|
148
164
|
const focusStyle = {
|
|
149
165
|
'--button-color': `oklch(var(--btu-theme-${key}-${key === 'gray' ? '100' : key === 'success' ? '700' : '600'}))`,
|
|
150
166
|
'--button-fill-none-color': `transparent`,
|
|
@@ -166,8 +182,12 @@ module.exports = plugin(function ({ addComponents, addUtilities, theme }) {
|
|
|
166
182
|
'--button-disabled-color-fill': `oklch(var(--btu-theme-${key}-${key === 'gray' ? '100' : key === 'primary' ? '300' : '200'}))`,
|
|
167
183
|
'--button-disabled-color-fill-none': `var(--button-fill-none) oklch(var(--btu-theme-white))`,
|
|
168
184
|
'--button-disabled-text-color-fill-none': `var(--button-fill-none) oklch(var(--btu-theme-${key}-${key === 'gray' ? '400' : '300'}))`,
|
|
169
|
-
'--button-pressed-color': `var(--button-pressed) var(--button-disabled-color, oklch(var(--btu-theme-${
|
|
170
|
-
'--button-pressed-text-color': `var(--button-pressed) var(--button-disabled-text-color, oklch(var(--btu-theme-${
|
|
185
|
+
'--button-pressed-color': `var(--button-pressed) var(--button-disabled-color, oklch(var(--btu-theme-${tintKey}-50)))`,
|
|
186
|
+
'--button-pressed-text-color': `var(--button-pressed) var(--button-disabled-text-color, oklch(var(--btu-theme-${tintKey}-800)))`,
|
|
187
|
+
// Plain color tints other components can read (always set, no toggle).
|
|
188
|
+
'--button-tint-subtle': `oklch(var(--btu-theme-${tintKey}-50))`,
|
|
189
|
+
'--button-tint-strong': `oklch(var(--btu-theme-${tintKey}-800))`,
|
|
190
|
+
'--button-tint-highlight': `oklch(var(--btu-theme-${tintKey}-200))`,
|
|
171
191
|
'&:hover': {
|
|
172
192
|
'--button-color': `oklch(var(--btu-theme-${key}-${key === 'gray' ? '200' : key === 'success' ? '800' : '700'}))`,
|
|
173
193
|
'--button-fill-none-color': `oklch(var(--btu-theme-${key}-${key === 'gray' ? '200' : '50'}))`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind-plugin-button.js","sourceRoot":"","sources":["../src/tailwind-plugin-button.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAIvC
|
|
1
|
+
{"version":3,"file":"tailwind-plugin-button.js","sourceRoot":"","sources":["../src/tailwind-plugin-button.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAIvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAE;IACtE,MAAM,SAAS,GAAqC,KAAK,CAAC,UAAU,CAAC,CAAA;IACrE,MAAM,MAAM,GAAkB,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAA;IACnD,MAAM,SAAS,GAAkB,KAAK,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;IACxD,MAAM,MAAM,GAAG,aAAa,CAAA;IAE5B,MAAM,aAAa,GAAkB;QACnC,yBAAyB,EAAE,6GAA6G;QACxI,8BAA8B,EAAE,yGAAyG;QACzI,aAAa,EAAE,MAAM;QACrB,UAAU,EAAE,MAAM;KACnB,CAAA;IAED,MAAM,WAAW,GAAkB;QACjC,kBAAkB,EAAE,GAAG;KACxB,CAAA;IAED,MAAM,UAAU,GAAkB;QAChC,aAAa,EAAE;YACb,iBAAiB;YACjB,gBAAgB,EAAE,EAAE;YACpB,qBAAqB,EAAE,EAAE;YACzB,kBAAkB,EAA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AAA;IACD,YAAY,CAAC,iBAAiB,CAAC,CAAA;AACjC,CAAC,CAAC,CAAA"}
|
|
@@ -22,6 +22,14 @@ declare let module: any
|
|
|
22
22
|
*
|
|
23
23
|
* Search toolbar icon button -> btu-button btu-button-text-hidden btu-button-fill-none
|
|
24
24
|
* btu-button-gray before:btu-icon before:btu-icon-search
|
|
25
|
+
*
|
|
26
|
+
* Each color variant exposes a few CSS custom properties so a parent (e.g.
|
|
27
|
+
* btu-button-group) can pick up the button's color family without having to
|
|
28
|
+
* name its color class:
|
|
29
|
+
*
|
|
30
|
+
* --button-tint-subtle - light shade (selected background)
|
|
31
|
+
* --button-tint-strong - dark shade (selected text)
|
|
32
|
+
* --button-tint-highlight - mid shade (accent/highlight)
|
|
25
33
|
*/
|
|
26
34
|
|
|
27
35
|
module.exports = plugin(function ({ addComponents, addUtilities, theme }) {
|
|
@@ -48,6 +56,12 @@ module.exports = plugin(function ({ addComponents, addUtilities, theme }) {
|
|
|
48
56
|
'--button-text-color': '',
|
|
49
57
|
'--button-pressed': 'initial',
|
|
50
58
|
'--button-fill-none': 'initial',
|
|
59
|
+
// Baseline color-family tints so an uncolored .btu-button still has
|
|
60
|
+
// sensible values for components that read these (e.g. btu-button-group
|
|
61
|
+
// selection background). Per-color variants overwrite further below.
|
|
62
|
+
'--button-tint-subtle': 'oklch(var(--btu-theme-primary-50))',
|
|
63
|
+
'--button-tint-strong': 'oklch(var(--btu-theme-primary-800))',
|
|
64
|
+
'--button-tint-highlight': 'oklch(var(--btu-theme-primary-200))',
|
|
51
65
|
'--button-padding-xs': '0.25rem 0.5rem',
|
|
52
66
|
'--button-padding-sm': '0.5rem 0.875rem',
|
|
53
67
|
'--button-padding-md': '0.625rem 1rem',
|
|
@@ -153,6 +167,8 @@ module.exports = plugin(function ({ addComponents, addUtilities, theme }) {
|
|
|
153
167
|
for (const key in colors) {
|
|
154
168
|
if (key === 'currentColor' || key === 'transparent' || key === 'white' || key === 'black' || key === 'ai') continue
|
|
155
169
|
const ringColorKey = key === 'success' || key === 'error' ? key : 'primary'
|
|
170
|
+
// Gray buttons borrow primary for their pressed/selected tint.
|
|
171
|
+
const tintKey = key === 'gray' ? 'primary' : key
|
|
156
172
|
const focusStyle: CSSRuleObject = {
|
|
157
173
|
'--button-color': `oklch(var(--btu-theme-${key}-${key === 'gray' ? '100' : key === 'success' ? '700' : '600'}))`,
|
|
158
174
|
'--button-fill-none-color': `transparent`,
|
|
@@ -174,8 +190,12 @@ module.exports = plugin(function ({ addComponents, addUtilities, theme }) {
|
|
|
174
190
|
'--button-disabled-color-fill': `oklch(var(--btu-theme-${key}-${key === 'gray' ? '100' : key === 'primary' ? '300' : '200'}))`,
|
|
175
191
|
'--button-disabled-color-fill-none': `var(--button-fill-none) oklch(var(--btu-theme-white))`,
|
|
176
192
|
'--button-disabled-text-color-fill-none': `var(--button-fill-none) oklch(var(--btu-theme-${key}-${key === 'gray' ? '400' : '300'}))`,
|
|
177
|
-
'--button-pressed-color': `var(--button-pressed) var(--button-disabled-color, oklch(var(--btu-theme-${
|
|
178
|
-
'--button-pressed-text-color': `var(--button-pressed) var(--button-disabled-text-color, oklch(var(--btu-theme-${
|
|
193
|
+
'--button-pressed-color': `var(--button-pressed) var(--button-disabled-color, oklch(var(--btu-theme-${tintKey}-50)))`,
|
|
194
|
+
'--button-pressed-text-color': `var(--button-pressed) var(--button-disabled-text-color, oklch(var(--btu-theme-${tintKey}-800)))`,
|
|
195
|
+
// Plain color tints other components can read (always set, no toggle).
|
|
196
|
+
'--button-tint-subtle': `oklch(var(--btu-theme-${tintKey}-50))`,
|
|
197
|
+
'--button-tint-strong': `oklch(var(--btu-theme-${tintKey}-800))`,
|
|
198
|
+
'--button-tint-highlight': `oklch(var(--btu-theme-${tintKey}-200))`,
|
|
179
199
|
'&:hover': {
|
|
180
200
|
'--button-color': `oklch(var(--btu-theme-${key}-${key === 'gray' ? '200' : key === 'success' ? '800' : '700'}))`,
|
|
181
201
|
'--button-fill-none-color': `oklch(var(--btu-theme-${key}-${key === 'gray' ? '200' : '50'}))`,
|
|
@@ -192,8 +192,12 @@ module.exports = plugin(function ({ addComponents, config, theme }) {
|
|
|
192
192
|
transition: 'transform 200ms ease',
|
|
193
193
|
flexShrink: '0',
|
|
194
194
|
},
|
|
195
|
-
/*
|
|
196
|
-
|
|
195
|
+
/* Trigger with chevron: restore auto width + gap so the icon and chevron
|
|
196
|
+
fit. Matches every chevron trigger, but is a no-op on labelled triggers
|
|
197
|
+
(`.btu-button` already defaults to width:auto/gap:0.5rem). The effective
|
|
198
|
+
target is icon-only triggers, where `.btu-button-text-hidden` forces a
|
|
199
|
+
fixed square width and gap:0 — which would otherwise clip the chevron. */
|
|
200
|
+
'btu-dropdown > button:has(.btu-dropdown-chevron)': {
|
|
197
201
|
width: 'auto',
|
|
198
202
|
gap: '0.5rem',
|
|
199
203
|
},
|