@mirohq/design-system-toolbar 2.5.30 → 2.6.0-tag-api-changes.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/main.js +265 -91
- package/dist/main.js.map +1 -1
- package/dist/module.js +266 -92
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +49 -39
- package/package.json +5 -3
package/dist/main.js
CHANGED
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
|
+
var designSystemExperiments = require('@mirohq/design-system-experiments');
|
|
7
8
|
var designSystemStitches = require('@mirohq/design-system-stitches');
|
|
8
9
|
var RadixToolbar = require('@radix-ui/react-toolbar');
|
|
9
10
|
var interactions = require('@react-aria/interactions');
|
|
10
11
|
var utils = require('@react-aria/utils');
|
|
11
12
|
var designSystemUsePress = require('@mirohq/design-system-use-press');
|
|
12
13
|
var designSystemUtils = require('@mirohq/design-system-utils');
|
|
14
|
+
var designSystemUseAriaDisabled = require('@mirohq/design-system-use-aria-disabled');
|
|
13
15
|
var designSystemStyles = require('@mirohq/design-system-styles');
|
|
14
16
|
|
|
15
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -50,97 +52,69 @@ const StyledToolbar = designSystemStitches.styled(RadixToolbar.Root, {
|
|
|
50
52
|
height: "$12"
|
|
51
53
|
},
|
|
52
54
|
variants: {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
v1: {
|
|
56
|
+
true: {}
|
|
57
|
+
},
|
|
58
|
+
variant: {
|
|
59
|
+
floating: {},
|
|
60
|
+
flat: {}
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
compoundVariants: [
|
|
64
|
+
{
|
|
65
|
+
variant: "floating",
|
|
66
|
+
v1: false,
|
|
67
|
+
css: {
|
|
55
68
|
backgroundColor: "$background-neutrals-container",
|
|
56
69
|
boxShadow: "$50",
|
|
57
70
|
borderRadius: "$50",
|
|
58
71
|
padding: "2px"
|
|
59
72
|
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
variant: "floating",
|
|
76
|
+
v1: true,
|
|
77
|
+
css: {
|
|
78
|
+
backgroundColor: "$background-neutrals-layout",
|
|
79
|
+
boxShadow: "0px 1px 8px 0px rgba(34, 36, 40, 0.05)",
|
|
80
|
+
border: "0.5px solid $border-neutrals-subtle",
|
|
81
|
+
borderRadius: "$100",
|
|
82
|
+
padding: "$50"
|
|
83
|
+
}
|
|
60
84
|
}
|
|
61
|
-
|
|
85
|
+
]
|
|
62
86
|
});
|
|
63
87
|
|
|
64
|
-
const
|
|
88
|
+
const StyledBaseItem = designSystemStitches.styled(RadixToolbar__namespace.Button, {
|
|
65
89
|
boxSizing: "border-box",
|
|
66
90
|
cursor: "pointer",
|
|
67
91
|
userSelect: "none",
|
|
68
92
|
display: "flex",
|
|
69
93
|
alignItems: "center",
|
|
70
94
|
justifyContent: "center",
|
|
71
|
-
flexShrink: 0
|
|
72
|
-
};
|
|
73
|
-
const disabledSelector = '&[disabled], &[aria-disabled="true"]';
|
|
74
|
-
const StyledItem = designSystemStitches.styled(RadixToolbar__namespace.Button, {
|
|
75
|
-
variants: {
|
|
76
|
-
unstyled: {
|
|
77
|
-
true: {
|
|
78
|
-
...defaultStyles
|
|
79
|
-
},
|
|
80
|
-
false: {
|
|
81
|
-
...defaultStyles,
|
|
82
|
-
borderRadius: 4,
|
|
83
|
-
height: "$10",
|
|
84
|
-
...designSystemStyles.focus.css({
|
|
85
|
-
boxShadow: "$focus-small",
|
|
86
|
-
outline: "1px solid transparent"
|
|
87
|
-
}),
|
|
88
|
-
[disabledSelector]: {
|
|
89
|
-
pointerEvents: "none",
|
|
90
|
-
color: "$text-neutrals-disabled"
|
|
91
|
-
},
|
|
92
|
-
"&[data-hovered]": {
|
|
93
|
-
backgroundColor: "$background-primary-subtle-hover",
|
|
94
|
-
color: "$icon-primary-hover"
|
|
95
|
-
},
|
|
96
|
-
"&:active, &[data-pressed]": {
|
|
97
|
-
backgroundColor: "$background-primary-subtle-active",
|
|
98
|
-
color: "$icon-primary-active"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
wrapper: {
|
|
103
|
-
true: {
|
|
104
|
-
backgroundColor: "transparent",
|
|
105
|
-
border: "none",
|
|
106
|
-
cursor: "pointer"
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
active: {
|
|
110
|
-
true: {},
|
|
111
|
-
false: {}
|
|
112
|
-
}
|
|
113
|
-
},
|
|
95
|
+
flexShrink: 0,
|
|
114
96
|
'&[tabindex="0"]': {
|
|
115
97
|
zIndex: "1"
|
|
116
|
-
}
|
|
117
|
-
compoundVariants: [
|
|
118
|
-
{
|
|
119
|
-
unstyled: false,
|
|
120
|
-
active: true,
|
|
121
|
-
css: {
|
|
122
|
-
"&&": {
|
|
123
|
-
backgroundColor: "$background-primary-subtle-selected",
|
|
124
|
-
color: "$icon-primary-selected"
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
]
|
|
98
|
+
}
|
|
129
99
|
});
|
|
130
100
|
|
|
131
|
-
const
|
|
101
|
+
const BaseItem = React__default["default"].forwardRef(
|
|
132
102
|
({
|
|
133
103
|
disabled = false,
|
|
134
104
|
"aria-disabled": ariaDisabled,
|
|
135
105
|
asChild,
|
|
136
|
-
unstyled = true,
|
|
137
|
-
active = false,
|
|
138
106
|
onHoverStart,
|
|
139
107
|
onHoverEnd,
|
|
140
108
|
onHoverChange,
|
|
141
109
|
...restProps
|
|
142
110
|
}, forwardRef) => {
|
|
143
|
-
|
|
111
|
+
const elementProps = designSystemUseAriaDisabled.useAriaDisabled(
|
|
112
|
+
{
|
|
113
|
+
...restProps,
|
|
114
|
+
ariaDisabled
|
|
115
|
+
},
|
|
116
|
+
{ allowArrows: true }
|
|
117
|
+
);
|
|
144
118
|
const { pressProps } = designSystemUsePress.usePress({
|
|
145
119
|
preventFocusOnPress: "auto",
|
|
146
120
|
disabled: disabled || designSystemUtils.booleanify(ariaDisabled),
|
|
@@ -151,16 +125,12 @@ const Item = React__default["default"].forwardRef(
|
|
|
151
125
|
onHoverEnd,
|
|
152
126
|
onHoverChange
|
|
153
127
|
});
|
|
154
|
-
elementProps = utils.mergeProps(pressProps, hoverProps);
|
|
155
128
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
156
|
-
|
|
129
|
+
StyledBaseItem,
|
|
157
130
|
{
|
|
158
|
-
...
|
|
131
|
+
...utils.mergeProps(pressProps, hoverProps),
|
|
159
132
|
"data-hovered": isHovered ? "" : void 0,
|
|
160
133
|
asChild,
|
|
161
|
-
active,
|
|
162
|
-
unstyled: asChild === true ? unstyled : false,
|
|
163
|
-
wrapper: asChild !== true,
|
|
164
134
|
disabled,
|
|
165
135
|
"aria-disabled": designSystemUtils.booleanify(ariaDisabled) ? "true" : ariaDisabled,
|
|
166
136
|
ref: forwardRef
|
|
@@ -169,16 +139,127 @@ const Item = React__default["default"].forwardRef(
|
|
|
169
139
|
}
|
|
170
140
|
);
|
|
171
141
|
|
|
172
|
-
const
|
|
142
|
+
const disabledSelector = '&[disabled], &[aria-disabled="true"]';
|
|
143
|
+
const sharedStyles = {
|
|
144
|
+
base: {
|
|
145
|
+
backgroundColor: "$transparent",
|
|
146
|
+
borderRadius: "$50",
|
|
147
|
+
height: "$10",
|
|
148
|
+
border: "none"
|
|
149
|
+
},
|
|
150
|
+
old: {
|
|
151
|
+
...designSystemStyles.focus.css({
|
|
152
|
+
boxShadow: "$focus-small",
|
|
153
|
+
outline: "1px solid transparent"
|
|
154
|
+
}),
|
|
155
|
+
[disabledSelector]: {
|
|
156
|
+
cursor: "default",
|
|
157
|
+
color: "$text-neutrals-disabled"
|
|
158
|
+
},
|
|
159
|
+
"&[disabled]": {
|
|
160
|
+
pointerEvents: "none"
|
|
161
|
+
},
|
|
162
|
+
'&:not([aria-disabled="true"])': {
|
|
163
|
+
"&[data-hovered]": {
|
|
164
|
+
backgroundColor: "$background-primary-subtle-hover",
|
|
165
|
+
color: "$icon-primary-hover"
|
|
166
|
+
},
|
|
167
|
+
"&:active, &[data-pressed]": {
|
|
168
|
+
backgroundColor: "$background-primary-subtle-active",
|
|
169
|
+
color: "$icon-primary-active"
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
v1: {
|
|
174
|
+
...designSystemStyles.focus.css({
|
|
175
|
+
boxShadow: "$focus-v1"
|
|
176
|
+
}),
|
|
177
|
+
"&[disabled]": {
|
|
178
|
+
pointerEvents: "none"
|
|
179
|
+
},
|
|
180
|
+
'&:not([aria-disabled="true"])': {
|
|
181
|
+
"&[data-hovered]": {
|
|
182
|
+
backgroundColor: "$background-neutrals-hover"
|
|
183
|
+
},
|
|
184
|
+
"&:active, &[data-pressed]": {
|
|
185
|
+
backgroundColor: "$background-neutrals-active"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
const StyledIcon = designSystemStitches.styled(BaseItem, {
|
|
173
192
|
padding: 0,
|
|
174
|
-
border: "none",
|
|
175
193
|
font: "unset",
|
|
176
194
|
width: "$10",
|
|
177
|
-
color: "$icon-neutrals"
|
|
195
|
+
color: "$icon-neutrals",
|
|
196
|
+
...sharedStyles.base,
|
|
197
|
+
variants: {
|
|
198
|
+
v1: {
|
|
199
|
+
true: {},
|
|
200
|
+
false: {}
|
|
201
|
+
},
|
|
202
|
+
active: {
|
|
203
|
+
true: {},
|
|
204
|
+
false: {}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
compoundVariants: [
|
|
208
|
+
{
|
|
209
|
+
v1: true,
|
|
210
|
+
active: true,
|
|
211
|
+
css: {
|
|
212
|
+
backgroundColor: "$background-primary-subtle",
|
|
213
|
+
color: "$icon-primary-selected"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
v1: false,
|
|
218
|
+
active: true,
|
|
219
|
+
css: {
|
|
220
|
+
backgroundColor: "$background-primary-subtle-selected",
|
|
221
|
+
color: "$icon-primary-selected"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
v1: true,
|
|
226
|
+
active: false,
|
|
227
|
+
css: {
|
|
228
|
+
...sharedStyles.v1,
|
|
229
|
+
[disabledSelector]: {
|
|
230
|
+
pointerEvents: "none",
|
|
231
|
+
color: "$icon-neutrals-disabled"
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
v1: false,
|
|
237
|
+
active: false,
|
|
238
|
+
css: sharedStyles.old
|
|
239
|
+
}
|
|
240
|
+
]
|
|
178
241
|
});
|
|
179
242
|
|
|
243
|
+
const ToolbarContext = React.createContext({});
|
|
244
|
+
const ToolbarProvider = ({
|
|
245
|
+
children,
|
|
246
|
+
...restProps
|
|
247
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
248
|
+
ToolbarContext.Provider,
|
|
249
|
+
{
|
|
250
|
+
value: {
|
|
251
|
+
...restProps
|
|
252
|
+
},
|
|
253
|
+
children
|
|
254
|
+
}
|
|
255
|
+
);
|
|
256
|
+
const useToolbarContext = () => React.useContext(ToolbarContext);
|
|
257
|
+
|
|
180
258
|
const Icon = React__default["default"].forwardRef(
|
|
181
|
-
(
|
|
259
|
+
({ active = false, ...restProps }, forwardRef) => {
|
|
260
|
+
const { v1 } = useToolbarContext();
|
|
261
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledIcon, { ...restProps, v1, active, ref: forwardRef });
|
|
262
|
+
}
|
|
182
263
|
);
|
|
183
264
|
|
|
184
265
|
const StyledSeparator = designSystemStitches.styled(RadixToolbar.Separator, {
|
|
@@ -195,39 +276,132 @@ const StyledSeparator = designSystemStitches.styled(RadixToolbar.Separator, {
|
|
|
195
276
|
height: "1px",
|
|
196
277
|
width: "$6",
|
|
197
278
|
margin: "$50 0"
|
|
279
|
+
},
|
|
280
|
+
variants: {
|
|
281
|
+
v1: {
|
|
282
|
+
true: { backgroundColor: "$border-neutrals-subtle" }
|
|
283
|
+
}
|
|
198
284
|
}
|
|
199
285
|
});
|
|
200
286
|
|
|
201
|
-
const Separator = React__default["default"].forwardRef((props, forwardRef) =>
|
|
287
|
+
const Separator = React__default["default"].forwardRef((props, forwardRef) => {
|
|
288
|
+
const { v1 } = useToolbarContext();
|
|
289
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledSeparator, { ...props, v1, ref: forwardRef });
|
|
290
|
+
});
|
|
202
291
|
|
|
203
|
-
const StyledLink = designSystemStitches.styled(
|
|
292
|
+
const StyledLink = designSystemStitches.styled(BaseItem, {
|
|
204
293
|
paddingX: "$150",
|
|
205
|
-
textDecoration: "none"
|
|
294
|
+
textDecoration: "none",
|
|
295
|
+
...sharedStyles.base,
|
|
296
|
+
variants: {
|
|
297
|
+
v1: {
|
|
298
|
+
true: {
|
|
299
|
+
...sharedStyles.v1,
|
|
300
|
+
color: "$text-primary",
|
|
301
|
+
textDecoration: "underline solid",
|
|
302
|
+
textDecorationThickness: "1px",
|
|
303
|
+
textUnderlineOffset: "4px",
|
|
304
|
+
outline: "none",
|
|
305
|
+
[disabledSelector]: {
|
|
306
|
+
pointerEvents: "none",
|
|
307
|
+
color: "$text-neutrals-disabled"
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
false: sharedStyles.old
|
|
311
|
+
}
|
|
312
|
+
}
|
|
206
313
|
});
|
|
207
314
|
|
|
208
315
|
const Link = React__default["default"].forwardRef(
|
|
209
|
-
({ children, href, ...restProps }, forwardRef) =>
|
|
316
|
+
({ children, href, ...restProps }, forwardRef) => {
|
|
317
|
+
const { v1 } = useToolbarContext();
|
|
318
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledLink, { ...restProps, asChild: true, v1, children: /* @__PURE__ */ jsxRuntime.jsx("a", { href, ref: forwardRef, children }) });
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
const StyledItem = designSystemStitches.styled(BaseItem, {
|
|
323
|
+
...sharedStyles.base,
|
|
324
|
+
variants: {
|
|
325
|
+
v1: {
|
|
326
|
+
true: {},
|
|
327
|
+
false: {}
|
|
328
|
+
},
|
|
329
|
+
active: {
|
|
330
|
+
true: {},
|
|
331
|
+
false: {}
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
compoundVariants: [
|
|
335
|
+
{
|
|
336
|
+
v1: true,
|
|
337
|
+
active: true,
|
|
338
|
+
css: {
|
|
339
|
+
backgroundColor: "$background-primary-subtle",
|
|
340
|
+
color: "$text-primary-selected"
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
v1: false,
|
|
345
|
+
active: true,
|
|
346
|
+
css: {
|
|
347
|
+
backgroundColor: "$background-primary-subtle-selected",
|
|
348
|
+
color: "$text-primary-selected"
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
v1: true,
|
|
353
|
+
active: false,
|
|
354
|
+
css: {
|
|
355
|
+
...sharedStyles.v1,
|
|
356
|
+
[disabledSelector]: {
|
|
357
|
+
pointerEvents: "none",
|
|
358
|
+
color: "$text-neutrals-disabled"
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
v1: false,
|
|
364
|
+
active: false,
|
|
365
|
+
css: sharedStyles.old
|
|
366
|
+
}
|
|
367
|
+
]
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
const Item = React__default["default"].forwardRef(
|
|
371
|
+
({ active = false, unstyled = true, asChild, ...restProps }, forwardRef) => {
|
|
372
|
+
const { v1 } = useToolbarContext();
|
|
373
|
+
const shouldRenderUnstyled = asChild === true ? unstyled : false;
|
|
374
|
+
if (shouldRenderUnstyled) {
|
|
375
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BaseItem, { ...restProps, asChild, ref: forwardRef });
|
|
376
|
+
}
|
|
377
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledItem, { ...restProps, v1, active, ref: forwardRef });
|
|
378
|
+
}
|
|
210
379
|
);
|
|
211
380
|
|
|
212
381
|
const Toolbar = React__default["default"].forwardRef(
|
|
213
382
|
({
|
|
214
|
-
unstyled
|
|
383
|
+
unstyled,
|
|
215
384
|
orientation = "horizontal",
|
|
385
|
+
variant = "floating",
|
|
216
386
|
dir = "ltr",
|
|
217
387
|
loop = true,
|
|
218
|
-
direction,
|
|
219
388
|
...restProps
|
|
220
|
-
}, forwardRef) =>
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
389
|
+
}, forwardRef) => {
|
|
390
|
+
const [v1] = designSystemExperiments.useNewDesignLanguage();
|
|
391
|
+
const variantProp = unstyled === void 0 ? variant : unstyled ? "flat" : "floating";
|
|
392
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToolbarProvider, { v1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
393
|
+
StyledToolbar,
|
|
394
|
+
{
|
|
395
|
+
v1,
|
|
396
|
+
variant: variantProp,
|
|
397
|
+
orientation,
|
|
398
|
+
dir,
|
|
399
|
+
loop,
|
|
400
|
+
ref: forwardRef,
|
|
401
|
+
...restProps
|
|
402
|
+
}
|
|
403
|
+
) });
|
|
404
|
+
}
|
|
231
405
|
);
|
|
232
406
|
Toolbar.Icon = Icon;
|
|
233
407
|
Toolbar.Item = Item;
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/toolbar.styled.ts","../src/partials/item.styled.ts","../src/partials/item.tsx","../src/partials/icon.styled.tsx","../src/partials/icon.tsx","../src/partials/separator.styled.ts","../src/partials/separator.tsx","../src/partials/link.styled.tsx","../src/partials/link.tsx","../src/toolbar.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Root } from '@radix-ui/react-toolbar'\n\nexport const StyledToolbar = styled(Root, {\n all: 'unset',\n display: 'flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n maxWidth: '100%',\n gap: '$50',\n\n '&[data-orientation=\"vertical\"]': {\n flexDirection: 'column',\n width: '$12',\n },\n\n '&[data-orientation=\"horizontal\"]': {\n height: '$12',\n },\n\n variants: {\n unstyled: {\n false: {\n backgroundColor: '$background-neutrals-container',\n boxShadow: '$50',\n borderRadius: '$50',\n padding: '2px',\n },\n },\n },\n})\n\nexport type StyledToolbarProps = StrictComponentProps<typeof StyledToolbar>\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport * as RadixToolbar from '@radix-ui/react-toolbar'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst defaultStyles = {\n boxSizing: 'border-box',\n cursor: 'pointer',\n userSelect: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n}\n\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\nexport const StyledItem = styled(RadixToolbar.Button, {\n variants: {\n unstyled: {\n true: {\n ...defaultStyles,\n },\n false: {\n ...defaultStyles,\n borderRadius: 4,\n height: '$10',\n\n ...focus.css({\n boxShadow: '$focus-small',\n outline: '1px solid transparent',\n }),\n\n [disabledSelector]: {\n pointerEvents: 'none',\n color: '$text-neutrals-disabled',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$icon-primary-hover',\n },\n\n '&:active, &[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$icon-primary-active',\n },\n },\n },\n wrapper: {\n true: {\n backgroundColor: 'transparent',\n border: 'none',\n cursor: 'pointer',\n },\n },\n active: {\n true: {},\n false: {},\n },\n },\n\n '&[tabindex=\"0\"]': {\n zIndex: '1',\n },\n\n compoundVariants: [\n {\n unstyled: false,\n active: true,\n css: {\n '&&': {\n backgroundColor: '$background-primary-subtle-selected',\n color: '$icon-primary-selected',\n },\n },\n },\n ],\n})\n\nexport type StyledItemProps = StrictComponentProps<typeof StyledItem>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useHover } from '@react-aria/interactions'\nimport type { HoverEvents } from '@react-types/shared'\nimport { mergeProps } from '@react-aria/utils'\nimport { usePress } from '@mirohq/design-system-use-press'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport type { PressEvents } from '@mirohq/design-system-use-press'\n\nimport { StyledItem } from './item.styled'\nimport type { StyledItemProps } from './item.styled'\n\nexport interface ItemProps extends StyledItemProps, HoverEvents, PressEvents {\n /**\n * Renders item in enabled/toggled state.\n * @default false\n */\n active?: boolean\n\n /**\n * It's applied by default when using with asChild attribute.\n * You can still combine default Item styles with your own component by\n * setting this prop to false.\n * Note: Must be used together with asChild\n * @default true\n */\n unstyled?: boolean\n\n disabled?: boolean\n}\n\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n (\n {\n disabled = false,\n 'aria-disabled': ariaDisabled,\n asChild,\n unstyled = true,\n active = false,\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n ...restProps\n },\n forwardRef\n ) => {\n let elementProps = restProps\n\n const { pressProps } = usePress({\n preventFocusOnPress: 'auto',\n disabled: disabled || booleanify(ariaDisabled),\n ...elementProps,\n })\n\n const { hoverProps, isHovered } = useHover({\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n })\n\n elementProps = mergeProps(pressProps, hoverProps)\n\n return (\n <StyledItem\n {...elementProps}\n data-hovered={isHovered ? '' : undefined}\n asChild={asChild}\n active={active}\n unstyled={asChild === true ? unstyled : false}\n wrapper={asChild !== true}\n disabled={disabled}\n aria-disabled={booleanify(ariaDisabled) ? 'true' : ariaDisabled}\n ref={forwardRef}\n />\n )\n }\n)\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { Item } from './item'\n\nexport const StyledIcon = styled(Item, {\n padding: 0,\n border: 'none',\n font: 'unset',\n width: '$10',\n color: '$icon-neutrals',\n})\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport type { ItemProps } from './item'\nimport { StyledIcon } from './icon.styled'\n\nexport type IconProps = Omit<ItemProps, 'unstyled'>\n\nexport const Icon = React.forwardRef<ElementRef<typeof StyledIcon>, IconProps>(\n (props, forwardRef) => (\n <StyledIcon unstyled={false} {...props} ref={forwardRef} />\n )\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Separator } from '@radix-ui/react-toolbar'\n\nexport const StyledSeparator = styled(Separator, {\n all: 'unset',\n display: 'block',\n boxSizing: 'border-box',\n backgroundColor: 'rgba(205, 204, 215, 1)',\n\n '&[data-orientation=\"vertical\"]': {\n width: '1px',\n height: '$6',\n margin: '0 $50',\n },\n\n '&[data-orientation=\"horizontal\"]': {\n height: '1px',\n width: '$6',\n margin: '$50 0',\n },\n})\n\nexport type StyledSeparatorProps = StrictComponentProps<typeof StyledSeparator>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport type { StyledSeparatorProps } from './separator.styled'\nimport { StyledSeparator } from './separator.styled'\n\nexport interface SeparatorProps extends StyledSeparatorProps {}\n\nexport const Separator = React.forwardRef<\n ElementRef<typeof StyledSeparator>,\n SeparatorProps\n>((props, forwardRef) => <StyledSeparator {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { Item } from './item'\n\nexport const StyledLink = styled(Item, {\n paddingX: '$150',\n textDecoration: 'none',\n})\n","import React from 'react'\nimport type { ElementRef, AnchorHTMLAttributes } from 'react'\n\nimport type { ItemProps } from './item'\nimport { StyledLink } from './link.styled'\n\ntype ItemPropsWithAnchor = Omit<ItemProps, 'unstyled'> &\n AnchorHTMLAttributes<typeof StyledLink>\nexport interface LinkProps extends ItemPropsWithAnchor {}\n\nexport const Link = React.forwardRef<ElementRef<typeof StyledLink>, LinkProps>(\n ({ children, href, ...restProps }, forwardRef) => (\n <StyledLink asChild unstyled={false} {...restProps} ref={forwardRef}>\n <a href={href}>{children}</a>\n </StyledLink>\n )\n)\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport type { StyledToolbarProps } from './toolbar.styled'\nimport { StyledToolbar } from './toolbar.styled'\nimport { Icon } from './partials/icon'\nimport { Separator } from './partials/separator'\nimport { Link } from './partials/link'\nimport { Item } from './partials/item'\n\nexport interface ToolbarProps extends StyledToolbarProps {\n /**\n * Defines whether the toolbar has default styles (e.g. background, shadow, etc.)\n * @default false\n */\n unstyled?: boolean\n\n /**\n * The orientation of the toolbar\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical'\n\n /**\n * The reading direction of the toolbar\n * @default 'ltr'\n */\n dir?: 'ltr' | 'rtl'\n\n /**\n * The reading direction of the toolbar\n * @deprecated use dir instead\n */\n direction?: 'ltr' | 'rtl'\n\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa\n * @default true\n */\n loop?: boolean\n}\n\nexport const Toolbar = React.forwardRef<\n ElementRef<typeof StyledToolbar>,\n ToolbarProps\n>(\n (\n {\n unstyled = false,\n orientation = 'horizontal',\n dir = 'ltr',\n loop = true,\n direction,\n ...restProps\n },\n forwardRef\n ) => (\n <StyledToolbar\n unstyled={unstyled}\n orientation={orientation}\n dir={direction ?? dir}\n loop={loop}\n ref={forwardRef}\n {...restProps}\n />\n )\n) as ForwardRefExoticComponent<ToolbarProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Icon: typeof Icon\n Item: typeof Item\n Link: typeof Link\n Separator: typeof Separator\n}\n\nToolbar.Icon = Icon\nToolbar.Item = Item\nToolbar.Link = Link\nToolbar.Separator = Separator\n"],"names":["styled","Root","RadixToolbar","focus","React","usePress","booleanify","useH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AC3B,EAAA,CAAA;AAEJ,CAAA;;AC0BO,MAAM,UAAUL,yBAAM,CAAA,UAAA;AAAA,EAI3B,CACE;AAAA,IACE,QAAW,GAAA,KAAA;AAAA,IACX,WAAc,GAAA,YAAA;AAAA,IACd,GAAM,GAAA,KAAA;AAAA,IACN,IAAO,GAAA,IAAA;AAAA,IACP,SAAA;AAAA,IACA,GAAG,SAAA;AAAA,KAEL,UAEA,qBAAAK,cAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,QAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAK,SAAa,IAAA,IAAA,GAAA,SAAA,GAAA,GAAA;AAAA,MAClB,IAAA;AAAA,MACA,GAAK,EAAA,UAAA;AAAA,MACJ,GAAG,SAAA;AAAA,KAAA;AAAA,GACN;AAEJ,EAAA;AAYA,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,SAAY,GAAA,SAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/toolbar.styled.ts","../src/partials/base-item.styled.ts","../src/partials/base-item.tsx","../src/styles.ts","../src/partials/icon.styled.tsx","../src/hooks/use-toolbar-context.tsx","../src/partials/icon.tsx","../src/partials/separator.styled.ts","../src/partials/separator.tsx","../src/partials/link.styled.tsx","../src/partials/link.tsx","../src/partials/item.styled.tsx","../src/partials/item.tsx","../src/toolbar.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Root } from '@radix-ui/react-toolbar'\n\nexport const StyledToolbar = styled(Root, {\n all: 'unset',\n display: 'flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n maxWidth: '100%',\n gap: '$50',\n\n '&[data-orientation=\"vertical\"]': {\n flexDirection: 'column',\n width: '$12',\n },\n\n '&[data-orientation=\"horizontal\"]': {\n height: '$12',\n },\n\n variants: {\n v1: {\n true: {},\n },\n variant: {\n floating: {},\n flat: {},\n },\n },\n compoundVariants: [\n {\n variant: 'floating',\n v1: false,\n css: {\n backgroundColor: '$background-neutrals-container',\n boxShadow: '$50',\n borderRadius: '$50',\n padding: '2px',\n },\n },\n {\n variant: 'floating',\n v1: true,\n css: {\n backgroundColor: '$background-neutrals-layout',\n boxShadow: '0px 1px 8px 0px rgba(34, 36, 40, 0.05)',\n border: '0.5px solid $border-neutrals-subtle',\n borderRadius: '$100',\n padding: '$50',\n },\n },\n ],\n})\n\nexport type StyledToolbarProps = StrictComponentProps<typeof StyledToolbar>\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport * as RadixToolbar from '@radix-ui/react-toolbar'\n\nexport const StyledBaseItem = styled(RadixToolbar.Button, {\n boxSizing: 'border-box',\n cursor: 'pointer',\n userSelect: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n\n '&[tabindex=\"0\"]': {\n zIndex: '1',\n },\n})\n\nexport type StyledBaseItemProps = StrictComponentProps<typeof StyledBaseItem>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useHover } from '@react-aria/interactions'\nimport type { HoverEvents } from '@react-types/shared'\nimport { mergeProps } from '@react-aria/utils'\nimport { usePress } from '@mirohq/design-system-use-press'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport type { PressEvents } from '@mirohq/design-system-use-press'\nimport { useAriaDisabled } from '@mirohq/design-system-use-aria-disabled'\n\nimport { StyledBaseItem } from './base-item.styled'\nimport type { StyledBaseItemProps } from './base-item.styled'\n\nexport interface BaseItemProps\n extends StyledBaseItemProps,\n HoverEvents,\n PressEvents {\n disabled?: boolean\n}\n\nexport const BaseItem = React.forwardRef<\n ElementRef<typeof StyledBaseItem>,\n BaseItemProps\n>(\n (\n {\n disabled = false,\n 'aria-disabled': ariaDisabled,\n asChild,\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n ...restProps\n },\n forwardRef\n ) => {\n const elementProps = useAriaDisabled(\n {\n ...restProps,\n ariaDisabled,\n },\n { allowArrows: true }\n )\n\n const { pressProps } = usePress({\n preventFocusOnPress: 'auto',\n disabled: disabled || booleanify(ariaDisabled),\n ...elementProps,\n })\n\n const { hoverProps, isHovered } = useHover({\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n })\n\n return (\n <StyledBaseItem\n {...mergeProps(pressProps, hoverProps)}\n data-hovered={isHovered ? '' : undefined}\n asChild={asChild}\n disabled={disabled}\n aria-disabled={booleanify(ariaDisabled) ? 'true' : ariaDisabled}\n ref={forwardRef}\n />\n )\n }\n)\n","import { focus } from '@mirohq/design-system-styles'\n\nexport const disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\nexport const sharedStyles = {\n base: {\n backgroundColor: '$transparent',\n borderRadius: '$50',\n height: '$10',\n border: 'none',\n },\n old: {\n ...focus.css({\n boxShadow: '$focus-small',\n outline: '1px solid transparent',\n }),\n\n [disabledSelector]: {\n cursor: 'default',\n color: '$text-neutrals-disabled',\n },\n\n '&[disabled]': {\n pointerEvents: 'none',\n },\n\n '&:not([aria-disabled=\"true\"])': {\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$icon-primary-hover',\n },\n\n '&:active, &[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$icon-primary-active',\n },\n },\n },\n v1: {\n ...focus.css({\n boxShadow: '$focus-v1',\n }),\n\n '&[disabled]': {\n pointerEvents: 'none',\n },\n\n '&:not([aria-disabled=\"true\"])': {\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-hover',\n },\n\n '&:active, &[data-pressed]': {\n backgroundColor: '$background-neutrals-active',\n },\n },\n },\n}\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { BaseItem } from './base-item'\nimport { disabledSelector, sharedStyles } from '../styles'\n\nexport const StyledIcon = styled(BaseItem, {\n padding: 0,\n font: 'unset',\n width: '$10',\n color: '$icon-neutrals',\n\n ...sharedStyles.base,\n\n variants: {\n v1: {\n true: {},\n false: {},\n },\n active: {\n true: {},\n false: {},\n },\n },\n\n compoundVariants: [\n {\n v1: true,\n active: true,\n css: {\n backgroundColor: '$background-primary-subtle',\n color: '$icon-primary-selected',\n },\n },\n {\n v1: false,\n active: true,\n css: {\n backgroundColor: '$background-primary-subtle-selected',\n color: '$icon-primary-selected',\n },\n },\n {\n v1: true,\n active: false,\n css: {\n ...sharedStyles.v1,\n\n [disabledSelector]: {\n pointerEvents: 'none',\n color: '$icon-neutrals-disabled',\n },\n },\n },\n {\n v1: false,\n active: false,\n css: sharedStyles.old,\n },\n ],\n})\n","import React, { createContext, useContext } from 'react'\nimport type { PropsWithChildren } from 'react'\n\ninterface ToolbarProps {\n v1: boolean\n}\n\ntype ToolbarContextProps = ToolbarProps\n\nexport type ToolbarProviderProps = ToolbarProps\n\nconst ToolbarContext = createContext<ToolbarContextProps>({} as any)\n\nexport const ToolbarProvider = ({\n children,\n ...restProps\n}: PropsWithChildren<ToolbarProviderProps>): React.ReactElement => (\n <ToolbarContext.Provider\n value={{\n ...restProps,\n }}\n >\n {children}\n </ToolbarContext.Provider>\n)\n\nexport const useToolbarContext = (): ToolbarContextProps =>\n useContext(ToolbarContext)\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport type { BaseItemProps } from './base-item'\nimport { StyledIcon } from './icon.styled'\nimport { useToolbarContext } from '../hooks/use-toolbar-context'\n\nexport interface IconProps extends BaseItemProps {\n /**\n * Renders icon in enabled/toggled state.\n * @default false\n */\n active?: boolean\n}\n\nexport const Icon = React.forwardRef<ElementRef<typeof StyledIcon>, IconProps>(\n ({ active = false, ...restProps }, forwardRef) => {\n const { v1 } = useToolbarContext()\n\n return (\n <StyledIcon {...restProps} v1={v1} active={active} ref={forwardRef} />\n )\n }\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Separator } from '@radix-ui/react-toolbar'\n\nexport const StyledSeparator = styled(Separator, {\n all: 'unset',\n display: 'block',\n boxSizing: 'border-box',\n backgroundColor: 'rgba(205, 204, 215, 1)',\n\n '&[data-orientation=\"vertical\"]': {\n width: '1px',\n height: '$6',\n margin: '0 $50',\n },\n\n '&[data-orientation=\"horizontal\"]': {\n height: '1px',\n width: '$6',\n margin: '$50 0',\n },\n\n variants: {\n v1: {\n true: { backgroundColor: '$border-neutrals-subtle' },\n },\n },\n})\n\nexport type StyledSeparatorProps = StrictComponentProps<typeof StyledSeparator>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport type { StyledSeparatorProps } from './separator.styled'\nimport { StyledSeparator } from './separator.styled'\nimport { useToolbarContext } from '../hooks/use-toolbar-context'\n\nexport interface SeparatorProps extends Omit<StyledSeparatorProps, 'v1'> {}\n\nexport const Separator = React.forwardRef<\n ElementRef<typeof StyledSeparator>,\n SeparatorProps\n>((props, forwardRef) => {\n const { v1 } = useToolbarContext()\n\n return <StyledSeparator {...props} v1={v1} ref={forwardRef} />\n})\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { BaseItem } from './base-item'\nimport { disabledSelector, sharedStyles } from '../styles'\n\nexport const StyledLink = styled(BaseItem, {\n paddingX: '$150',\n textDecoration: 'none',\n\n ...sharedStyles.base,\n\n variants: {\n v1: {\n true: {\n ...sharedStyles.v1,\n color: '$text-primary',\n textDecoration: 'underline solid',\n textDecorationThickness: '1px',\n textUnderlineOffset: '4px',\n outline: 'none',\n\n [disabledSelector]: {\n pointerEvents: 'none',\n color: '$text-neutrals-disabled',\n },\n },\n false: sharedStyles.old,\n },\n },\n})\n","import React from 'react'\nimport type { ElementRef, AnchorHTMLAttributes } from 'react'\n\nimport type { BaseItemProps } from './base-item'\nimport { StyledLink } from './link.styled'\nimport { useToolbarContext } from '../hooks/use-toolbar-context'\n\ntype ItemPropsWithAnchor = Omit<BaseItemProps, 'ref'> &\n AnchorHTMLAttributes<typeof StyledLink>\nexport interface LinkProps extends ItemPropsWithAnchor {}\n\nexport const Link = React.forwardRef<ElementRef<'a'>, LinkProps>(\n ({ children, href, ...restProps }, forwardRef) => {\n const { v1 } = useToolbarContext()\n\n return (\n <StyledLink {...restProps} asChild v1={v1}>\n <a href={href} ref={forwardRef}>\n {children}\n </a>\n </StyledLink>\n )\n }\n)\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { BaseItem } from './base-item'\nimport { disabledSelector, sharedStyles } from '../styles'\n\nexport const StyledItem = styled(BaseItem, {\n ...sharedStyles.base,\n\n variants: {\n v1: {\n true: {},\n false: {},\n },\n active: {\n true: {},\n false: {},\n },\n },\n\n compoundVariants: [\n {\n v1: true,\n active: true,\n css: {\n backgroundColor: '$background-primary-subtle',\n color: '$text-primary-selected',\n },\n },\n {\n v1: false,\n active: true,\n css: {\n backgroundColor: '$background-primary-subtle-selected',\n color: '$text-primary-selected',\n },\n },\n {\n v1: true,\n active: false,\n css: {\n ...sharedStyles.v1,\n\n [disabledSelector]: {\n pointerEvents: 'none',\n color: '$text-neutrals-disabled',\n },\n },\n },\n {\n v1: false,\n active: false,\n css: sharedStyles.old,\n },\n ],\n})\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { useToolbarContext } from '../hooks/use-toolbar-context'\nimport type { BaseItemProps } from './base-item'\nimport { BaseItem } from './base-item'\nimport { StyledItem } from './item.styled'\n\nexport interface ItemProps extends BaseItemProps {\n /**\n * It's applied by default when using with asChild attribute.\n * You can still combine default Item styles with your own component by\n * setting this prop to false.\n * Note: Must be used together with asChild\n * @default true\n */\n unstyled?: boolean\n\n /**\n * Renders item in enabled/toggled state.\n * @default false\n */\n active?: boolean\n}\n\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n ({ active = false, unstyled = true, asChild, ...restProps }, forwardRef) => {\n const { v1 } = useToolbarContext()\n\n const shouldRenderUnstyled = asChild === true ? unstyled : false\n\n if (shouldRenderUnstyled) {\n return <BaseItem {...restProps} asChild={asChild} ref={forwardRef} />\n }\n\n return (\n <StyledItem {...restProps} v1={v1} active={active} ref={forwardRef} />\n )\n }\n)\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport { useNewDesignLanguage } from '@mirohq/design-system-experiments'\n\nimport type { StyledToolbarProps } from './toolbar.styled'\nimport { StyledToolbar } from './toolbar.styled'\nimport { Icon } from './partials/icon'\nimport { Separator } from './partials/separator'\nimport { Link } from './partials/link'\nimport { Item } from './partials/item'\nimport { ToolbarProvider } from './hooks/use-toolbar-context'\n\nexport interface ToolbarProps extends Omit<StyledToolbarProps, 'v1'> {\n /**\n * @deprecated Please use variant for non-floating toolbar\n */\n unstyled?: boolean\n\n /**\n * When floating, the toolbar has shadow and border to differentiate it from the surface\n * @default floating\n */\n variant?: StyledToolbarProps['variant']\n\n /**\n * The orientation of the toolbar\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical'\n\n /**\n * The reading direction of the toolbar\n * @default 'ltr'\n */\n dir?: 'ltr' | 'rtl'\n\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa\n * @default true\n */\n loop?: boolean\n}\n\nexport const Toolbar = React.forwardRef<\n ElementRef<typeof StyledToolbar>,\n ToolbarProps\n>(\n (\n {\n unstyled,\n orientation = 'horizontal',\n variant = 'floating',\n dir = 'ltr',\n loop = true,\n ...restProps\n },\n forwardRef\n ) => {\n const [v1] = useNewDesignLanguage()\n\n const variantProp =\n unstyled === undefined ? variant : unstyled ? 'flat' : 'floating'\n\n return (\n <ToolbarProvider v1={v1}>\n <StyledToolbar\n v1={v1}\n variant={variantProp}\n orientation={orientation}\n dir={dir}\n loop={loop}\n ref={forwardRef}\n {...restProps}\n />\n </ToolbarProvider>\n )\n }\n) as ForwardRefExoticComponent<ToolbarProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Icon: typeof Icon\n Item: typeof Item\n Link: typeof Link\n Separator: typeof Separator\n}\n\nToolbar.Icon = Icon\nToolbar.Item = Item\nToolbar.Link = Link\nToolbar.Separator = Separator\n"],"names":["styled","Root","RadixToolbar","React","useAriaDisabled","usePress","booleanify","useHover","jsx","mergeProps","focus","createContext","useContext","Separator","useNewDesignLanguage"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIa,MAAA,aAAA,GAAgBA,4BAAOC,iBAAM,EAAA;AAAA,EACxC,GAAK,EAAA,OAAA;AAAA,EACL,OAAS,EAAA,MAAA;AAAA,EACT,SAAW,EAAA,YAAA;AAAA,EACX,UAAY,EAAA,QAAA;AAAA,EACZ,QAAU,EAAA,MAAA;AAAA,EACV,GAAK,EAAA,KAAA;AAAA,EAEL,gCAAkC,EAAA;AAAA,IAChC,aAAe,EAAA,QAAA;AAAA,IACf,KAAO,EAAA,KAAA;AAAA,GACT;AAAA,EAEA,kCAAoC,EAAA;AAAA,IAClC,MAAQ,EAAA,KAAA;AAAA,GACV;AAAA,EAEA,QAAU,EAAA;AAAA,IACR,EAAI,EAAA;AAAA,MACF,MAAM,EAAC;AAAA,KACT;AAAA,IACA,OAAS,EAAA;AAAA,MACP,UAAU,EAAC;AAAA,MACX,MAAM,EAAC;AAAA,KACT;AAAA,GACF;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB;AAAA,MACE,OAAS,EAAA,UAAA;AAAA,MACT,EAAI,EAAA,KAAA;AAAA,MACJ,GAAK,EAAA;AAAA,QACH,eAAiB,EAAA,gCAAA;AAAA,QACjB,SAAW,EAAA,KAAA;AAAA,QACX,YAAc,EAAA,KAAA;AAAA,QACd,OAAS,EAAA,KAAA;AAAA,OACX;AAAA,KACF;AAAA,IACA;AAAA,MACE,OAAS,EAAA,UAAA;AAAA,MACT,EAAI,EAAA,IAAA;AAAA,MACJ,GAAK,EAAA;AAAA,QACH,eAAiB,EAAA,6BAAA;AAAA,QACjB,SAAW,EAAA,wCAAA;AAAA,QACX,MAAQ,EAAA,qCAAA;AAAA,QACR,YA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QACA,GAAK,EAAA,UAAA;AAAA,QACJ,GAAG,SAAA;AAAA,OAAA;AAAA,KAER,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,EAAA;AAYA,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,SAAY,GAAA,SAAA;;;;"}
|
package/dist/module.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { createContext, useContext } from 'react';
|
|
3
|
+
import { useNewDesignLanguage } from '@mirohq/design-system-experiments';
|
|
3
4
|
import { styled } from '@mirohq/design-system-stitches';
|
|
4
5
|
import * as RadixToolbar from '@radix-ui/react-toolbar';
|
|
5
6
|
import { Root, Separator as Separator$1 } from '@radix-ui/react-toolbar';
|
|
@@ -7,6 +8,7 @@ import { useHover } from '@react-aria/interactions';
|
|
|
7
8
|
import { mergeProps } from '@react-aria/utils';
|
|
8
9
|
import { usePress } from '@mirohq/design-system-use-press';
|
|
9
10
|
import { booleanify } from '@mirohq/design-system-utils';
|
|
11
|
+
import { useAriaDisabled } from '@mirohq/design-system-use-aria-disabled';
|
|
10
12
|
import { focus } from '@mirohq/design-system-styles';
|
|
11
13
|
|
|
12
14
|
const StyledToolbar = styled(Root, {
|
|
@@ -24,97 +26,69 @@ const StyledToolbar = styled(Root, {
|
|
|
24
26
|
height: "$12"
|
|
25
27
|
},
|
|
26
28
|
variants: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
v1: {
|
|
30
|
+
true: {}
|
|
31
|
+
},
|
|
32
|
+
variant: {
|
|
33
|
+
floating: {},
|
|
34
|
+
flat: {}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
compoundVariants: [
|
|
38
|
+
{
|
|
39
|
+
variant: "floating",
|
|
40
|
+
v1: false,
|
|
41
|
+
css: {
|
|
29
42
|
backgroundColor: "$background-neutrals-container",
|
|
30
43
|
boxShadow: "$50",
|
|
31
44
|
borderRadius: "$50",
|
|
32
45
|
padding: "2px"
|
|
33
46
|
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
variant: "floating",
|
|
50
|
+
v1: true,
|
|
51
|
+
css: {
|
|
52
|
+
backgroundColor: "$background-neutrals-layout",
|
|
53
|
+
boxShadow: "0px 1px 8px 0px rgba(34, 36, 40, 0.05)",
|
|
54
|
+
border: "0.5px solid $border-neutrals-subtle",
|
|
55
|
+
borderRadius: "$100",
|
|
56
|
+
padding: "$50"
|
|
57
|
+
}
|
|
34
58
|
}
|
|
35
|
-
|
|
59
|
+
]
|
|
36
60
|
});
|
|
37
61
|
|
|
38
|
-
const
|
|
62
|
+
const StyledBaseItem = styled(RadixToolbar.Button, {
|
|
39
63
|
boxSizing: "border-box",
|
|
40
64
|
cursor: "pointer",
|
|
41
65
|
userSelect: "none",
|
|
42
66
|
display: "flex",
|
|
43
67
|
alignItems: "center",
|
|
44
68
|
justifyContent: "center",
|
|
45
|
-
flexShrink: 0
|
|
46
|
-
};
|
|
47
|
-
const disabledSelector = '&[disabled], &[aria-disabled="true"]';
|
|
48
|
-
const StyledItem = styled(RadixToolbar.Button, {
|
|
49
|
-
variants: {
|
|
50
|
-
unstyled: {
|
|
51
|
-
true: {
|
|
52
|
-
...defaultStyles
|
|
53
|
-
},
|
|
54
|
-
false: {
|
|
55
|
-
...defaultStyles,
|
|
56
|
-
borderRadius: 4,
|
|
57
|
-
height: "$10",
|
|
58
|
-
...focus.css({
|
|
59
|
-
boxShadow: "$focus-small",
|
|
60
|
-
outline: "1px solid transparent"
|
|
61
|
-
}),
|
|
62
|
-
[disabledSelector]: {
|
|
63
|
-
pointerEvents: "none",
|
|
64
|
-
color: "$text-neutrals-disabled"
|
|
65
|
-
},
|
|
66
|
-
"&[data-hovered]": {
|
|
67
|
-
backgroundColor: "$background-primary-subtle-hover",
|
|
68
|
-
color: "$icon-primary-hover"
|
|
69
|
-
},
|
|
70
|
-
"&:active, &[data-pressed]": {
|
|
71
|
-
backgroundColor: "$background-primary-subtle-active",
|
|
72
|
-
color: "$icon-primary-active"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
wrapper: {
|
|
77
|
-
true: {
|
|
78
|
-
backgroundColor: "transparent",
|
|
79
|
-
border: "none",
|
|
80
|
-
cursor: "pointer"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
active: {
|
|
84
|
-
true: {},
|
|
85
|
-
false: {}
|
|
86
|
-
}
|
|
87
|
-
},
|
|
69
|
+
flexShrink: 0,
|
|
88
70
|
'&[tabindex="0"]': {
|
|
89
71
|
zIndex: "1"
|
|
90
|
-
}
|
|
91
|
-
compoundVariants: [
|
|
92
|
-
{
|
|
93
|
-
unstyled: false,
|
|
94
|
-
active: true,
|
|
95
|
-
css: {
|
|
96
|
-
"&&": {
|
|
97
|
-
backgroundColor: "$background-primary-subtle-selected",
|
|
98
|
-
color: "$icon-primary-selected"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
]
|
|
72
|
+
}
|
|
103
73
|
});
|
|
104
74
|
|
|
105
|
-
const
|
|
75
|
+
const BaseItem = React.forwardRef(
|
|
106
76
|
({
|
|
107
77
|
disabled = false,
|
|
108
78
|
"aria-disabled": ariaDisabled,
|
|
109
79
|
asChild,
|
|
110
|
-
unstyled = true,
|
|
111
|
-
active = false,
|
|
112
80
|
onHoverStart,
|
|
113
81
|
onHoverEnd,
|
|
114
82
|
onHoverChange,
|
|
115
83
|
...restProps
|
|
116
84
|
}, forwardRef) => {
|
|
117
|
-
|
|
85
|
+
const elementProps = useAriaDisabled(
|
|
86
|
+
{
|
|
87
|
+
...restProps,
|
|
88
|
+
ariaDisabled
|
|
89
|
+
},
|
|
90
|
+
{ allowArrows: true }
|
|
91
|
+
);
|
|
118
92
|
const { pressProps } = usePress({
|
|
119
93
|
preventFocusOnPress: "auto",
|
|
120
94
|
disabled: disabled || booleanify(ariaDisabled),
|
|
@@ -125,16 +99,12 @@ const Item = React.forwardRef(
|
|
|
125
99
|
onHoverEnd,
|
|
126
100
|
onHoverChange
|
|
127
101
|
});
|
|
128
|
-
elementProps = mergeProps(pressProps, hoverProps);
|
|
129
102
|
return /* @__PURE__ */ jsx(
|
|
130
|
-
|
|
103
|
+
StyledBaseItem,
|
|
131
104
|
{
|
|
132
|
-
...
|
|
105
|
+
...mergeProps(pressProps, hoverProps),
|
|
133
106
|
"data-hovered": isHovered ? "" : void 0,
|
|
134
107
|
asChild,
|
|
135
|
-
active,
|
|
136
|
-
unstyled: asChild === true ? unstyled : false,
|
|
137
|
-
wrapper: asChild !== true,
|
|
138
108
|
disabled,
|
|
139
109
|
"aria-disabled": booleanify(ariaDisabled) ? "true" : ariaDisabled,
|
|
140
110
|
ref: forwardRef
|
|
@@ -143,16 +113,127 @@ const Item = React.forwardRef(
|
|
|
143
113
|
}
|
|
144
114
|
);
|
|
145
115
|
|
|
146
|
-
const
|
|
116
|
+
const disabledSelector = '&[disabled], &[aria-disabled="true"]';
|
|
117
|
+
const sharedStyles = {
|
|
118
|
+
base: {
|
|
119
|
+
backgroundColor: "$transparent",
|
|
120
|
+
borderRadius: "$50",
|
|
121
|
+
height: "$10",
|
|
122
|
+
border: "none"
|
|
123
|
+
},
|
|
124
|
+
old: {
|
|
125
|
+
...focus.css({
|
|
126
|
+
boxShadow: "$focus-small",
|
|
127
|
+
outline: "1px solid transparent"
|
|
128
|
+
}),
|
|
129
|
+
[disabledSelector]: {
|
|
130
|
+
cursor: "default",
|
|
131
|
+
color: "$text-neutrals-disabled"
|
|
132
|
+
},
|
|
133
|
+
"&[disabled]": {
|
|
134
|
+
pointerEvents: "none"
|
|
135
|
+
},
|
|
136
|
+
'&:not([aria-disabled="true"])': {
|
|
137
|
+
"&[data-hovered]": {
|
|
138
|
+
backgroundColor: "$background-primary-subtle-hover",
|
|
139
|
+
color: "$icon-primary-hover"
|
|
140
|
+
},
|
|
141
|
+
"&:active, &[data-pressed]": {
|
|
142
|
+
backgroundColor: "$background-primary-subtle-active",
|
|
143
|
+
color: "$icon-primary-active"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
v1: {
|
|
148
|
+
...focus.css({
|
|
149
|
+
boxShadow: "$focus-v1"
|
|
150
|
+
}),
|
|
151
|
+
"&[disabled]": {
|
|
152
|
+
pointerEvents: "none"
|
|
153
|
+
},
|
|
154
|
+
'&:not([aria-disabled="true"])': {
|
|
155
|
+
"&[data-hovered]": {
|
|
156
|
+
backgroundColor: "$background-neutrals-hover"
|
|
157
|
+
},
|
|
158
|
+
"&:active, &[data-pressed]": {
|
|
159
|
+
backgroundColor: "$background-neutrals-active"
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
const StyledIcon = styled(BaseItem, {
|
|
147
166
|
padding: 0,
|
|
148
|
-
border: "none",
|
|
149
167
|
font: "unset",
|
|
150
168
|
width: "$10",
|
|
151
|
-
color: "$icon-neutrals"
|
|
169
|
+
color: "$icon-neutrals",
|
|
170
|
+
...sharedStyles.base,
|
|
171
|
+
variants: {
|
|
172
|
+
v1: {
|
|
173
|
+
true: {},
|
|
174
|
+
false: {}
|
|
175
|
+
},
|
|
176
|
+
active: {
|
|
177
|
+
true: {},
|
|
178
|
+
false: {}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
compoundVariants: [
|
|
182
|
+
{
|
|
183
|
+
v1: true,
|
|
184
|
+
active: true,
|
|
185
|
+
css: {
|
|
186
|
+
backgroundColor: "$background-primary-subtle",
|
|
187
|
+
color: "$icon-primary-selected"
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
v1: false,
|
|
192
|
+
active: true,
|
|
193
|
+
css: {
|
|
194
|
+
backgroundColor: "$background-primary-subtle-selected",
|
|
195
|
+
color: "$icon-primary-selected"
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
v1: true,
|
|
200
|
+
active: false,
|
|
201
|
+
css: {
|
|
202
|
+
...sharedStyles.v1,
|
|
203
|
+
[disabledSelector]: {
|
|
204
|
+
pointerEvents: "none",
|
|
205
|
+
color: "$icon-neutrals-disabled"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
v1: false,
|
|
211
|
+
active: false,
|
|
212
|
+
css: sharedStyles.old
|
|
213
|
+
}
|
|
214
|
+
]
|
|
152
215
|
});
|
|
153
216
|
|
|
217
|
+
const ToolbarContext = createContext({});
|
|
218
|
+
const ToolbarProvider = ({
|
|
219
|
+
children,
|
|
220
|
+
...restProps
|
|
221
|
+
}) => /* @__PURE__ */ jsx(
|
|
222
|
+
ToolbarContext.Provider,
|
|
223
|
+
{
|
|
224
|
+
value: {
|
|
225
|
+
...restProps
|
|
226
|
+
},
|
|
227
|
+
children
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
const useToolbarContext = () => useContext(ToolbarContext);
|
|
231
|
+
|
|
154
232
|
const Icon = React.forwardRef(
|
|
155
|
-
(
|
|
233
|
+
({ active = false, ...restProps }, forwardRef) => {
|
|
234
|
+
const { v1 } = useToolbarContext();
|
|
235
|
+
return /* @__PURE__ */ jsx(StyledIcon, { ...restProps, v1, active, ref: forwardRef });
|
|
236
|
+
}
|
|
156
237
|
);
|
|
157
238
|
|
|
158
239
|
const StyledSeparator = styled(Separator$1, {
|
|
@@ -169,39 +250,132 @@ const StyledSeparator = styled(Separator$1, {
|
|
|
169
250
|
height: "1px",
|
|
170
251
|
width: "$6",
|
|
171
252
|
margin: "$50 0"
|
|
253
|
+
},
|
|
254
|
+
variants: {
|
|
255
|
+
v1: {
|
|
256
|
+
true: { backgroundColor: "$border-neutrals-subtle" }
|
|
257
|
+
}
|
|
172
258
|
}
|
|
173
259
|
});
|
|
174
260
|
|
|
175
|
-
const Separator = React.forwardRef((props, forwardRef) =>
|
|
261
|
+
const Separator = React.forwardRef((props, forwardRef) => {
|
|
262
|
+
const { v1 } = useToolbarContext();
|
|
263
|
+
return /* @__PURE__ */ jsx(StyledSeparator, { ...props, v1, ref: forwardRef });
|
|
264
|
+
});
|
|
176
265
|
|
|
177
|
-
const StyledLink = styled(
|
|
266
|
+
const StyledLink = styled(BaseItem, {
|
|
178
267
|
paddingX: "$150",
|
|
179
|
-
textDecoration: "none"
|
|
268
|
+
textDecoration: "none",
|
|
269
|
+
...sharedStyles.base,
|
|
270
|
+
variants: {
|
|
271
|
+
v1: {
|
|
272
|
+
true: {
|
|
273
|
+
...sharedStyles.v1,
|
|
274
|
+
color: "$text-primary",
|
|
275
|
+
textDecoration: "underline solid",
|
|
276
|
+
textDecorationThickness: "1px",
|
|
277
|
+
textUnderlineOffset: "4px",
|
|
278
|
+
outline: "none",
|
|
279
|
+
[disabledSelector]: {
|
|
280
|
+
pointerEvents: "none",
|
|
281
|
+
color: "$text-neutrals-disabled"
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
false: sharedStyles.old
|
|
285
|
+
}
|
|
286
|
+
}
|
|
180
287
|
});
|
|
181
288
|
|
|
182
289
|
const Link = React.forwardRef(
|
|
183
|
-
({ children, href, ...restProps }, forwardRef) =>
|
|
290
|
+
({ children, href, ...restProps }, forwardRef) => {
|
|
291
|
+
const { v1 } = useToolbarContext();
|
|
292
|
+
return /* @__PURE__ */ jsx(StyledLink, { ...restProps, asChild: true, v1, children: /* @__PURE__ */ jsx("a", { href, ref: forwardRef, children }) });
|
|
293
|
+
}
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
const StyledItem = styled(BaseItem, {
|
|
297
|
+
...sharedStyles.base,
|
|
298
|
+
variants: {
|
|
299
|
+
v1: {
|
|
300
|
+
true: {},
|
|
301
|
+
false: {}
|
|
302
|
+
},
|
|
303
|
+
active: {
|
|
304
|
+
true: {},
|
|
305
|
+
false: {}
|
|
306
|
+
}
|
|
307
|
+
},
|
|
308
|
+
compoundVariants: [
|
|
309
|
+
{
|
|
310
|
+
v1: true,
|
|
311
|
+
active: true,
|
|
312
|
+
css: {
|
|
313
|
+
backgroundColor: "$background-primary-subtle",
|
|
314
|
+
color: "$text-primary-selected"
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
v1: false,
|
|
319
|
+
active: true,
|
|
320
|
+
css: {
|
|
321
|
+
backgroundColor: "$background-primary-subtle-selected",
|
|
322
|
+
color: "$text-primary-selected"
|
|
323
|
+
}
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
v1: true,
|
|
327
|
+
active: false,
|
|
328
|
+
css: {
|
|
329
|
+
...sharedStyles.v1,
|
|
330
|
+
[disabledSelector]: {
|
|
331
|
+
pointerEvents: "none",
|
|
332
|
+
color: "$text-neutrals-disabled"
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
v1: false,
|
|
338
|
+
active: false,
|
|
339
|
+
css: sharedStyles.old
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
const Item = React.forwardRef(
|
|
345
|
+
({ active = false, unstyled = true, asChild, ...restProps }, forwardRef) => {
|
|
346
|
+
const { v1 } = useToolbarContext();
|
|
347
|
+
const shouldRenderUnstyled = asChild === true ? unstyled : false;
|
|
348
|
+
if (shouldRenderUnstyled) {
|
|
349
|
+
return /* @__PURE__ */ jsx(BaseItem, { ...restProps, asChild, ref: forwardRef });
|
|
350
|
+
}
|
|
351
|
+
return /* @__PURE__ */ jsx(StyledItem, { ...restProps, v1, active, ref: forwardRef });
|
|
352
|
+
}
|
|
184
353
|
);
|
|
185
354
|
|
|
186
355
|
const Toolbar = React.forwardRef(
|
|
187
356
|
({
|
|
188
|
-
unstyled
|
|
357
|
+
unstyled,
|
|
189
358
|
orientation = "horizontal",
|
|
359
|
+
variant = "floating",
|
|
190
360
|
dir = "ltr",
|
|
191
361
|
loop = true,
|
|
192
|
-
direction,
|
|
193
362
|
...restProps
|
|
194
|
-
}, forwardRef) =>
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
363
|
+
}, forwardRef) => {
|
|
364
|
+
const [v1] = useNewDesignLanguage();
|
|
365
|
+
const variantProp = unstyled === void 0 ? variant : unstyled ? "flat" : "floating";
|
|
366
|
+
return /* @__PURE__ */ jsx(ToolbarProvider, { v1, children: /* @__PURE__ */ jsx(
|
|
367
|
+
StyledToolbar,
|
|
368
|
+
{
|
|
369
|
+
v1,
|
|
370
|
+
variant: variantProp,
|
|
371
|
+
orientation,
|
|
372
|
+
dir,
|
|
373
|
+
loop,
|
|
374
|
+
ref: forwardRef,
|
|
375
|
+
...restProps
|
|
376
|
+
}
|
|
377
|
+
) });
|
|
378
|
+
}
|
|
205
379
|
);
|
|
206
380
|
Toolbar.Icon = Icon;
|
|
207
381
|
Toolbar.Item = Item;
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/toolbar.styled.ts","../src/partials/item.styled.ts","../src/partials/item.tsx","../src/partials/icon.styled.tsx","../src/partials/icon.tsx","../src/partials/separator.styled.ts","../src/partials/separator.tsx","../src/partials/link.styled.tsx","../src/partials/link.tsx","../src/toolbar.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Root } from '@radix-ui/react-toolbar'\n\nexport const StyledToolbar = styled(Root, {\n all: 'unset',\n display: 'flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n maxWidth: '100%',\n gap: '$50',\n\n '&[data-orientation=\"vertical\"]': {\n flexDirection: 'column',\n width: '$12',\n },\n\n '&[data-orientation=\"horizontal\"]': {\n height: '$12',\n },\n\n variants: {\n unstyled: {\n false: {\n backgroundColor: '$background-neutrals-container',\n boxShadow: '$50',\n borderRadius: '$50',\n padding: '2px',\n },\n },\n },\n})\n\nexport type StyledToolbarProps = StrictComponentProps<typeof StyledToolbar>\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport * as RadixToolbar from '@radix-ui/react-toolbar'\nimport { focus } from '@mirohq/design-system-styles'\n\nconst defaultStyles = {\n boxSizing: 'border-box',\n cursor: 'pointer',\n userSelect: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n}\n\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\nexport const StyledItem = styled(RadixToolbar.Button, {\n variants: {\n unstyled: {\n true: {\n ...defaultStyles,\n },\n false: {\n ...defaultStyles,\n borderRadius: 4,\n height: '$10',\n\n ...focus.css({\n boxShadow: '$focus-small',\n outline: '1px solid transparent',\n }),\n\n [disabledSelector]: {\n pointerEvents: 'none',\n color: '$text-neutrals-disabled',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$icon-primary-hover',\n },\n\n '&:active, &[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$icon-primary-active',\n },\n },\n },\n wrapper: {\n true: {\n backgroundColor: 'transparent',\n border: 'none',\n cursor: 'pointer',\n },\n },\n active: {\n true: {},\n false: {},\n },\n },\n\n '&[tabindex=\"0\"]': {\n zIndex: '1',\n },\n\n compoundVariants: [\n {\n unstyled: false,\n active: true,\n css: {\n '&&': {\n backgroundColor: '$background-primary-subtle-selected',\n color: '$icon-primary-selected',\n },\n },\n },\n ],\n})\n\nexport type StyledItemProps = StrictComponentProps<typeof StyledItem>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useHover } from '@react-aria/interactions'\nimport type { HoverEvents } from '@react-types/shared'\nimport { mergeProps } from '@react-aria/utils'\nimport { usePress } from '@mirohq/design-system-use-press'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport type { PressEvents } from '@mirohq/design-system-use-press'\n\nimport { StyledItem } from './item.styled'\nimport type { StyledItemProps } from './item.styled'\n\nexport interface ItemProps extends StyledItemProps, HoverEvents, PressEvents {\n /**\n * Renders item in enabled/toggled state.\n * @default false\n */\n active?: boolean\n\n /**\n * It's applied by default when using with asChild attribute.\n * You can still combine default Item styles with your own component by\n * setting this prop to false.\n * Note: Must be used together with asChild\n * @default true\n */\n unstyled?: boolean\n\n disabled?: boolean\n}\n\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n (\n {\n disabled = false,\n 'aria-disabled': ariaDisabled,\n asChild,\n unstyled = true,\n active = false,\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n ...restProps\n },\n forwardRef\n ) => {\n let elementProps = restProps\n\n const { pressProps } = usePress({\n preventFocusOnPress: 'auto',\n disabled: disabled || booleanify(ariaDisabled),\n ...elementProps,\n })\n\n const { hoverProps, isHovered } = useHover({\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n })\n\n elementProps = mergeProps(pressProps, hoverProps)\n\n return (\n <StyledItem\n {...elementProps}\n data-hovered={isHovered ? '' : undefined}\n asChild={asChild}\n active={active}\n unstyled={asChild === true ? unstyled : false}\n wrapper={asChild !== true}\n disabled={disabled}\n aria-disabled={booleanify(ariaDisabled) ? 'true' : ariaDisabled}\n ref={forwardRef}\n />\n )\n }\n)\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { Item } from './item'\n\nexport const StyledIcon = styled(Item, {\n padding: 0,\n border: 'none',\n font: 'unset',\n width: '$10',\n color: '$icon-neutrals',\n})\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport type { ItemProps } from './item'\nimport { StyledIcon } from './icon.styled'\n\nexport type IconProps = Omit<ItemProps, 'unstyled'>\n\nexport const Icon = React.forwardRef<ElementRef<typeof StyledIcon>, IconProps>(\n (props, forwardRef) => (\n <StyledIcon unstyled={false} {...props} ref={forwardRef} />\n )\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Separator } from '@radix-ui/react-toolbar'\n\nexport const StyledSeparator = styled(Separator, {\n all: 'unset',\n display: 'block',\n boxSizing: 'border-box',\n backgroundColor: 'rgba(205, 204, 215, 1)',\n\n '&[data-orientation=\"vertical\"]': {\n width: '1px',\n height: '$6',\n margin: '0 $50',\n },\n\n '&[data-orientation=\"horizontal\"]': {\n height: '1px',\n width: '$6',\n margin: '$50 0',\n },\n})\n\nexport type StyledSeparatorProps = StrictComponentProps<typeof StyledSeparator>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport type { StyledSeparatorProps } from './separator.styled'\nimport { StyledSeparator } from './separator.styled'\n\nexport interface SeparatorProps extends StyledSeparatorProps {}\n\nexport const Separator = React.forwardRef<\n ElementRef<typeof StyledSeparator>,\n SeparatorProps\n>((props, forwardRef) => <StyledSeparator {...props} ref={forwardRef} />)\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { Item } from './item'\n\nexport const StyledLink = styled(Item, {\n paddingX: '$150',\n textDecoration: 'none',\n})\n","import React from 'react'\nimport type { ElementRef, AnchorHTMLAttributes } from 'react'\n\nimport type { ItemProps } from './item'\nimport { StyledLink } from './link.styled'\n\ntype ItemPropsWithAnchor = Omit<ItemProps, 'unstyled'> &\n AnchorHTMLAttributes<typeof StyledLink>\nexport interface LinkProps extends ItemPropsWithAnchor {}\n\nexport const Link = React.forwardRef<ElementRef<typeof StyledLink>, LinkProps>(\n ({ children, href, ...restProps }, forwardRef) => (\n <StyledLink asChild unstyled={false} {...restProps} ref={forwardRef}>\n <a href={href}>{children}</a>\n </StyledLink>\n )\n)\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport type { StyledToolbarProps } from './toolbar.styled'\nimport { StyledToolbar } from './toolbar.styled'\nimport { Icon } from './partials/icon'\nimport { Separator } from './partials/separator'\nimport { Link } from './partials/link'\nimport { Item } from './partials/item'\n\nexport interface ToolbarProps extends StyledToolbarProps {\n /**\n * Defines whether the toolbar has default styles (e.g. background, shadow, etc.)\n * @default false\n */\n unstyled?: boolean\n\n /**\n * The orientation of the toolbar\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical'\n\n /**\n * The reading direction of the toolbar\n * @default 'ltr'\n */\n dir?: 'ltr' | 'rtl'\n\n /**\n * The reading direction of the toolbar\n * @deprecated use dir instead\n */\n direction?: 'ltr' | 'rtl'\n\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa\n * @default true\n */\n loop?: boolean\n}\n\nexport const Toolbar = React.forwardRef<\n ElementRef<typeof StyledToolbar>,\n ToolbarProps\n>(\n (\n {\n unstyled = false,\n orientation = 'horizontal',\n dir = 'ltr',\n loop = true,\n direction,\n ...restProps\n },\n forwardRef\n ) => (\n <StyledToolbar\n unstyled={unstyled}\n orientation={orientation}\n dir={direction ?? dir}\n loop={loop}\n ref={forwardRef}\n {...restProps}\n />\n )\n) as ForwardRefExoticComponent<ToolbarProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Icon: typeof Icon\n Item: typeof Item\n Link: typeof Link\n Separator: typeof Separator\n}\n\nToolbar.Icon = Icon\nToolbar.Item = Item\nToolbar.Link = Link\nToolbar.Separator = Separator\n"],"names":["Separator"],"mappings":";;;;;;;;;;;AAIa,MAAA,aAAA,GAAgB,OAAO,IAAM,EAAA;AAAA,EACxC,GAAK,EAAA,OAAA;AAAA,EACL,OAAS,EAAA,MAAA;AAAA,EACT,SAAW,EAAA,YAAA;AAAA,EACX,UAAY,EAAA,QAAA;AAAA,EACZ,QAAU,EAAA,MAAA;AAAA,EACV,GAAK,EAAA,KAAA;AAAA,EAEL,gCAAkC,EAAA;AAAA,IAChC,aAAe,EAAA,QAAA;AAAA,IACf,KAAO,EAAA,KAAA;AAAA,GACT;AAAA,EAEA,kCA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MACJ,GAAG,SAAA;AAAA,KAAA;AAAA,GACN;AAEJ,EAAA;AAYA,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,SAAY,GAAA,SAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/toolbar.styled.ts","../src/partials/base-item.styled.ts","../src/partials/base-item.tsx","../src/styles.ts","../src/partials/icon.styled.tsx","../src/hooks/use-toolbar-context.tsx","../src/partials/icon.tsx","../src/partials/separator.styled.ts","../src/partials/separator.tsx","../src/partials/link.styled.tsx","../src/partials/link.tsx","../src/partials/item.styled.tsx","../src/partials/item.tsx","../src/toolbar.tsx"],"sourcesContent":["import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Root } from '@radix-ui/react-toolbar'\n\nexport const StyledToolbar = styled(Root, {\n all: 'unset',\n display: 'flex',\n boxSizing: 'border-box',\n alignItems: 'center',\n maxWidth: '100%',\n gap: '$50',\n\n '&[data-orientation=\"vertical\"]': {\n flexDirection: 'column',\n width: '$12',\n },\n\n '&[data-orientation=\"horizontal\"]': {\n height: '$12',\n },\n\n variants: {\n v1: {\n true: {},\n },\n variant: {\n floating: {},\n flat: {},\n },\n },\n compoundVariants: [\n {\n variant: 'floating',\n v1: false,\n css: {\n backgroundColor: '$background-neutrals-container',\n boxShadow: '$50',\n borderRadius: '$50',\n padding: '2px',\n },\n },\n {\n variant: 'floating',\n v1: true,\n css: {\n backgroundColor: '$background-neutrals-layout',\n boxShadow: '0px 1px 8px 0px rgba(34, 36, 40, 0.05)',\n border: '0.5px solid $border-neutrals-subtle',\n borderRadius: '$100',\n padding: '$50',\n },\n },\n ],\n})\n\nexport type StyledToolbarProps = StrictComponentProps<typeof StyledToolbar>\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport * as RadixToolbar from '@radix-ui/react-toolbar'\n\nexport const StyledBaseItem = styled(RadixToolbar.Button, {\n boxSizing: 'border-box',\n cursor: 'pointer',\n userSelect: 'none',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexShrink: 0,\n\n '&[tabindex=\"0\"]': {\n zIndex: '1',\n },\n})\n\nexport type StyledBaseItemProps = StrictComponentProps<typeof StyledBaseItem>\n","import React from 'react'\nimport type { ElementRef } from 'react'\nimport { useHover } from '@react-aria/interactions'\nimport type { HoverEvents } from '@react-types/shared'\nimport { mergeProps } from '@react-aria/utils'\nimport { usePress } from '@mirohq/design-system-use-press'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport type { PressEvents } from '@mirohq/design-system-use-press'\nimport { useAriaDisabled } from '@mirohq/design-system-use-aria-disabled'\n\nimport { StyledBaseItem } from './base-item.styled'\nimport type { StyledBaseItemProps } from './base-item.styled'\n\nexport interface BaseItemProps\n extends StyledBaseItemProps,\n HoverEvents,\n PressEvents {\n disabled?: boolean\n}\n\nexport const BaseItem = React.forwardRef<\n ElementRef<typeof StyledBaseItem>,\n BaseItemProps\n>(\n (\n {\n disabled = false,\n 'aria-disabled': ariaDisabled,\n asChild,\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n ...restProps\n },\n forwardRef\n ) => {\n const elementProps = useAriaDisabled(\n {\n ...restProps,\n ariaDisabled,\n },\n { allowArrows: true }\n )\n\n const { pressProps } = usePress({\n preventFocusOnPress: 'auto',\n disabled: disabled || booleanify(ariaDisabled),\n ...elementProps,\n })\n\n const { hoverProps, isHovered } = useHover({\n onHoverStart,\n onHoverEnd,\n onHoverChange,\n })\n\n return (\n <StyledBaseItem\n {...mergeProps(pressProps, hoverProps)}\n data-hovered={isHovered ? '' : undefined}\n asChild={asChild}\n disabled={disabled}\n aria-disabled={booleanify(ariaDisabled) ? 'true' : ariaDisabled}\n ref={forwardRef}\n />\n )\n }\n)\n","import { focus } from '@mirohq/design-system-styles'\n\nexport const disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\nexport const sharedStyles = {\n base: {\n backgroundColor: '$transparent',\n borderRadius: '$50',\n height: '$10',\n border: 'none',\n },\n old: {\n ...focus.css({\n boxShadow: '$focus-small',\n outline: '1px solid transparent',\n }),\n\n [disabledSelector]: {\n cursor: 'default',\n color: '$text-neutrals-disabled',\n },\n\n '&[disabled]': {\n pointerEvents: 'none',\n },\n\n '&:not([aria-disabled=\"true\"])': {\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$icon-primary-hover',\n },\n\n '&:active, &[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$icon-primary-active',\n },\n },\n },\n v1: {\n ...focus.css({\n boxShadow: '$focus-v1',\n }),\n\n '&[disabled]': {\n pointerEvents: 'none',\n },\n\n '&:not([aria-disabled=\"true\"])': {\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-hover',\n },\n\n '&:active, &[data-pressed]': {\n backgroundColor: '$background-neutrals-active',\n },\n },\n },\n}\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { BaseItem } from './base-item'\nimport { disabledSelector, sharedStyles } from '../styles'\n\nexport const StyledIcon = styled(BaseItem, {\n padding: 0,\n font: 'unset',\n width: '$10',\n color: '$icon-neutrals',\n\n ...sharedStyles.base,\n\n variants: {\n v1: {\n true: {},\n false: {},\n },\n active: {\n true: {},\n false: {},\n },\n },\n\n compoundVariants: [\n {\n v1: true,\n active: true,\n css: {\n backgroundColor: '$background-primary-subtle',\n color: '$icon-primary-selected',\n },\n },\n {\n v1: false,\n active: true,\n css: {\n backgroundColor: '$background-primary-subtle-selected',\n color: '$icon-primary-selected',\n },\n },\n {\n v1: true,\n active: false,\n css: {\n ...sharedStyles.v1,\n\n [disabledSelector]: {\n pointerEvents: 'none',\n color: '$icon-neutrals-disabled',\n },\n },\n },\n {\n v1: false,\n active: false,\n css: sharedStyles.old,\n },\n ],\n})\n","import React, { createContext, useContext } from 'react'\nimport type { PropsWithChildren } from 'react'\n\ninterface ToolbarProps {\n v1: boolean\n}\n\ntype ToolbarContextProps = ToolbarProps\n\nexport type ToolbarProviderProps = ToolbarProps\n\nconst ToolbarContext = createContext<ToolbarContextProps>({} as any)\n\nexport const ToolbarProvider = ({\n children,\n ...restProps\n}: PropsWithChildren<ToolbarProviderProps>): React.ReactElement => (\n <ToolbarContext.Provider\n value={{\n ...restProps,\n }}\n >\n {children}\n </ToolbarContext.Provider>\n)\n\nexport const useToolbarContext = (): ToolbarContextProps =>\n useContext(ToolbarContext)\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport type { BaseItemProps } from './base-item'\nimport { StyledIcon } from './icon.styled'\nimport { useToolbarContext } from '../hooks/use-toolbar-context'\n\nexport interface IconProps extends BaseItemProps {\n /**\n * Renders icon in enabled/toggled state.\n * @default false\n */\n active?: boolean\n}\n\nexport const Icon = React.forwardRef<ElementRef<typeof StyledIcon>, IconProps>(\n ({ active = false, ...restProps }, forwardRef) => {\n const { v1 } = useToolbarContext()\n\n return (\n <StyledIcon {...restProps} v1={v1} active={active} ref={forwardRef} />\n )\n }\n)\n","import { styled } from '@mirohq/design-system-stitches'\nimport type { StrictComponentProps } from '@mirohq/design-system-stitches'\nimport { Separator } from '@radix-ui/react-toolbar'\n\nexport const StyledSeparator = styled(Separator, {\n all: 'unset',\n display: 'block',\n boxSizing: 'border-box',\n backgroundColor: 'rgba(205, 204, 215, 1)',\n\n '&[data-orientation=\"vertical\"]': {\n width: '1px',\n height: '$6',\n margin: '0 $50',\n },\n\n '&[data-orientation=\"horizontal\"]': {\n height: '1px',\n width: '$6',\n margin: '$50 0',\n },\n\n variants: {\n v1: {\n true: { backgroundColor: '$border-neutrals-subtle' },\n },\n },\n})\n\nexport type StyledSeparatorProps = StrictComponentProps<typeof StyledSeparator>\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport type { StyledSeparatorProps } from './separator.styled'\nimport { StyledSeparator } from './separator.styled'\nimport { useToolbarContext } from '../hooks/use-toolbar-context'\n\nexport interface SeparatorProps extends Omit<StyledSeparatorProps, 'v1'> {}\n\nexport const Separator = React.forwardRef<\n ElementRef<typeof StyledSeparator>,\n SeparatorProps\n>((props, forwardRef) => {\n const { v1 } = useToolbarContext()\n\n return <StyledSeparator {...props} v1={v1} ref={forwardRef} />\n})\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { BaseItem } from './base-item'\nimport { disabledSelector, sharedStyles } from '../styles'\n\nexport const StyledLink = styled(BaseItem, {\n paddingX: '$150',\n textDecoration: 'none',\n\n ...sharedStyles.base,\n\n variants: {\n v1: {\n true: {\n ...sharedStyles.v1,\n color: '$text-primary',\n textDecoration: 'underline solid',\n textDecorationThickness: '1px',\n textUnderlineOffset: '4px',\n outline: 'none',\n\n [disabledSelector]: {\n pointerEvents: 'none',\n color: '$text-neutrals-disabled',\n },\n },\n false: sharedStyles.old,\n },\n },\n})\n","import React from 'react'\nimport type { ElementRef, AnchorHTMLAttributes } from 'react'\n\nimport type { BaseItemProps } from './base-item'\nimport { StyledLink } from './link.styled'\nimport { useToolbarContext } from '../hooks/use-toolbar-context'\n\ntype ItemPropsWithAnchor = Omit<BaseItemProps, 'ref'> &\n AnchorHTMLAttributes<typeof StyledLink>\nexport interface LinkProps extends ItemPropsWithAnchor {}\n\nexport const Link = React.forwardRef<ElementRef<'a'>, LinkProps>(\n ({ children, href, ...restProps }, forwardRef) => {\n const { v1 } = useToolbarContext()\n\n return (\n <StyledLink {...restProps} asChild v1={v1}>\n <a href={href} ref={forwardRef}>\n {children}\n </a>\n </StyledLink>\n )\n }\n)\n","import { styled } from '@mirohq/design-system-stitches'\n\nimport { BaseItem } from './base-item'\nimport { disabledSelector, sharedStyles } from '../styles'\n\nexport const StyledItem = styled(BaseItem, {\n ...sharedStyles.base,\n\n variants: {\n v1: {\n true: {},\n false: {},\n },\n active: {\n true: {},\n false: {},\n },\n },\n\n compoundVariants: [\n {\n v1: true,\n active: true,\n css: {\n backgroundColor: '$background-primary-subtle',\n color: '$text-primary-selected',\n },\n },\n {\n v1: false,\n active: true,\n css: {\n backgroundColor: '$background-primary-subtle-selected',\n color: '$text-primary-selected',\n },\n },\n {\n v1: true,\n active: false,\n css: {\n ...sharedStyles.v1,\n\n [disabledSelector]: {\n pointerEvents: 'none',\n color: '$text-neutrals-disabled',\n },\n },\n },\n {\n v1: false,\n active: false,\n css: sharedStyles.old,\n },\n ],\n})\n","import React from 'react'\nimport type { ElementRef } from 'react'\n\nimport { useToolbarContext } from '../hooks/use-toolbar-context'\nimport type { BaseItemProps } from './base-item'\nimport { BaseItem } from './base-item'\nimport { StyledItem } from './item.styled'\n\nexport interface ItemProps extends BaseItemProps {\n /**\n * It's applied by default when using with asChild attribute.\n * You can still combine default Item styles with your own component by\n * setting this prop to false.\n * Note: Must be used together with asChild\n * @default true\n */\n unstyled?: boolean\n\n /**\n * Renders item in enabled/toggled state.\n * @default false\n */\n active?: boolean\n}\n\nexport const Item = React.forwardRef<ElementRef<typeof StyledItem>, ItemProps>(\n ({ active = false, unstyled = true, asChild, ...restProps }, forwardRef) => {\n const { v1 } = useToolbarContext()\n\n const shouldRenderUnstyled = asChild === true ? unstyled : false\n\n if (shouldRenderUnstyled) {\n return <BaseItem {...restProps} asChild={asChild} ref={forwardRef} />\n }\n\n return (\n <StyledItem {...restProps} v1={v1} active={active} ref={forwardRef} />\n )\n }\n)\n","import React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\nimport { useNewDesignLanguage } from '@mirohq/design-system-experiments'\n\nimport type { StyledToolbarProps } from './toolbar.styled'\nimport { StyledToolbar } from './toolbar.styled'\nimport { Icon } from './partials/icon'\nimport { Separator } from './partials/separator'\nimport { Link } from './partials/link'\nimport { Item } from './partials/item'\nimport { ToolbarProvider } from './hooks/use-toolbar-context'\n\nexport interface ToolbarProps extends Omit<StyledToolbarProps, 'v1'> {\n /**\n * @deprecated Please use variant for non-floating toolbar\n */\n unstyled?: boolean\n\n /**\n * When floating, the toolbar has shadow and border to differentiate it from the surface\n * @default floating\n */\n variant?: StyledToolbarProps['variant']\n\n /**\n * The orientation of the toolbar\n * @default 'horizontal'\n */\n orientation?: 'horizontal' | 'vertical'\n\n /**\n * The reading direction of the toolbar\n * @default 'ltr'\n */\n dir?: 'ltr' | 'rtl'\n\n /**\n * When true, keyboard navigation will loop from last tab to first, and vice versa\n * @default true\n */\n loop?: boolean\n}\n\nexport const Toolbar = React.forwardRef<\n ElementRef<typeof StyledToolbar>,\n ToolbarProps\n>(\n (\n {\n unstyled,\n orientation = 'horizontal',\n variant = 'floating',\n dir = 'ltr',\n loop = true,\n ...restProps\n },\n forwardRef\n ) => {\n const [v1] = useNewDesignLanguage()\n\n const variantProp =\n unstyled === undefined ? variant : unstyled ? 'flat' : 'floating'\n\n return (\n <ToolbarProvider v1={v1}>\n <StyledToolbar\n v1={v1}\n variant={variantProp}\n orientation={orientation}\n dir={dir}\n loop={loop}\n ref={forwardRef}\n {...restProps}\n />\n </ToolbarProvider>\n )\n }\n) as ForwardRefExoticComponent<ToolbarProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n Icon: typeof Icon\n Item: typeof Item\n Link: typeof Link\n Separator: typeof Separator\n}\n\nToolbar.Icon = Icon\nToolbar.Item = Item\nToolbar.Link = Link\nToolbar.Separator = Separator\n"],"names":["Separator"],"mappings":";;;;;;;;;;;;;AAIa,MAAA,aAAA,GAAgB,OAAO,IAAM,EAAA;AAAA,EACxC,GAAK,EAAA,OAAA;AAAA,EACL,OAAS,EAAA,MAAA;AAAA,EACT,SAAW,EAAA,YAAA;AAAA,EACX,UAAY,EAAA,QAAA;AAAA,EACZ,QAAU,EAAA,MAAA;AAAA,EACV,GAAK,EAAA,KAAA;AAAA,EAEL,gCAAkC,EAAA;AAAA,IAChC,aAAe,EAAA,QAAA;AAAA,IACf,KAAO,EAAA,KAAA;AAAA,GACT;AAAA,EAEA,kCAAoC,EAAA;AAAA,IAClC,MA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IO,MAAM,UAAU,KAAM,CAAA,UAAA;AAAA,EAI3B,CACE;AAAA,IACE,QAAA;AAAA,IACA,WAAc,GAAA,YAAA;AAAA,IACd,OAAU,GAAA,UAAA;AAAA,IACV,GAAM,GAAA,KAAA;AAAA,IACN,IAAO,GAAA,IAAA;AAAA,IACP,GAAG,SAAA;AAAA,KAEL,UACG,KAAA;AACH,IAAM,MAAA,CAAC,EAAE,CAAA,GAAI,oBAAqB,EAAA,CAAA;AAElC,IAAA,MAAM,WACJ,GAAA,QAAA,KAAa,KAAY,CAAA,GAAA,OAAA,GAAU,WAAW,MAAS,GAAA,UAAA,CAAA;AAEzD,IACE,uBAAA,GAAA,CAAC,mBAAgB,EACf,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,aAAA;AAAA,MAAA;AAAA,QACC,EAAA;AAAA,QACA,OAAS,EAAA,WAAA;AAAA,QACT,WAAA;AAAA,QACA,GAAA;AAAA,QACA,IAAA;AAAA,QACA,GAAK,EAAA,UAAA;AAAA,QACJ,GAAG,SAAA;AAAA,OAAA;AAAA,KAER,EAAA,CAAA,CAAA;AAAA,GAEJ;AACF,EAAA;AAYA,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,IAAO,GAAA,IAAA,CAAA;AACf,OAAA,CAAQ,SAAY,GAAA,SAAA;;;;"}
|
package/dist/types.d.ts
CHANGED
|
@@ -7,65 +7,80 @@ import * as _radix_ui_react_toolbar from '@radix-ui/react-toolbar';
|
|
|
7
7
|
import { HoverEvents } from '@react-types/shared';
|
|
8
8
|
import { PressEvents } from '@mirohq/design-system-use-press';
|
|
9
9
|
|
|
10
|
-
declare const StyledToolbar: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_radix_ui_react_toolbar.ToolbarProps & react.RefAttributes<HTMLDivElement>>>, "
|
|
11
|
-
|
|
10
|
+
declare const StyledToolbar: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_radix_ui_react_toolbar.ToolbarProps & react.RefAttributes<HTMLDivElement>>>, "v1" | "variant"> & _stitches_react_types_styled_component.TransformProps<{
|
|
11
|
+
v1?: boolean | "true" | undefined;
|
|
12
|
+
variant?: "flat" | "floating" | undefined;
|
|
12
13
|
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_toolbar.ToolbarProps & react.RefAttributes<HTMLDivElement>>, {
|
|
13
|
-
|
|
14
|
+
v1?: boolean | "true" | undefined;
|
|
15
|
+
variant?: "flat" | "floating" | undefined;
|
|
14
16
|
}, {}>;
|
|
15
17
|
declare type StyledToolbarProps = StrictComponentProps<typeof StyledToolbar>;
|
|
16
18
|
|
|
17
|
-
declare const
|
|
18
|
-
|
|
19
|
-
wrapper?: boolean | "true" | undefined;
|
|
20
|
-
active?: boolean | "true" | "false" | undefined;
|
|
21
|
-
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_toolbar.ToolbarButtonProps & react.RefAttributes<HTMLButtonElement>>, {
|
|
22
|
-
unstyled?: boolean | "true" | "false" | undefined;
|
|
23
|
-
wrapper?: boolean | "true" | undefined;
|
|
24
|
-
active?: boolean | "true" | "false" | undefined;
|
|
25
|
-
}, {}>;
|
|
26
|
-
declare type StyledItemProps = StrictComponentProps<typeof StyledItem>;
|
|
19
|
+
declare const StyledBaseItem: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_radix_ui_react_toolbar.ToolbarButtonProps & react.RefAttributes<HTMLButtonElement>>>, never> & _stitches_react_types_styled_component.TransformProps<{}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_toolbar.ToolbarButtonProps & react.RefAttributes<HTMLButtonElement>>, {}, {}>;
|
|
20
|
+
declare type StyledBaseItemProps = StrictComponentProps<typeof StyledBaseItem>;
|
|
27
21
|
|
|
28
|
-
interface
|
|
22
|
+
interface BaseItemProps extends StyledBaseItemProps, HoverEvents, PressEvents {
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface IconProps extends BaseItemProps {
|
|
29
27
|
/**
|
|
30
|
-
* Renders
|
|
28
|
+
* Renders icon in enabled/toggled state.
|
|
31
29
|
* @default false
|
|
32
30
|
*/
|
|
33
31
|
active?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* It's applied by default when using with asChild attribute.
|
|
36
|
-
* You can still combine default Item styles with your own component by
|
|
37
|
-
* setting this prop to false.
|
|
38
|
-
* Note: Must be used together with asChild
|
|
39
|
-
* @default true
|
|
40
|
-
*/
|
|
41
|
-
unstyled?: boolean;
|
|
42
|
-
disabled?: boolean;
|
|
43
32
|
}
|
|
44
|
-
declare const Item: react__default.ForwardRefExoticComponent<Omit<ItemProps, "ref"> & react__default.RefAttributes<HTMLButtonElement>>;
|
|
45
|
-
|
|
46
|
-
declare type IconProps = Omit<ItemProps, 'unstyled'>;
|
|
47
33
|
declare const Icon: react__default.ForwardRefExoticComponent<Omit<IconProps, "ref"> & react__default.RefAttributes<HTMLButtonElement>>;
|
|
48
34
|
|
|
49
|
-
declare const StyledSeparator: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_radix_ui_react_toolbar.ToolbarSeparatorProps & react.RefAttributes<HTMLDivElement>>>,
|
|
35
|
+
declare const StyledSeparator: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<_radix_ui_react_toolbar.ToolbarSeparatorProps & react.RefAttributes<HTMLDivElement>>>, "v1"> & _stitches_react_types_styled_component.TransformProps<{
|
|
36
|
+
v1?: boolean | "true" | undefined;
|
|
37
|
+
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLDivElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_radix_ui_react_toolbar.ToolbarSeparatorProps & react.RefAttributes<HTMLDivElement>>, {
|
|
38
|
+
v1?: boolean | "true" | undefined;
|
|
39
|
+
}, {}>;
|
|
50
40
|
declare type StyledSeparatorProps = StrictComponentProps<typeof StyledSeparator>;
|
|
51
41
|
|
|
52
|
-
interface SeparatorProps extends StyledSeparatorProps {
|
|
42
|
+
interface SeparatorProps extends Omit<StyledSeparatorProps, 'v1'> {
|
|
53
43
|
}
|
|
54
44
|
declare const Separator: react__default.ForwardRefExoticComponent<Omit<SeparatorProps, "ref"> & react__default.RefAttributes<HTMLDivElement>>;
|
|
55
45
|
|
|
56
|
-
declare const StyledLink: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<Omit<
|
|
46
|
+
declare const StyledLink: react.ForwardRefExoticComponent<Omit<Omit<_mirohq_design_system_stitches.StyledComponentProps<react.ForwardRefExoticComponent<Omit<BaseItemProps, "ref"> & react.RefAttributes<HTMLButtonElement>>>, "v1"> & _stitches_react_types_styled_component.TransformProps<{
|
|
47
|
+
v1?: boolean | "true" | "false" | undefined;
|
|
48
|
+
}, {}> & _mirohq_design_system_stitches.CustomStylesProps, "ref"> & react.RefAttributes<HTMLButtonElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<Omit<BaseItemProps, "ref"> & react.RefAttributes<HTMLButtonElement>>, {
|
|
49
|
+
v1?: boolean | "true" | "false" | undefined;
|
|
50
|
+
}, {}>;
|
|
57
51
|
|
|
58
|
-
declare type ItemPropsWithAnchor = Omit<
|
|
52
|
+
declare type ItemPropsWithAnchor = Omit<BaseItemProps, 'ref'> & AnchorHTMLAttributes<typeof StyledLink>;
|
|
59
53
|
interface LinkProps extends ItemPropsWithAnchor {
|
|
60
54
|
}
|
|
61
|
-
declare const Link: react__default.ForwardRefExoticComponent<
|
|
55
|
+
declare const Link: react__default.ForwardRefExoticComponent<LinkProps & react__default.RefAttributes<HTMLAnchorElement>>;
|
|
62
56
|
|
|
63
|
-
interface
|
|
57
|
+
interface ItemProps extends BaseItemProps {
|
|
58
|
+
/**
|
|
59
|
+
* It's applied by default when using with asChild attribute.
|
|
60
|
+
* You can still combine default Item styles with your own component by
|
|
61
|
+
* setting this prop to false.
|
|
62
|
+
* Note: Must be used together with asChild
|
|
63
|
+
* @default true
|
|
64
|
+
*/
|
|
65
|
+
unstyled?: boolean;
|
|
64
66
|
/**
|
|
65
|
-
*
|
|
67
|
+
* Renders item in enabled/toggled state.
|
|
66
68
|
* @default false
|
|
67
69
|
*/
|
|
70
|
+
active?: boolean;
|
|
71
|
+
}
|
|
72
|
+
declare const Item: react__default.ForwardRefExoticComponent<Omit<ItemProps, "ref"> & react__default.RefAttributes<HTMLButtonElement>>;
|
|
73
|
+
|
|
74
|
+
interface ToolbarProps extends Omit<StyledToolbarProps, 'v1'> {
|
|
75
|
+
/**
|
|
76
|
+
* @deprecated Please use variant for non-floating toolbar
|
|
77
|
+
*/
|
|
68
78
|
unstyled?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* When floating, the toolbar has shadow and border to differentiate it from the surface
|
|
81
|
+
* @default floating
|
|
82
|
+
*/
|
|
83
|
+
variant?: StyledToolbarProps['variant'];
|
|
69
84
|
/**
|
|
70
85
|
* The orientation of the toolbar
|
|
71
86
|
* @default 'horizontal'
|
|
@@ -76,11 +91,6 @@ interface ToolbarProps extends StyledToolbarProps {
|
|
|
76
91
|
* @default 'ltr'
|
|
77
92
|
*/
|
|
78
93
|
dir?: 'ltr' | 'rtl';
|
|
79
|
-
/**
|
|
80
|
-
* The reading direction of the toolbar
|
|
81
|
-
* @deprecated use dir instead
|
|
82
|
-
*/
|
|
83
|
-
direction?: 'ltr' | 'rtl';
|
|
84
94
|
/**
|
|
85
95
|
* When true, keyboard navigation will loop from last tab to first, and vice versa
|
|
86
96
|
* @default true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirohq/design-system-toolbar",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0-tag-api-changes.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Miro",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -31,10 +31,12 @@
|
|
|
31
31
|
"@react-aria/interactions": "^3.13.0",
|
|
32
32
|
"@react-aria/utils": "^3.13.0",
|
|
33
33
|
"@react-types/shared": "^3.16.0",
|
|
34
|
-
"@mirohq/design-system-
|
|
34
|
+
"@mirohq/design-system-experiments": "^0.2.0",
|
|
35
35
|
"@mirohq/design-system-styles": "^1.2.25",
|
|
36
36
|
"@mirohq/design-system-use-press": "^0.4.1",
|
|
37
|
-
"@mirohq/design-system-
|
|
37
|
+
"@mirohq/design-system-use-aria-disabled": "^0.2.0-tag-api-changes.0",
|
|
38
|
+
"@mirohq/design-system-utils": "^0.15.4",
|
|
39
|
+
"@mirohq/design-system-stitches": "^2.6.25"
|
|
38
40
|
},
|
|
39
41
|
"scripts": {
|
|
40
42
|
"build": "rollup -c ../../../rollup.config.js",
|