@epilot/volt-ui-experimental-griffel 0.2.3 → 0.3.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/ADOPTING.md +416 -0
- package/README.md +32 -31
- package/dist/_virtual/jsx-dev-runtime.js +5 -0
- package/dist/_virtual/jsx-dev-runtime.js.map +1 -0
- package/dist/_virtual/react-jsx-dev-runtime.development.js +5 -0
- package/dist/_virtual/react-jsx-dev-runtime.development.js.map +1 -0
- package/dist/_virtual/react-jsx-dev-runtime.production.js +5 -0
- package/dist/_virtual/react-jsx-dev-runtime.production.js.map +1 -0
- package/dist/components/accordion/accordion.js +126 -66
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +239 -137
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/avatar/avatar-group.js +102 -47
- package/dist/components/avatar/avatar-group.js.map +1 -1
- package/dist/components/avatar/avatar.js +97 -73
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js +53 -37
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +97 -49
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js +88 -77
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js +55 -31
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/callout/callout.js +288 -164
- package/dist/components/callout/callout.js.map +1 -1
- package/dist/components/card/card.js +137 -81
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +100 -49
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js +155 -107
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
- package/dist/components/command/command.js +297 -158
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/data-table/data-table-body.js +114 -54
- package/dist/components/data-table/data-table-body.js.map +1 -1
- package/dist/components/data-table/data-table-column-header.js +117 -45
- package/dist/components/data-table/data-table-column-header.js.map +1 -1
- package/dist/components/data-table/data-table-column-visibility.js +98 -39
- package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
- package/dist/components/data-table/data-table-content.js +90 -58
- package/dist/components/data-table/data-table-content.js.map +1 -1
- package/dist/components/data-table/data-table-error.js +83 -39
- package/dist/components/data-table/data-table-error.js.map +1 -1
- package/dist/components/data-table/data-table-header.js +88 -54
- package/dist/components/data-table/data-table-header.js.map +1 -1
- package/dist/components/data-table/data-table-loading.js +27 -15
- package/dist/components/data-table/data-table-loading.js.map +1 -1
- package/dist/components/data-table/data-table-pagination.js +27 -19
- package/dist/components/data-table/data-table-pagination.js.map +1 -1
- package/dist/components/data-table/data-table-row.js +87 -64
- package/dist/components/data-table/data-table-row.js.map +1 -1
- package/dist/components/data-table/data-table-toolbar.js +24 -16
- package/dist/components/data-table/data-table-toolbar.js.map +1 -1
- package/dist/components/data-table/data-table.js +182 -145
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +342 -214
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/range-calendar.js +132 -92
- package/dist/components/date-range-picker/range-calendar.js.map +1 -1
- package/dist/components/date-time-picker/calendar.js +501 -317
- package/dist/components/date-time-picker/calendar.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-context.js +64 -60
- package/dist/components/date-time-picker/date-time-picker-context.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-input.js +249 -149
- package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-panel.js +273 -165
- package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-popover.js +22 -14
- package/dist/components/date-time-picker/date-time-picker-popover.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker.js +134 -90
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
- package/dist/components/date-time-picker/time-picker.js +198 -132
- package/dist/components/date-time-picker/time-picker.js.map +1 -1
- package/dist/components/density-provider/density-provider.js +48 -0
- package/dist/components/density-provider/density-provider.js.map +1 -0
- package/dist/components/dialog/dialog.js +280 -150
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +273 -163
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +378 -195
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +447 -240
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field-select.js +23 -19
- package/dist/components/field/field-select.js.map +1 -1
- package/dist/components/field/field.js +318 -209
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/label/label.js +27 -19
- package/dist/components/label/label.js.map +1 -1
- package/dist/components/list/list.js +623 -369
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/option-card/option-card.js +323 -159
- package/dist/components/option-card/option-card.js.map +1 -1
- package/dist/components/pill/pill.js +82 -64
- package/dist/components/pill/pill.js.map +1 -1
- package/dist/components/popover/popover.js +101 -56
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/radio/radio.js +94 -51
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-overflow/scroll-overflow.js +350 -198
- package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +141 -97
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +452 -227
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.js +24 -16
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/skeleton/skeleton.js +83 -43
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/spinner/spinner.js +44 -20
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/switch/switch.js +163 -86
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +465 -205
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/table/table.js +212 -144
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.js +94 -58
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/text/text.js +40 -32
- package/dist/components/text/text.js.map +1 -1
- package/dist/components/toast/toast.js +187 -111
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle-group.js +40 -24
- package/dist/components/toggle/toggle-group.js.map +1 -1
- package/dist/components/toggle/toggle.js +48 -40
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +101 -55
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +600 -427
- package/dist/index.js +215 -212
- package/dist/index.js.map +1 -1
- package/dist/lib/clear-button.js +27 -15
- package/dist/lib/clear-button.js.map +1 -1
- package/dist/lib/icons.js +18 -6
- package/dist/lib/icons.js.map +1 -1
- package/dist/packages/volt-runtime/dist/sheet.js +27 -10
- package/dist/packages/volt-runtime/dist/sheet.js.map +1 -1
- package/dist/packages/volt-runtime/dist/styles/recipe.js +76 -0
- package/dist/packages/volt-runtime/dist/styles/recipe.js.map +1 -0
- package/dist/styles/document-context.js +12 -0
- package/dist/styles/document-context.js.map +1 -0
- package/dist/styles/make-styles.js +18 -10
- package/dist/styles/make-styles.js.map +1 -1
- package/dist/tokens/core.generated.js +1238 -1166
- package/dist/tokens/core.generated.js.map +1 -1
- package/dist/tokens/index.d.ts +442 -415
- package/dist/tokens/index.js +1105 -1078
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/install.js +9 -5
- package/dist/tokens/install.js.map +1 -1
- package/dist/tokens/use-palette-tokens.js +20 -0
- package/dist/tokens/use-palette-tokens.js.map +1 -0
- package/dist/tokens.json +83 -2
- package/dist/vendor/react/cjs/react-jsx-dev-runtime.development.js +236 -0
- package/dist/vendor/react/cjs/react-jsx-dev-runtime.development.js.map +1 -0
- package/dist/vendor/react/cjs/react-jsx-dev-runtime.production.js +21 -0
- package/dist/vendor/react/cjs/react-jsx-dev-runtime.production.js.map +1 -0
- package/dist/vendor/react/jsx-dev-runtime.js +9 -0
- package/dist/vendor/react/jsx-dev-runtime.js.map +1 -0
- package/package.json +13 -5
- package/scripts/migration-diagnostics-core.mjs +859 -0
- package/scripts/migration-diagnostics.mjs +353 -0
- package/scripts/migration-sweep.mjs +179 -0
- package/AGENTS.md +0 -153
- package/AUTHORING.md +0 -292
- package/dist/packages/volt-runtime/dist/styles/make-styles.js +0 -22
- package/dist/packages/volt-runtime/dist/styles/make-styles.js.map +0 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { shorthands as
|
|
4
|
-
import { SLOT_ATTR as
|
|
5
|
-
import { mergeClasses as
|
|
6
|
-
import { makeVoltStyles as
|
|
7
|
-
import { spacingElement3 as
|
|
8
|
-
import { Root as
|
|
9
|
-
const
|
|
1
|
+
import { j as v } from "../../vendor/react/jsx-dev-runtime.js";
|
|
2
|
+
import * as S from "react";
|
|
3
|
+
import { shorthands as e } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/index.js";
|
|
4
|
+
import { SLOT_ATTR as k } from "../../packages/volt-runtime/dist/renderer/contract.js";
|
|
5
|
+
import { mergeClasses as C } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/mergeClasses.js";
|
|
6
|
+
import { makeVoltStyles as x } from "../../styles/make-styles.js";
|
|
7
|
+
import { buttonBasePaddingInline as y, spacingElement3 as w, radiusLg as H, buttonIconSize as i, leadingLg as B, textLg as A, leadingBase as E, textBase as R, buttonBaseMinHeight as D, leadingSm as I, textSm as z, leadingXs as L, textXs as j, semErrorSoft as n, errorA11 as N, semErrorSoftHover as O, semErrorOnSoft as X, semErrorSolidHover as s, semErrorContrast as T, semErrorSolid as W, semAccentSoft as t, grayA12 as P, accentA11 as V, semAccentSoftHover as F, semAccentOnSoft as M, semAccentSolidHover as a, semAccentContrast as Q, semAccentSolid as U, semFocusRing as _, fontWeightSemibold as $ } from "../../tokens/index.js";
|
|
8
|
+
import { Root as q } from "../../vendor/@radix-ui/react-slot/dist/index.js";
|
|
9
|
+
const G = "button", J = x({
|
|
10
10
|
root: {
|
|
11
11
|
display: "inline-flex",
|
|
12
12
|
alignItems: "center",
|
|
13
13
|
justifyContent: "center",
|
|
14
|
-
fontWeight:
|
|
14
|
+
fontWeight: $,
|
|
15
15
|
whiteSpace: "nowrap",
|
|
16
16
|
transitionProperty: "all",
|
|
17
17
|
cursor: "pointer",
|
|
@@ -20,7 +20,11 @@ const q = "button", F = w({
|
|
|
20
20
|
":focus-visible": {
|
|
21
21
|
outlineWidth: "2px",
|
|
22
22
|
outlineStyle: "solid",
|
|
23
|
-
outlineOffset: "2px"
|
|
23
|
+
outlineOffset: "2px",
|
|
24
|
+
outlineColor: _
|
|
25
|
+
},
|
|
26
|
+
"@media (prefers-reduced-motion: reduce)": {
|
|
27
|
+
transitionDuration: "0.01ms"
|
|
24
28
|
},
|
|
25
29
|
"& svg": {
|
|
26
30
|
flexShrink: 0,
|
|
@@ -29,81 +33,78 @@ const q = "button", F = w({
|
|
|
29
33
|
}
|
|
30
34
|
},
|
|
31
35
|
primary: {
|
|
32
|
-
backgroundColor:
|
|
36
|
+
backgroundColor: U,
|
|
33
37
|
color: Q,
|
|
34
|
-
":hover": { backgroundColor:
|
|
35
|
-
":active": { backgroundColor:
|
|
36
|
-
":focus-visible": { outlineColor: n }
|
|
38
|
+
":hover": { backgroundColor: a },
|
|
39
|
+
":active": { backgroundColor: a }
|
|
37
40
|
},
|
|
38
41
|
secondary: {
|
|
39
|
-
backgroundColor:
|
|
40
|
-
color:
|
|
41
|
-
":hover": { backgroundColor:
|
|
42
|
-
":focus-visible": { outlineColor: n }
|
|
42
|
+
backgroundColor: t,
|
|
43
|
+
color: M,
|
|
44
|
+
":hover": { backgroundColor: F }
|
|
43
45
|
},
|
|
44
46
|
tertiary: {
|
|
45
47
|
backgroundColor: "transparent",
|
|
46
|
-
color:
|
|
47
|
-
":hover": { backgroundColor:
|
|
48
|
-
":focus-visible": { outlineColor: n }
|
|
48
|
+
color: V,
|
|
49
|
+
":hover": { backgroundColor: t }
|
|
49
50
|
},
|
|
50
51
|
ghost: {
|
|
51
52
|
backgroundColor: "transparent",
|
|
52
|
-
color:
|
|
53
|
-
":hover": { backgroundColor:
|
|
54
|
-
":focus-visible": { outlineColor: O }
|
|
53
|
+
color: P,
|
|
54
|
+
":hover": { backgroundColor: t }
|
|
55
55
|
},
|
|
56
56
|
primaryDestructive: {
|
|
57
|
-
backgroundColor:
|
|
58
|
-
color:
|
|
59
|
-
":hover": { backgroundColor:
|
|
60
|
-
":active": { backgroundColor:
|
|
61
|
-
":focus-visible": { outlineColor: t }
|
|
57
|
+
backgroundColor: W,
|
|
58
|
+
color: T,
|
|
59
|
+
":hover": { backgroundColor: s },
|
|
60
|
+
":active": { backgroundColor: s }
|
|
62
61
|
},
|
|
63
62
|
secondaryDestructive: {
|
|
64
|
-
backgroundColor:
|
|
65
|
-
color:
|
|
66
|
-
":hover": { backgroundColor:
|
|
67
|
-
":focus-visible": { outlineColor: t }
|
|
63
|
+
backgroundColor: n,
|
|
64
|
+
color: X,
|
|
65
|
+
":hover": { backgroundColor: O }
|
|
68
66
|
},
|
|
69
67
|
tertiaryDestructive: {
|
|
70
68
|
backgroundColor: "transparent",
|
|
71
|
-
color:
|
|
72
|
-
":hover": { backgroundColor:
|
|
73
|
-
":focus-visible": { outlineColor: t }
|
|
69
|
+
color: N,
|
|
70
|
+
":hover": { backgroundColor: n }
|
|
74
71
|
},
|
|
75
72
|
xs: {
|
|
76
|
-
...
|
|
77
|
-
...
|
|
73
|
+
...e.paddingInline("0.5rem"),
|
|
74
|
+
...e.paddingBlock("0.25rem"),
|
|
78
75
|
minHeight: "1.25rem",
|
|
79
|
-
fontSize:
|
|
80
|
-
lineHeight:
|
|
76
|
+
fontSize: j,
|
|
77
|
+
lineHeight: L,
|
|
81
78
|
gap: "4px",
|
|
82
79
|
"& svg": { width: "0.75rem", height: "0.75rem" }
|
|
83
80
|
},
|
|
84
81
|
sm: {
|
|
85
|
-
...
|
|
86
|
-
...
|
|
82
|
+
...e.paddingInline(w),
|
|
83
|
+
...e.paddingBlock("0.25rem"),
|
|
87
84
|
minHeight: "1.5rem",
|
|
88
|
-
fontSize:
|
|
89
|
-
lineHeight:
|
|
85
|
+
fontSize: z,
|
|
86
|
+
lineHeight: I,
|
|
90
87
|
gap: "0.375rem",
|
|
91
88
|
"& svg": { width: "0.875rem", height: "0.875rem" }
|
|
92
89
|
},
|
|
93
90
|
base: {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
// Density-bound (DENSITY-SPEC.md §2.4, WP9B1-ACCEPTANCE-WP9B2A): padding-inline is the
|
|
92
|
+
// compact/comfortable lever; min-height is floored by the fixed line-height + padding-block
|
|
93
|
+
// below and cannot shrink, so it is bound too (compact === normal, comfortable raised via an
|
|
94
|
+
// explicit minHeight above the natural content box, same mechanism `lg` already uses).
|
|
95
|
+
...e.paddingInline(y),
|
|
96
|
+
...e.paddingBlock("0.25rem"),
|
|
97
|
+
minHeight: D,
|
|
98
|
+
fontSize: R,
|
|
98
99
|
lineHeight: E,
|
|
99
100
|
gap: "0.5rem",
|
|
100
101
|
"& svg": { width: "1rem", height: "1rem" }
|
|
101
102
|
},
|
|
102
103
|
lg: {
|
|
103
|
-
...
|
|
104
|
-
...
|
|
104
|
+
...e.paddingInline("1.25rem"),
|
|
105
|
+
...e.paddingBlock("0.25rem"),
|
|
105
106
|
minHeight: "2.5rem",
|
|
106
|
-
fontSize:
|
|
107
|
+
fontSize: A,
|
|
107
108
|
lineHeight: B,
|
|
108
109
|
gap: "0.5rem",
|
|
109
110
|
"& svg": { width: "1rem", height: "1rem" }
|
|
@@ -119,8 +120,10 @@ const q = "button", F = w({
|
|
|
119
120
|
"& svg": { width: "0.875rem", height: "0.875rem" }
|
|
120
121
|
},
|
|
121
122
|
icon: {
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
// Density-bound: a fixed square, no line-height floor (unlike `base`), so compact/comfortable
|
|
124
|
+
// both move freely (DENSITY-SPEC.md §2.4).
|
|
125
|
+
width: i,
|
|
126
|
+
height: i,
|
|
124
127
|
"& svg": { width: "1.125rem", height: "1.125rem" }
|
|
125
128
|
},
|
|
126
129
|
iconLg: {
|
|
@@ -130,17 +133,17 @@ const q = "button", F = w({
|
|
|
130
133
|
},
|
|
131
134
|
normal: { borderRadius: H },
|
|
132
135
|
rounded: { borderRadius: "9999px" }
|
|
133
|
-
}),
|
|
136
|
+
}), ne = S.forwardRef(
|
|
134
137
|
function({
|
|
135
138
|
variant: r = "primary",
|
|
136
|
-
size:
|
|
137
|
-
shape:
|
|
138
|
-
destructive:
|
|
139
|
-
className:
|
|
140
|
-
asChild:
|
|
141
|
-
...
|
|
142
|
-
},
|
|
143
|
-
const
|
|
139
|
+
size: m = "base",
|
|
140
|
+
shape: l = "rounded",
|
|
141
|
+
destructive: c = !1,
|
|
142
|
+
className: g,
|
|
143
|
+
asChild: d = !1,
|
|
144
|
+
...h
|
|
145
|
+
}, u) {
|
|
146
|
+
const o = J(), p = c && r !== "ghost" ? `${r}Destructive` : r, f = {
|
|
144
147
|
xs: "xs",
|
|
145
148
|
sm: "sm",
|
|
146
149
|
base: "base",
|
|
@@ -149,26 +152,34 @@ const q = "button", F = w({
|
|
|
149
152
|
"icon-sm": "iconSm",
|
|
150
153
|
icon: "icon",
|
|
151
154
|
"icon-lg": "iconLg"
|
|
152
|
-
}[
|
|
153
|
-
return /* @__PURE__ */
|
|
154
|
-
|
|
155
|
+
}[m], b = d ? q : G;
|
|
156
|
+
return /* @__PURE__ */ v.jsxDEV(
|
|
157
|
+
b,
|
|
155
158
|
{
|
|
156
|
-
ref:
|
|
159
|
+
ref: u,
|
|
157
160
|
"data-slot": "button",
|
|
158
|
-
[
|
|
159
|
-
className:
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
161
|
+
[k]: "button",
|
|
162
|
+
className: C(
|
|
163
|
+
o.root,
|
|
164
|
+
o[p],
|
|
165
|
+
o[f],
|
|
166
|
+
o[l],
|
|
167
|
+
g
|
|
165
168
|
),
|
|
166
|
-
...
|
|
167
|
-
}
|
|
169
|
+
...h
|
|
170
|
+
},
|
|
171
|
+
void 0,
|
|
172
|
+
!1,
|
|
173
|
+
{
|
|
174
|
+
fileName: "/Users/wilianmolinari/repos/volt-ui-rollout/release/packages/experimental-griffel/src/components/button/button.tsx",
|
|
175
|
+
lineNumber: 231,
|
|
176
|
+
columnNumber: 7
|
|
177
|
+
},
|
|
178
|
+
this
|
|
168
179
|
);
|
|
169
180
|
}
|
|
170
181
|
);
|
|
171
182
|
export {
|
|
172
|
-
|
|
183
|
+
ne as Button
|
|
173
184
|
};
|
|
174
185
|
//# sourceMappingURL=button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\n/**\n * Base UI's type declarations resolve `react` from the hoisted root's `@types/react` (v19), while\n * this package pins `@types/react` 18 in its own node_modules. Re-typing the primitive onto OUR\n * `React` keeps the button's pass-through props and ref on one React type for this package.\n */\n/**\n * A native `<button>`, no primitive.\n *\n * v1's only Radix use here is `Slot`, purely to implement `asChild`, and this does the same. Base\n * UI's button primitive supplied nothing v1 had: it added a dependency, and with it the\n * `@types/react` 19 requirement, for a plain element.\n */\nconst ButtonBase = \"button\" as const\n\nconst useStyles = makeVoltStyles({\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontWeight: tokens.fontWeightSemibold,\n whiteSpace: \"nowrap\",\n transitionProperty: \"all\",\n cursor: \"pointer\",\n flexShrink: 0,\n \":disabled\": { opacity: 0.5 },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n primary: {\n backgroundColor: tokens.semAccentSolid,\n color: tokens.semAccentContrast,\n \":hover\": { backgroundColor: tokens.semAccentSolidHover },\n \":active\": { backgroundColor: tokens.semAccentSolidHover },\n \":focus-visible\": { outlineColor: tokens.accentA8 },\n },\n secondary: {\n backgroundColor: tokens.semAccentSoft,\n color: tokens.accentA11,\n \":hover\": { backgroundColor: tokens.semAccentSoftHover },\n \":focus-visible\": { outlineColor: tokens.accentA8 },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: tokens.accentA11,\n \":hover\": { backgroundColor: tokens.semAccentSoft },\n \":focus-visible\": { outlineColor: tokens.accentA8 },\n },\n ghost: {\n backgroundColor: \"transparent\",\n color: tokens.grayA12,\n \":hover\": { backgroundColor: tokens.semAccentSoft },\n \":focus-visible\": { outlineColor: tokens.grayA8 },\n },\n primaryDestructive: {\n backgroundColor: tokens.semErrorSolid,\n color: tokens.semErrorContrast,\n \":hover\": { backgroundColor: tokens.semErrorSolidHover },\n \":active\": { backgroundColor: tokens.semErrorSolidHover },\n \":focus-visible\": { outlineColor: tokens.errorA8 },\n },\n secondaryDestructive: {\n backgroundColor: tokens.semErrorSoft,\n color: tokens.errorA11,\n \":hover\": { backgroundColor: tokens.semErrorSoftHover },\n \":focus-visible\": { outlineColor: tokens.errorA8 },\n },\n tertiaryDestructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorA11,\n \":hover\": { backgroundColor: tokens.semErrorSoft },\n \":focus-visible\": { outlineColor: tokens.errorA8 },\n },\n xs: {\n ...shorthands.paddingInline(\"0.5rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"1.25rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n gap: \"4px\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n sm: {\n ...shorthands.paddingInline(tokens.spacingElement3),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"1.5rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n gap: \"0.375rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n base: {\n ...shorthands.paddingInline(\"1rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2rem\",\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...shorthands.paddingInline(\"1.25rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2.5rem\",\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n iconXs: {\n width: \"1.5rem\",\n height: \"1.5rem\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n iconSm: {\n width: \"1.75rem\",\n height: \"1.75rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n icon: {\n width: \"2rem\",\n height: \"2rem\",\n \"& svg\": { width: \"1.125rem\", height: \"1.125rem\" },\n },\n iconLg: {\n width: \"2.5rem\",\n height: \"2.5rem\",\n \"& svg\": { width: \"1.5rem\", height: \"1.5rem\" },\n },\n normal: { borderRadius: tokens.radiusLg },\n rounded: { borderRadius: \"9999px\" },\n})\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\"\nexport type ButtonSize =\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"icon-xs\"\n | \"icon-sm\"\n | \"icon\"\n | \"icon-lg\"\nexport type ButtonShape = \"normal\" | \"rounded\"\n\nexport type ButtonProps = Omit<\n React.ComponentProps<\"button\">,\n \"variant\" | \"size\" | \"shape\" | \"destructive\" | \"className\" | \"render\"\n> & {\n variant?: ButtonVariant\n size?: ButtonSize\n shape?: ButtonShape\n destructive?: boolean\n className?: string\n /**\n * Render the child element instead of a `button`, keeping Button's styling and slot markers.\n * v1 supports this and consumers rely on it to wrap links; it was dropped here while the package\n * was briefly on Base UI, and restored once it moved back to Radix.\n */\n asChild?: boolean\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"primary\",\n size = \"base\",\n shape = \"rounded\",\n destructive = false,\n className,\n asChild = false,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const variantSlot:\n | ButtonVariant\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\" =\n destructive && variant !== \"ghost\"\n ? (`${variant}Destructive` as\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\")\n : variant\n const sizeSlot:\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"iconXs\"\n | \"iconSm\"\n | \"icon\"\n | \"iconLg\" = (\n {\n xs: \"xs\",\n sm: \"sm\",\n base: \"base\",\n lg: \"lg\",\n \"icon-xs\": \"iconXs\",\n \"icon-sm\": \"iconSm\",\n icon: \"icon\",\n \"icon-lg\": \"iconLg\",\n } as const\n )[size]\n\n const Root = asChild ? Slot : ButtonBase\n\n return (\n <Root\n ref={ref}\n data-slot=\"button\"\n {...{ [SLOT_ATTR]: \"button\" }}\n className={mergeClasses(\n styles.root,\n styles[variantSlot],\n styles[sizeSlot],\n styles[shape],\n className\n )}\n {...props}\n />\n )\n }\n)\n"],"names":["ButtonBase","useStyles","makeVoltStyles","tokens.fontWeightSemibold","tokens.semAccentSolid","tokens.semAccentContrast","tokens.semAccentSolidHover","tokens.accentA8","tokens.semAccentSoft","tokens.accentA11","tokens.semAccentSoftHover","tokens.grayA12","tokens.grayA8","tokens.semErrorSolid","tokens.semErrorContrast","tokens.semErrorSolidHover","tokens.errorA8","tokens.semErrorSoft","tokens.errorA11","tokens.semErrorSoftHover","shorthands","tokens.textXs","tokens.leadingXs","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","tokens.textBase","tokens.leadingBase","tokens.textLg","tokens.leadingLg","tokens.radiusLg","Button","React","variant","size","shape","destructive","className","asChild","props","ref","styles","variantSlot","sizeSlot","jsx","Slot","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;;;AAqBA,MAAMA,IAAa,UAEbC,IAAYC,EAAe;AAAA,EAC/B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAYC;AAAAA,IACZ,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa,EAAE,SAAS,IAAA;AAAA,IACxB,kBAAkB;AAAA,MAChB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,eAAe;AAAA,IAAA;AAAA,IAEjB,SAAS;AAAA,MACP,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACT;AAAA,EAEF,SAAS;AAAA,IACP,iBAAiBC;AAAAA,IACjB,OAAOC;AAAAA,IACP,UAAU,EAAE,iBAAiBC,EAAO;AAAA,IACpC,WAAW,EAAE,iBAAiBA,EAAO;AAAA,IACrC,kBAAkB,EAAE,cAAcC,EAAO;AAAA,EAAS;AAAA,EAEpD,WAAW;AAAA,IACT,iBAAiBC;AAAAA,IACjB,OAAOC;AAAAA,IACP,UAAU,EAAE,iBAAiBC,EAAO;AAAA,IACpC,kBAAkB,EAAE,cAAcH,EAAO;AAAA,EAAS;AAAA,EAEpD,UAAU;AAAA,IACR,iBAAiB;AAAA,IACjB,OAAOE;AAAAA,IACP,UAAU,EAAE,iBAAiBD,EAAO;AAAA,IACpC,kBAAkB,EA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;AAAA,MACE,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,MAAM;AAAA,MACN,WAAW;AAAA,IAAA,EAEbT,CAAI;AAIN,WACE,gBAAAU;AAAA,MAHWN,IAAUO,IAAO7C;AAAA,MAG3B;AAAA,QACC,KAAAwC;AAAA,QACA,aAAU;AAAA,QACJ,CAACM,CAAS,GAAG;AAAA,QACnB,WAAWC;AAAAA,UACTN,EAAO;AAAA,UACPA,EAAOC,CAAW;AAAA,UAClBD,EAAOE,CAAQ;AAAA,UACfF,EAAON,CAAK;AAAA,UACZE;AAAA,QAAA;AAAA,QAED,GAAGE;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\nimport { Slot } from \"@radix-ui/react-slot\"\n\n/**\n * Base UI's type declarations resolve `react` from the hoisted root's `@types/react` (v19), while\n * this package pins `@types/react` 18 in its own node_modules. Re-typing the primitive onto OUR\n * `React` keeps the button's pass-through props and ref on one React type for this package.\n */\n/**\n * A native `<button>`, no primitive.\n *\n * v1's only Radix use here is `Slot`, purely to implement `asChild`, and this does the same. Base\n * UI's button primitive supplied nothing v1 had: it added a dependency, and with it the\n * `@types/react` 19 requirement, for a plain element.\n */\nconst ButtonBase = \"button\" as const\n\nconst useStyles = makeVoltStyles({\n root: {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontWeight: tokens.fontWeightSemibold,\n whiteSpace: \"nowrap\",\n transitionProperty: \"all\",\n cursor: \"pointer\",\n flexShrink: 0,\n \":disabled\": { opacity: 0.5 },\n \":focus-visible\": {\n outlineWidth: \"2px\",\n outlineStyle: \"solid\",\n outlineOffset: \"2px\",\n outlineColor: tokens.semFocusRing,\n },\n \"@media (prefers-reduced-motion: reduce)\": {\n transitionDuration: \"0.01ms\",\n },\n \"& svg\": {\n flexShrink: 0,\n pointerEvents: \"none\",\n color: \"currentColor\",\n },\n },\n primary: {\n backgroundColor: tokens.semAccentSolid,\n color: tokens.semAccentContrast,\n \":hover\": { backgroundColor: tokens.semAccentSolidHover },\n \":active\": { backgroundColor: tokens.semAccentSolidHover },\n },\n secondary: {\n backgroundColor: tokens.semAccentSoft,\n color: tokens.semAccentOnSoft,\n \":hover\": { backgroundColor: tokens.semAccentSoftHover },\n },\n tertiary: {\n backgroundColor: \"transparent\",\n color: tokens.accentA11,\n \":hover\": { backgroundColor: tokens.semAccentSoft },\n },\n ghost: {\n backgroundColor: \"transparent\",\n color: tokens.grayA12,\n \":hover\": { backgroundColor: tokens.semAccentSoft },\n },\n primaryDestructive: {\n backgroundColor: tokens.semErrorSolid,\n color: tokens.semErrorContrast,\n \":hover\": { backgroundColor: tokens.semErrorSolidHover },\n \":active\": { backgroundColor: tokens.semErrorSolidHover },\n },\n secondaryDestructive: {\n backgroundColor: tokens.semErrorSoft,\n color: tokens.semErrorOnSoft,\n \":hover\": { backgroundColor: tokens.semErrorSoftHover },\n },\n tertiaryDestructive: {\n backgroundColor: \"transparent\",\n color: tokens.errorA11,\n \":hover\": { backgroundColor: tokens.semErrorSoft },\n },\n xs: {\n ...shorthands.paddingInline(\"0.5rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"1.25rem\",\n fontSize: tokens.textXs,\n lineHeight: tokens.leadingXs,\n gap: \"4px\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n sm: {\n ...shorthands.paddingInline(tokens.spacingElement3),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"1.5rem\",\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n gap: \"0.375rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n base: {\n // Density-bound (DENSITY-SPEC.md §2.4, WP9B1-ACCEPTANCE-WP9B2A): padding-inline is the\n // compact/comfortable lever; min-height is floored by the fixed line-height + padding-block\n // below and cannot shrink, so it is bound too (compact === normal, comfortable raised via an\n // explicit minHeight above the natural content box, same mechanism `lg` already uses).\n ...shorthands.paddingInline(tokens.buttonBasePaddingInline),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: tokens.buttonBaseMinHeight,\n fontSize: tokens.textBase,\n lineHeight: tokens.leadingBase,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n lg: {\n ...shorthands.paddingInline(\"1.25rem\"),\n ...shorthands.paddingBlock(\"0.25rem\"),\n minHeight: \"2.5rem\",\n fontSize: tokens.textLg,\n lineHeight: tokens.leadingLg,\n gap: \"0.5rem\",\n \"& svg\": { width: \"1rem\", height: \"1rem\" },\n },\n iconXs: {\n width: \"1.5rem\",\n height: \"1.5rem\",\n \"& svg\": { width: \"0.75rem\", height: \"0.75rem\" },\n },\n iconSm: {\n width: \"1.75rem\",\n height: \"1.75rem\",\n \"& svg\": { width: \"0.875rem\", height: \"0.875rem\" },\n },\n icon: {\n // Density-bound: a fixed square, no line-height floor (unlike `base`), so compact/comfortable\n // both move freely (DENSITY-SPEC.md §2.4).\n width: tokens.buttonIconSize,\n height: tokens.buttonIconSize,\n \"& svg\": { width: \"1.125rem\", height: \"1.125rem\" },\n },\n iconLg: {\n width: \"2.5rem\",\n height: \"2.5rem\",\n \"& svg\": { width: \"1.5rem\", height: \"1.5rem\" },\n },\n normal: { borderRadius: tokens.radiusLg },\n rounded: { borderRadius: \"9999px\" },\n})\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\" | \"ghost\"\nexport type ButtonSize =\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"icon-xs\"\n | \"icon-sm\"\n | \"icon\"\n | \"icon-lg\"\nexport type ButtonShape = \"normal\" | \"rounded\"\n\nexport type ButtonProps = Omit<\n React.ComponentProps<\"button\">,\n \"variant\" | \"size\" | \"shape\" | \"destructive\" | \"className\" | \"render\"\n> & {\n variant?: ButtonVariant\n size?: ButtonSize\n shape?: ButtonShape\n destructive?: boolean\n className?: string\n /**\n * Render the child element instead of a `button`, keeping Button's styling and slot markers.\n * v1 supports this and consumers rely on it to wrap links; it was dropped here while the package\n * was briefly on Base UI, and restored once it moved back to Radix.\n */\n asChild?: boolean\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n function Button(\n {\n variant = \"primary\",\n size = \"base\",\n shape = \"rounded\",\n destructive = false,\n className,\n asChild = false,\n ...props\n },\n ref\n ) {\n const styles = useStyles()\n const variantSlot:\n | ButtonVariant\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\" =\n destructive && variant !== \"ghost\"\n ? (`${variant}Destructive` as\n | \"primaryDestructive\"\n | \"secondaryDestructive\"\n | \"tertiaryDestructive\")\n : variant\n const sizeSlot:\n | \"xs\"\n | \"sm\"\n | \"base\"\n | \"lg\"\n | \"iconXs\"\n | \"iconSm\"\n | \"icon\"\n | \"iconLg\" = (\n {\n xs: \"xs\",\n sm: \"sm\",\n base: \"base\",\n lg: \"lg\",\n \"icon-xs\": \"iconXs\",\n \"icon-sm\": \"iconSm\",\n icon: \"icon\",\n \"icon-lg\": \"iconLg\",\n } as const\n )[size]\n\n const Root = asChild ? Slot : ButtonBase\n\n return (\n <Root\n ref={ref}\n data-slot=\"button\"\n {...{ [SLOT_ATTR]: \"button\" }}\n className={mergeClasses(\n styles.root,\n styles[variantSlot],\n styles[sizeSlot],\n styles[shape],\n className\n )}\n {...props}\n />\n )\n }\n)\n"],"names":["ButtonBase","useStyles","makeVoltStyles","tokens.fontWeightSemibold","tokens.semFocusRing","tokens.semAccentSolid","tokens.semAccentContrast","tokens.semAccentSolidHover","tokens.semAccentSoft","tokens.semAccentOnSoft","tokens.semAccentSoftHover","tokens.accentA11","tokens.grayA12","tokens.semErrorSolid","tokens.semErrorContrast","tokens.semErrorSolidHover","tokens.semErrorSoft","tokens.semErrorOnSoft","tokens.semErrorSoftHover","tokens.errorA11","shorthands","tokens.textXs","tokens.leadingXs","tokens.spacingElement3","tokens.textSm","tokens.leadingSm","tokens.buttonBasePaddingInline","tokens.buttonBaseMinHeight","tokens.textBase","tokens.leadingBase","tokens.textLg","tokens.leadingLg","tokens.buttonIconSize","tokens.radiusLg","Button","React","variant","size","shape","destructive","className","asChild","props","ref","styles","variantSlot","sizeSlot","Root","Slot","jsxDEV","SLOT_ATTR","mergeClasses"],"mappings":";;;;;;;;AAqBA,MAAMA,IAAa,UAEbC,IAAYC,EAAe;AAAA,EAC/B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,YAAYC;AAAAA,IACZ,YAAY;AAAA,IACZ,oBAAoB;AAAA,IACpB,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,aAAa,EAAE,SAAS,IAAA;AAAA,IACxB,kBAAkB;AAAA,MAChB,cAAc;AAAA,MACd,cAAc;AAAA,MACd,eAAe;AAAA,MACf,cAAcC;AAAAA,IAAO;AAAA,IAEvB,2CAA2C;AAAA,MACzC,oBAAoB;AAAA,IAAA;AAAA,IAEtB,SAAS;AAAA,MACP,YAAY;AAAA,MACZ,eAAe;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACT;AAAA,EAEF,SAAS;AAAA,IACP,iBAAiBC;AAAAA,IACjB,OAAOC;AAAAA,IACP,UAAU,EAAE,iBAAiBC,EAAO;AAAA,IACpC,WAAW,EAAE,iBAAiBA,EAAO;AAAA,EAAoB;AAAA,EAE3D,WAAW;AAAA,IACT,iBAAiBC;AAAAA,IACjB,OAAOC;AAAAA,IACP,UAAU,EAAE,iBAAiBC,EAAO;AAAA,EAAmB;AAAA,EAEzD,UAAU;AAA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;AAAA,MACN,IAAI;AAAA,MACJ,WAAW;AAAA,MACX,WAAW;AAAA,MACX,MAAM;AAAA,MACN,WAAW;AAAA,IAAA,EAEbT,CAAI,GAEAU,IAAON,IAAUO,IAAOhD;AAE9B,WACEiD,gBAAAA,EAAAA;AAAAA,MAACF;AAAA,MAAA;AAAA,QACC,KAAAJ;AAAA,QACA,aAAU;AAAA,QACJ,CAACO,CAAS,GAAG;AAAA,QACnB,WAAWC;AAAAA,UACTP,EAAO;AAAA,UACPA,EAAOC,CAAW;AAAA,UAClBD,EAAOE,CAAQ;AAAA,UACfF,EAAON,CAAK;AAAA,UACZE;AAAA,QAAA;AAAA,QAED,GAAGE;AAAA,MAAA;AAAA,MAXN;AAAA,MAAA;AAAA,MAAA;AAAA,QAAA,UAAA;AAAA,QAAA,YAAA;AAAA,QAAA,cAAA;AAAA,MAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAcJ;AACF;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
1
|
+
import { j as n } from "../../vendor/react/jsx-dev-runtime.js";
|
|
2
|
+
import * as l from "react";
|
|
3
3
|
import { shorthands as o } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/index.js";
|
|
4
4
|
import { SLOT_ATTR as s } from "../../packages/volt-runtime/dist/renderer/contract.js";
|
|
5
|
-
import { mergeClasses as
|
|
5
|
+
import { mergeClasses as u } from "../../packages/volt-runtime/dist/vendor/@griffel/core/src/mergeClasses.js";
|
|
6
6
|
import { makeVoltStyles as c } from "../../styles/make-styles.js";
|
|
7
|
-
import { spacingElement3 as g, spacingGroup2 as f, grayA5 as
|
|
8
|
-
import { Separator as
|
|
9
|
-
const
|
|
7
|
+
import { spacingElement3 as g, spacingGroup2 as f, grayA5 as b, radiusMd as h, spacingElement2 as d, fontWeightMedium as x, leadingSm as R, textSm as v, grayA4 as N } from "../../tokens/index.js";
|
|
8
|
+
import { Separator as S } from "../separator/separator.js";
|
|
9
|
+
const p = c({
|
|
10
10
|
root: {
|
|
11
11
|
display: "flex",
|
|
12
12
|
width: "fit-content",
|
|
@@ -16,7 +16,7 @@ const u = c({
|
|
|
16
16
|
position: "relative"
|
|
17
17
|
},
|
|
18
18
|
[`&:has(> [${s}="button-group"])`]: {
|
|
19
|
-
...o.gap(
|
|
19
|
+
...o.gap(d)
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
22
|
horizontal: {
|
|
@@ -43,14 +43,14 @@ const u = c({
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
text: {
|
|
46
|
-
backgroundColor:
|
|
46
|
+
backgroundColor: N,
|
|
47
47
|
display: "flex",
|
|
48
48
|
alignItems: "center",
|
|
49
|
-
...o.gap(
|
|
50
|
-
...o.borderRadius(
|
|
51
|
-
...o.border("1px", "solid",
|
|
49
|
+
...o.gap(d),
|
|
50
|
+
...o.borderRadius(h),
|
|
51
|
+
...o.border("1px", "solid", b),
|
|
52
52
|
...o.padding(g, f),
|
|
53
|
-
fontSize:
|
|
53
|
+
fontSize: v,
|
|
54
54
|
lineHeight: R,
|
|
55
55
|
fontWeight: x,
|
|
56
56
|
// Tailwind `shadow-xs` — literal per CONVENTIONS B7
|
|
@@ -70,10 +70,10 @@ const u = c({
|
|
|
70
70
|
separatorVertical: {
|
|
71
71
|
height: "1px"
|
|
72
72
|
}
|
|
73
|
-
}),
|
|
73
|
+
}), L = l.forwardRef(
|
|
74
74
|
function({ className: r, orientation: t = "horizontal", ...e }, a) {
|
|
75
|
-
const i =
|
|
76
|
-
return /* @__PURE__ */ n(
|
|
75
|
+
const i = p();
|
|
76
|
+
return /* @__PURE__ */ n.jsxDEV(
|
|
77
77
|
"div",
|
|
78
78
|
{
|
|
79
79
|
ref: a,
|
|
@@ -81,44 +81,68 @@ const u = c({
|
|
|
81
81
|
"data-slot": "button-group",
|
|
82
82
|
[s]: "button-group",
|
|
83
83
|
"data-orientation": t,
|
|
84
|
-
className:
|
|
84
|
+
className: u(i.root, i[t], r),
|
|
85
85
|
...e
|
|
86
|
-
}
|
|
86
|
+
},
|
|
87
|
+
void 0,
|
|
88
|
+
!1,
|
|
89
|
+
{
|
|
90
|
+
fileName: "/Users/wilianmolinari/repos/volt-ui-rollout/release/packages/experimental-griffel/src/components/button-group/button-group.tsx",
|
|
91
|
+
lineNumber: 110,
|
|
92
|
+
columnNumber: 7
|
|
93
|
+
},
|
|
94
|
+
this
|
|
87
95
|
);
|
|
88
96
|
}
|
|
89
|
-
),
|
|
90
|
-
const a =
|
|
91
|
-
return /* @__PURE__ */ n(
|
|
97
|
+
), V = l.forwardRef(function({ className: r, ...t }, e) {
|
|
98
|
+
const a = p();
|
|
99
|
+
return /* @__PURE__ */ n.jsxDEV(
|
|
92
100
|
"div",
|
|
93
101
|
{
|
|
94
102
|
ref: e,
|
|
95
103
|
"data-slot": "button-group-text",
|
|
96
104
|
[s]: "button-group-text",
|
|
97
|
-
className:
|
|
105
|
+
className: u(a.text, r),
|
|
98
106
|
...t
|
|
99
|
-
}
|
|
107
|
+
},
|
|
108
|
+
void 0,
|
|
109
|
+
!1,
|
|
110
|
+
{
|
|
111
|
+
fileName: "/Users/wilianmolinari/repos/volt-ui-rollout/release/packages/experimental-griffel/src/components/button-group/button-group.tsx",
|
|
112
|
+
lineNumber: 132,
|
|
113
|
+
columnNumber: 5
|
|
114
|
+
},
|
|
115
|
+
this
|
|
100
116
|
);
|
|
101
|
-
}),
|
|
102
|
-
const i =
|
|
103
|
-
return /* @__PURE__ */ n(
|
|
104
|
-
|
|
117
|
+
}), j = l.forwardRef(function({ className: r, orientation: t = "vertical", ...e }, a) {
|
|
118
|
+
const i = p();
|
|
119
|
+
return /* @__PURE__ */ n.jsxDEV(
|
|
120
|
+
S,
|
|
105
121
|
{
|
|
106
122
|
ref: a,
|
|
107
123
|
"data-slot": "button-group-separator",
|
|
108
124
|
[s]: "button-group-separator",
|
|
109
125
|
orientation: t,
|
|
110
|
-
className:
|
|
126
|
+
className: u(
|
|
111
127
|
i.separator,
|
|
112
128
|
t === "vertical" && i.separatorVertical,
|
|
113
129
|
r
|
|
114
130
|
),
|
|
115
131
|
...e
|
|
116
|
-
}
|
|
132
|
+
},
|
|
133
|
+
void 0,
|
|
134
|
+
!1,
|
|
135
|
+
{
|
|
136
|
+
fileName: "/Users/wilianmolinari/repos/volt-ui-rollout/release/packages/experimental-griffel/src/components/button-group/button-group.tsx",
|
|
137
|
+
lineNumber: 154,
|
|
138
|
+
columnNumber: 5
|
|
139
|
+
},
|
|
140
|
+
this
|
|
117
141
|
);
|
|
118
142
|
});
|
|
119
143
|
export {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
144
|
+
L as ButtonGroup,
|
|
145
|
+
j as ButtonGroupSeparator,
|
|
146
|
+
V as ButtonGroupText
|
|
123
147
|
};
|
|
124
148
|
//# sourceMappingURL=button-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.js","sources":["../../../src/components/button-group/button-group.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\nimport { Separator, type SeparatorProps } from \"../separator/separator\"\n\n/**\n * ButtonGroup — compound component family for grouping buttons, text, and separators.\n *\n * One `makeVoltStyles` call for the whole family, one slot per sub-component (following `card.tsx`).\n *\n * No Base UI primitive is needed: v1 only used Radix `Slot` for `asChild` on `ButtonGroupText`,\n * which CONVENTIONS rule 6 drops.\n *\n * `ButtonGroup` handles both `horizontal` and `vertical` orientations, removing adjoining border\n * radius and borders on adjacent children. Sibling focus-visible elements are elevated (`z-index: 10`)\n * and made relative so focus rings are never obscured by subsequent siblings.\n *\n * Nested button groups gain a gap via a `:has()` selector keyed on `SLOT_ATTR` (never on `data-slot`,\n * per CONVENTIONS rule 4).\n *\n * `ButtonGroupText` provides a matching text container (`gray-a4`, subtle border, `shadow-xs`).\n *\n * `ButtonGroupSeparator` composes `Separator` with transparent background and stretch alignment.\n */\n\nexport type ButtonGroupOrientation = \"horizontal\" | \"vertical\"\n\nconst useStyles = makeVoltStyles({\n root: {\n display: \"flex\",\n width: \"fit-content\",\n alignItems: \"stretch\",\n \"& > *:focus-visible\": {\n zIndex: 10,\n position: \"relative\",\n },\n [`&:has(> [${SLOT_ATTR}=\"button-group\"])`]: {\n ...shorthands.gap(tokens.spacingElement2),\n },\n },\n horizontal: {\n \"& > *:not(:first-child)\": {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderLeftWidth: 0,\n },\n \"& > *:not(:last-child)\": {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n vertical: {\n flexDirection: \"column\",\n \"& > *:not(:first-child)\": {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTopWidth: 0,\n },\n \"& > *:not(:last-child)\": {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n text: {\n backgroundColor: tokens.grayA4,\n display: \"flex\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n ...shorthands.borderRadius(tokens.radiusMd),\n ...shorthands.border(\"1px\", \"solid\", tokens.grayA5),\n ...shorthands.padding(tokens.spacingElement3, tokens.spacingGroup2),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightMedium,\n // Tailwind `shadow-xs` — literal per CONVENTIONS B7\n boxShadow: \"0 1px 2px 0 #0000000d\",\n \"& svg\": {\n pointerEvents: \"none\",\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n separator: {\n ...shorthands.margin(0),\n position: \"relative\",\n alignSelf: \"stretch\",\n backgroundColor: \"transparent\",\n },\n separatorVertical: {\n height: \"1px\",\n },\n})\n\nexport type ButtonGroupProps = React.ComponentProps<\"div\"> & {\n orientation?: ButtonGroupOrientation\n}\n\nexport const ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(\n function ButtonGroup(\n { className, orientation = \"horizontal\", ...props },\n ref\n ) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n role=\"group\"\n data-slot=\"button-group\"\n {...{ [SLOT_ATTR]: \"button-group\" }}\n data-orientation={orientation}\n className={mergeClasses(styles.root, styles[orientation], className)}\n {...props}\n />\n )\n }\n)\n\nexport type ButtonGroupTextProps = React.ComponentProps<\"div\">\n\nexport const ButtonGroupText = React.forwardRef<\n HTMLDivElement,\n ButtonGroupTextProps\n>(function ButtonGroupText({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"button-group-text\"\n {...{ [SLOT_ATTR]: \"button-group-text\" }}\n className={mergeClasses(styles.text, className)}\n {...props}\n />\n )\n})\n\nexport type ButtonGroupSeparatorProps = SeparatorProps\n\nexport const ButtonGroupSeparator = React.forwardRef<\n HTMLDivElement,\n ButtonGroupSeparatorProps\n>(function ButtonGroupSeparator(\n { className, orientation = \"vertical\", ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <Separator\n ref={ref}\n data-slot=\"button-group-separator\"\n {...{ [SLOT_ATTR]: \"button-group-separator\" }}\n orientation={orientation}\n className={mergeClasses(\n styles.separator,\n orientation === \"vertical\" && styles.separatorVertical,\n className\n )}\n {...props}\n />\n )\n})\n"],"names":["useStyles","makeVoltStyles","SLOT_ATTR","shorthands","tokens.spacingElement2","tokens.grayA4","tokens.radiusMd","tokens.grayA5","tokens.spacingElement3","tokens.spacingGroup2","tokens.textSm","tokens.leadingSm","tokens.fontWeightMedium","ButtonGroup","React","className","orientation","props","ref","styles","
|
|
1
|
+
{"version":3,"file":"button-group.js","sources":["../../../src/components/button-group/button-group.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { mergeClasses, shorthands } from \"@epilot/volt-ui-runtime\"\n\nimport { SLOT_ATTR } from \"../../renderer/contract\"\nimport { makeVoltStyles } from \"../../styles/make-styles\"\nimport * as tokens from \"../../tokens\"\nimport { Separator, type SeparatorProps } from \"../separator/separator\"\n\n/**\n * ButtonGroup — compound component family for grouping buttons, text, and separators.\n *\n * One `makeVoltStyles` call for the whole family, one slot per sub-component (following `card.tsx`).\n *\n * No Base UI primitive is needed: v1 only used Radix `Slot` for `asChild` on `ButtonGroupText`,\n * which CONVENTIONS rule 6 drops.\n *\n * `ButtonGroup` handles both `horizontal` and `vertical` orientations, removing adjoining border\n * radius and borders on adjacent children. Sibling focus-visible elements are elevated (`z-index: 10`)\n * and made relative so focus rings are never obscured by subsequent siblings.\n *\n * Nested button groups gain a gap via a `:has()` selector keyed on `SLOT_ATTR` (never on `data-slot`,\n * per CONVENTIONS rule 4).\n *\n * `ButtonGroupText` provides a matching text container (`gray-a4`, subtle border, `shadow-xs`).\n *\n * `ButtonGroupSeparator` composes `Separator` with transparent background and stretch alignment.\n */\n\nexport type ButtonGroupOrientation = \"horizontal\" | \"vertical\"\n\nconst useStyles = makeVoltStyles({\n root: {\n display: \"flex\",\n width: \"fit-content\",\n alignItems: \"stretch\",\n \"& > *:focus-visible\": {\n zIndex: 10,\n position: \"relative\",\n },\n [`&:has(> [${SLOT_ATTR}=\"button-group\"])`]: {\n ...shorthands.gap(tokens.spacingElement2),\n },\n },\n horizontal: {\n \"& > *:not(:first-child)\": {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n borderLeftWidth: 0,\n },\n \"& > *:not(:last-child)\": {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n vertical: {\n flexDirection: \"column\",\n \"& > *:not(:first-child)\": {\n borderTopLeftRadius: 0,\n borderTopRightRadius: 0,\n borderTopWidth: 0,\n },\n \"& > *:not(:last-child)\": {\n borderBottomLeftRadius: 0,\n borderBottomRightRadius: 0,\n },\n },\n text: {\n backgroundColor: tokens.grayA4,\n display: \"flex\",\n alignItems: \"center\",\n ...shorthands.gap(tokens.spacingElement2),\n ...shorthands.borderRadius(tokens.radiusMd),\n ...shorthands.border(\"1px\", \"solid\", tokens.grayA5),\n ...shorthands.padding(tokens.spacingElement3, tokens.spacingGroup2),\n fontSize: tokens.textSm,\n lineHeight: tokens.leadingSm,\n fontWeight: tokens.fontWeightMedium,\n // Tailwind `shadow-xs` — literal per CONVENTIONS B7\n boxShadow: \"0 1px 2px 0 #0000000d\",\n \"& svg\": {\n pointerEvents: \"none\",\n width: \"1rem\",\n height: \"1rem\",\n },\n },\n separator: {\n ...shorthands.margin(0),\n position: \"relative\",\n alignSelf: \"stretch\",\n backgroundColor: \"transparent\",\n },\n separatorVertical: {\n height: \"1px\",\n },\n})\n\nexport type ButtonGroupProps = React.ComponentProps<\"div\"> & {\n orientation?: ButtonGroupOrientation\n}\n\nexport const ButtonGroup = React.forwardRef<HTMLDivElement, ButtonGroupProps>(\n function ButtonGroup(\n { className, orientation = \"horizontal\", ...props },\n ref\n ) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n role=\"group\"\n data-slot=\"button-group\"\n {...{ [SLOT_ATTR]: \"button-group\" }}\n data-orientation={orientation}\n className={mergeClasses(styles.root, styles[orientation], className)}\n {...props}\n />\n )\n }\n)\n\nexport type ButtonGroupTextProps = React.ComponentProps<\"div\">\n\nexport const ButtonGroupText = React.forwardRef<\n HTMLDivElement,\n ButtonGroupTextProps\n>(function ButtonGroupText({ className, ...props }, ref) {\n const styles = useStyles()\n\n return (\n <div\n ref={ref}\n data-slot=\"button-group-text\"\n {...{ [SLOT_ATTR]: \"button-group-text\" }}\n className={mergeClasses(styles.text, className)}\n {...props}\n />\n )\n})\n\nexport type ButtonGroupSeparatorProps = SeparatorProps\n\nexport const ButtonGroupSeparator = React.forwardRef<\n HTMLDivElement,\n ButtonGroupSeparatorProps\n>(function ButtonGroupSeparator(\n { className, orientation = \"vertical\", ...props },\n ref\n) {\n const styles = useStyles()\n\n return (\n <Separator\n ref={ref}\n data-slot=\"button-group-separator\"\n {...{ [SLOT_ATTR]: \"button-group-separator\" }}\n orientation={orientation}\n className={mergeClasses(\n styles.separator,\n orientation === \"vertical\" && styles.separatorVertical,\n className\n )}\n {...props}\n />\n )\n})\n"],"names":["useStyles","makeVoltStyles","SLOT_ATTR","shorthands","tokens.spacingElement2","tokens.grayA4","tokens.radiusMd","tokens.grayA5","tokens.spacingElement3","tokens.spacingGroup2","tokens.textSm","tokens.leadingSm","tokens.fontWeightMedium","ButtonGroup","React","className","orientation","props","ref","styles","jsxDEV","mergeClasses","ButtonGroupText","ButtonGroupSeparator","Separator"],"mappings":";;;;;;;;AA+BA,MAAMA,IAAYC,EAAe;AAAA,EAC/B,MAAM;AAAA,IACJ,SAAS;AAAA,IACT,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,uBAAuB;AAAA,MACrB,QAAQ;AAAA,MACR,UAAU;AAAA,IAAA;AAAA,IAEZ,CAAC,YAAYC,CAAS,mBAAmB,GAAG;AAAA,MAC1C,GAAGC,EAAW,IAAIC,CAAsB;AAAA,IAAA;AAAA,EAC1C;AAAA,EAEF,YAAY;AAAA,IACV,2BAA2B;AAAA,MACzB,qBAAqB;AAAA,MACrB,wBAAwB;AAAA,MACxB,iBAAiB;AAAA,IAAA;AAAA,IAEnB,0BAA0B;AAAA,MACxB,sBAAsB;AAAA,MACtB,yBAAyB;AAAA,IAAA;AAAA,EAC3B;AAAA,EAEF,UAAU;AAAA,IACR,eAAe;AAAA,IACf,2BAA2B;AAAA,MACzB,qBAAqB;AAAA,MACrB,sBAAsB;AAAA,MACtB,gBAAgB;AAAA,IAAA;AAAA,IAElB,0BAA0B;AAAA,MACxB,wBAAwB;AAAA,MACxB,yBAAyB;AAAA,IAAA;AAAA,EAC3B;AAAA,EAEF,MAAM;AAAA,IACJ,iBAAiBC;AAAAA,IACjB,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,GAAGF,EAAW,IAAIC,CAAsB;AAAA,IACxC,GAAGD,EAAW,aAAaG,CAAe;AAAA,IAC1C,GAAGH,EAAW,OAAO,OAAO,SAASI,CAAa;AAAA,IAClD,GAAGJ,EAA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