@mirohq/design-system-base-button 0.1.1 → 0.1.2

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 ADDED
@@ -0,0 +1,184 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ var button = require('@react-aria/button');
7
+ var utils = require('@react-aria/utils');
8
+ var link = require('@react-aria/link');
9
+ var focus = require('@react-aria/focus');
10
+ var designSystemPrimitive = require('@mirohq/design-system-primitive');
11
+ var designSystemStitches = require('@mirohq/design-system-stitches');
12
+
13
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
14
+
15
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
16
+
17
+ const focusFilled = {
18
+ "&[data-focused]": {
19
+ boxShadow: `0 0 0 2px var(--colors-blue-20), inset 0 0 0 2px var(--colors-blue-50), inset 0 0 0 3px var(--colors-white)`,
20
+ outline: "none"
21
+ }
22
+ };
23
+ const focusOutline = {
24
+ "&[data-focused]": {
25
+ boxShadow: `0 0 0 2px var(--colors-blue-20), inset 0 0 0 1px var(--colors-blue-50), inset 0 0 0 2px var(--colors-white)`,
26
+ outline: "none",
27
+ borderColor: "$blue-50"
28
+ }
29
+ };
30
+ const activeSelector = "&:active, &[data-pressed]";
31
+ const StyledBaseButton = designSystemStitches.styled(designSystemPrimitive.Primitive.button, {
32
+ all: "unset",
33
+ display: "inline-flex",
34
+ alignItems: "center",
35
+ boxSizing: "border-box",
36
+ borderRadius: "$50",
37
+ cursor: "pointer",
38
+ "&[disabled]": {
39
+ pointerEvents: "none"
40
+ },
41
+ variants: {
42
+ variant: {
43
+ "solid-prominent": {
44
+ backgroundColor: "#3859FF",
45
+ color: "$font-cta-idle",
46
+ ...focusFilled,
47
+ "&:hover": {
48
+ backgroundColor: "#2436B1"
49
+ },
50
+ [activeSelector]: {
51
+ backgroundColor: "$blue-80"
52
+ },
53
+ "&[disabled]": {
54
+ backgroundColor: "$gray-30",
55
+ color: "$gray-50"
56
+ }
57
+ },
58
+ "solid-subtle": {
59
+ backgroundColor: "$gray-20",
60
+ color: "$font-primary",
61
+ ...focusFilled,
62
+ "&:hover": {
63
+ backgroundColor: "$gray-30"
64
+ },
65
+ [activeSelector]: {
66
+ backgroundColor: "$gray-40"
67
+ },
68
+ "&[disabled]": {
69
+ backgroundColor: "$gray-30",
70
+ color: "$gray-50"
71
+ }
72
+ },
73
+ outline: {
74
+ backgroundColor: "$white",
75
+ color: "$font-primary",
76
+ border: "1px solid $gray-50",
77
+ "&:hover": {
78
+ backgroundColor: "$gray-30",
79
+ borderColor: "$indigo-20"
80
+ },
81
+ [activeSelector]: {
82
+ backgroundColor: "$gray-40",
83
+ borderColor: "$indigo-30"
84
+ },
85
+ "&[disabled]": {
86
+ backgroundColor: "$gray-30",
87
+ color: "$gray-50",
88
+ borderColor: "$gray-40"
89
+ },
90
+ ...focusOutline
91
+ },
92
+ ghost: {
93
+ color: "$font-primary",
94
+ backgroundColor: "transparent",
95
+ ...focusFilled,
96
+ "&:hover": {
97
+ backgroundColor: "$gray-30"
98
+ },
99
+ [activeSelector]: {
100
+ backgroundColor: "$gray-40"
101
+ },
102
+ "&[disabled]": {
103
+ color: "$gray-50"
104
+ }
105
+ }
106
+ },
107
+ size: {
108
+ medium: {
109
+ height: "$8",
110
+ paddingX: "$50"
111
+ },
112
+ large: {
113
+ height: "$10",
114
+ paddingX: "$100"
115
+ },
116
+ "x-large": {
117
+ height: "$12",
118
+ paddingX: "$150"
119
+ }
120
+ }
121
+ }
122
+ });
123
+
124
+ const BaseButton = React__default["default"].forwardRef(
125
+ ({
126
+ variant,
127
+ size,
128
+ disabled = false,
129
+ href,
130
+ target,
131
+ rel,
132
+ children,
133
+ onPress,
134
+ onClick,
135
+ asChild,
136
+ ...restProps
137
+ }, forwardRef) => {
138
+ const asLink = href != null;
139
+ const ref = React.useRef(null);
140
+ const refWithFallback = forwardRef != null ? forwardRef : ref;
141
+ const { buttonProps, isPressed } = button.useButton(
142
+ {
143
+ isDisabled: disabled,
144
+ href,
145
+ onPress: onPress != null ? onPress : onClick,
146
+ allowFocusWhenDisabled: false,
147
+ ...restProps
148
+ },
149
+ refWithFallback
150
+ );
151
+ const { linkProps } = link.useLink(
152
+ {
153
+ isDisabled: disabled,
154
+ onPress: onPress != null ? onPress : onClick,
155
+ ...restProps
156
+ },
157
+ refWithFallback
158
+ );
159
+ const elementProps = utils.mergeProps(restProps, asLink ? linkProps : buttonProps);
160
+ const tabIndexProp = disabled && {
161
+ tabIndex: -1
162
+ };
163
+ const { isFocusVisible, focusProps } = focus.useFocusRing();
164
+ return /* @__PURE__ */ React__default["default"].createElement(StyledBaseButton, {
165
+ ...elementProps,
166
+ variant,
167
+ size,
168
+ disabled,
169
+ asChild: asLink || asChild,
170
+ ...tabIndexProp,
171
+ ...focusProps,
172
+ "data-pressed": isPressed ? "" : void 0,
173
+ "data-focused": isFocusVisible ? "" : void 0,
174
+ ref: refWithFallback
175
+ }, asLink ? /* @__PURE__ */ React__default["default"].createElement("a", {
176
+ href,
177
+ target,
178
+ rel: target === "_blank" ? `noopener noreferrer ${rel}` : rel
179
+ }, children) : children);
180
+ }
181
+ );
182
+
183
+ exports.BaseButton = BaseButton;
184
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sources":["../src/base-button.styled.ts","../src/base-button.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\n// todo move to general focus styles (focus-small)\nexport const focusFilled = {\n '&[data-focused]': {\n boxShadow: `0 0 0 2px var(--colors-blue-20), inset 0 0 0 2px var(--colors-blue-50), inset 0 0 0 3px var(--colors-white)`,\n outline: 'none',\n },\n}\n\nexport const focusOutline = {\n '&[data-focused]': {\n boxShadow: `0 0 0 2px var(--colors-blue-20), inset 0 0 0 1px var(--colors-blue-50), inset 0 0 0 2px var(--colors-white)`,\n outline: 'none',\n borderColor: '$blue-50',\n },\n}\n\nconst activeSelector = '&:active, &[data-pressed]'\n\nexport const StyledBaseButton = styled(Primitive.button, {\n all: 'unset',\n display: 'inline-flex',\n alignItems: 'center',\n boxSizing: 'border-box',\n borderRadius: '$50',\n cursor: 'pointer',\n\n '&[disabled]': {\n pointerEvents: 'none',\n },\n\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '#3859FF', // todo after updating color change to 60\n color: '$font-cta-idle',\n ...focusFilled,\n\n '&:hover': {\n backgroundColor: '#2436B1', // todo after updating color change to 80\n },\n [activeSelector]: {\n backgroundColor: '$blue-80', // todo after updating color change to 90\n },\n '&[disabled]': {\n backgroundColor: '$gray-30',\n color: '$gray-50',\n },\n },\n 'solid-subtle': {\n backgroundColor: '$gray-20',\n color: '$font-primary',\n ...focusFilled,\n\n '&:hover': {\n backgroundColor: '$gray-30',\n },\n [activeSelector]: {\n backgroundColor: '$gray-40',\n },\n '&[disabled]': {\n backgroundColor: '$gray-30',\n color: '$gray-50',\n },\n },\n outline: {\n backgroundColor: '$white',\n color: '$font-primary',\n border: '1px solid $gray-50',\n\n '&:hover': {\n backgroundColor: '$gray-30',\n borderColor: '$indigo-20',\n },\n [activeSelector]: {\n backgroundColor: '$gray-40',\n borderColor: '$indigo-30',\n },\n '&[disabled]': {\n backgroundColor: '$gray-30',\n color: '$gray-50',\n borderColor: '$gray-40',\n },\n\n // order is important because of borderColor\n ...focusOutline,\n },\n ghost: {\n color: '$font-primary',\n backgroundColor: 'transparent',\n ...focusFilled,\n\n '&:hover': {\n backgroundColor: '$gray-30',\n },\n [activeSelector]: {\n backgroundColor: '$gray-40',\n },\n '&[disabled]': {\n color: '$gray-50',\n },\n },\n },\n size: {\n medium: {\n height: '$8',\n paddingX: '$50',\n },\n large: {\n height: '$10',\n paddingX: '$100',\n },\n 'x-large': {\n height: '$12',\n paddingX: '$150',\n },\n },\n },\n})\n\nexport type StyledBaseButtonProps = ComponentPropsWithRef<\n typeof StyledBaseButton\n>\n","import React, { useRef } from 'react'\nimport type { ElementRef, ReactNode } from 'react'\nimport type { ScaleProp } from '@mirohq/design-system-types'\nimport { useButton } from '@react-aria/button'\nimport type { AriaButtonProps } from '@react-types/button'\nimport { mergeProps } from '@react-aria/utils'\nimport { useLink } from '@react-aria/link'\nimport { useFocusRing } from '@react-aria/focus'\n\nimport type { StyledBaseButtonProps } from './base-button.styled'\nimport { StyledBaseButton } from './base-button.styled'\n\ntype ButtonPropsA11y = StyledBaseButtonProps & AriaButtonProps\n\nexport interface BaseButtonProps\n extends Omit<ButtonPropsA11y, 'onClick' | 'isDisabled' | 'elementType'> {\n /**\n * The content\n */\n children: ReactNode\n\n /**\n * Change the button style\n */\n variant?: StyledBaseButtonProps['variant']\n\n /**\n * Change the button size\n */\n size?: ScaleProp<StyledBaseButtonProps['size']>\n\n /**\n * Prevent pointer events\n */\n disabled?: boolean\n\n /**\n * A URL to link when using the button as a link\n */\n href?: string\n\n /**\n * The target window using the button as a link\n */\n target?: string\n\n /**\n * The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel)\n */\n rel?: string\n\n /**\n * Alias for onPress\n */\n onClick?: AriaButtonProps['onPress']\n}\n\nexport const BaseButton = React.forwardRef<\n ElementRef<typeof StyledBaseButton>,\n BaseButtonProps\n>(\n (\n {\n variant,\n size,\n disabled = false,\n href,\n target,\n rel,\n children,\n onPress,\n onClick,\n asChild,\n ...restProps\n },\n forwardRef\n ) => {\n const asLink = href != null\n\n const ref = useRef<HTMLButtonElement | HTMLAnchorElement>(null)\n const refWithFallback = forwardRef ?? ref\n const { buttonProps, isPressed } = useButton(\n {\n isDisabled: disabled,\n href,\n onPress: onPress ?? onClick,\n // @ts-expect-error\n allowFocusWhenDisabled: false,\n ...restProps,\n },\n refWithFallback\n )\n\n const { linkProps } = useLink(\n {\n isDisabled: disabled,\n onPress: onPress ?? onClick,\n ...restProps,\n },\n // @ts-expect-error\n refWithFallback\n )\n\n const elementProps = mergeProps(restProps, asLink ? linkProps : buttonProps)\n\n const tabIndexProp = disabled && {\n tabIndex: -1,\n }\n\n const { isFocusVisible, focusProps } = useFocusRing()\n\n return (\n <StyledBaseButton\n {...elementProps}\n variant={variant}\n size={size}\n disabled={disabled}\n asChild={asLink || asChild}\n {...tabIndexProp}\n {...focusProps}\n data-pressed={isPressed ? '' : undefined}\n data-focused={isFocusVisible ? '' : undefined}\n // @ts-expect-error\n ref={refWithFallback}\n >\n {asLink ? (\n <a\n href={href}\n target={target}\n rel={target === '_blank' ? `noopener noreferrer ${rel}` : rel}\n >\n {children}\n </a>\n ) : (\n children\n )}\n </StyledBaseButton>\n )\n }\n)\n"],"names":["styled","Primitive","React","useRef","useButton","useLink","mergeProps","useFocusRing"],"mappings":";;;;;;;;;;;;;;;;AAKO,MAAM,WAAc,GAAA;AAAA,EACzB,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,CAAA,2GAAA,CAAA;AAAA,IACX,OAAS,EAAA,MAAA;AAAA,GACX;AACF,CAAA,CAAA;AAEO,MAAM,YAAe,GAAA;AAAA,EAC1B,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,CAAA,2GAAA,CAAA;AAAA,IACX,OAAS,EAAA,MAAA;AAAA,IACT,WAAa,EAAA,UAAA;AAAA,GACf;AACF,CAAA,CAAA;AAEA,MAAM,cAAiB,GAAA,2BAAA,CAAA;AAEV,MAAA,gBAAA,GAAmBA,2BAAO,CAAAC,+BAAA,CAAU,MAAQ,EAAA;AAAA,EACvD,GAAK,EAAA,OAAA;AAAA,EACL,OAAS,EAAA,aAAA;AAAA,EACT,UAAY,EAAA,QAAA;AAAA,EACZ,SAAW,EAAA,YAAA;AAAA,EACX,YAAc,EAAA,KAAA;AAAA,EACd,MAAQ,EAAA,SAAA;AAAA,EAER,aAAe,EAAA;AAAA,IACb,aAAe,EAAA,MAAA;AAAA,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AA,QACH,IAEA,QAEJ,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
package/dist/module.js ADDED
@@ -0,0 +1,176 @@
1
+ import React, { useRef } from 'react';
2
+ import { useButton } from '@react-aria/button';
3
+ import { mergeProps } from '@react-aria/utils';
4
+ import { useLink } from '@react-aria/link';
5
+ import { useFocusRing } from '@react-aria/focus';
6
+ import { Primitive } from '@mirohq/design-system-primitive';
7
+ import { styled } from '@mirohq/design-system-stitches';
8
+
9
+ const focusFilled = {
10
+ "&[data-focused]": {
11
+ boxShadow: `0 0 0 2px var(--colors-blue-20), inset 0 0 0 2px var(--colors-blue-50), inset 0 0 0 3px var(--colors-white)`,
12
+ outline: "none"
13
+ }
14
+ };
15
+ const focusOutline = {
16
+ "&[data-focused]": {
17
+ boxShadow: `0 0 0 2px var(--colors-blue-20), inset 0 0 0 1px var(--colors-blue-50), inset 0 0 0 2px var(--colors-white)`,
18
+ outline: "none",
19
+ borderColor: "$blue-50"
20
+ }
21
+ };
22
+ const activeSelector = "&:active, &[data-pressed]";
23
+ const StyledBaseButton = styled(Primitive.button, {
24
+ all: "unset",
25
+ display: "inline-flex",
26
+ alignItems: "center",
27
+ boxSizing: "border-box",
28
+ borderRadius: "$50",
29
+ cursor: "pointer",
30
+ "&[disabled]": {
31
+ pointerEvents: "none"
32
+ },
33
+ variants: {
34
+ variant: {
35
+ "solid-prominent": {
36
+ backgroundColor: "#3859FF",
37
+ color: "$font-cta-idle",
38
+ ...focusFilled,
39
+ "&:hover": {
40
+ backgroundColor: "#2436B1"
41
+ },
42
+ [activeSelector]: {
43
+ backgroundColor: "$blue-80"
44
+ },
45
+ "&[disabled]": {
46
+ backgroundColor: "$gray-30",
47
+ color: "$gray-50"
48
+ }
49
+ },
50
+ "solid-subtle": {
51
+ backgroundColor: "$gray-20",
52
+ color: "$font-primary",
53
+ ...focusFilled,
54
+ "&:hover": {
55
+ backgroundColor: "$gray-30"
56
+ },
57
+ [activeSelector]: {
58
+ backgroundColor: "$gray-40"
59
+ },
60
+ "&[disabled]": {
61
+ backgroundColor: "$gray-30",
62
+ color: "$gray-50"
63
+ }
64
+ },
65
+ outline: {
66
+ backgroundColor: "$white",
67
+ color: "$font-primary",
68
+ border: "1px solid $gray-50",
69
+ "&:hover": {
70
+ backgroundColor: "$gray-30",
71
+ borderColor: "$indigo-20"
72
+ },
73
+ [activeSelector]: {
74
+ backgroundColor: "$gray-40",
75
+ borderColor: "$indigo-30"
76
+ },
77
+ "&[disabled]": {
78
+ backgroundColor: "$gray-30",
79
+ color: "$gray-50",
80
+ borderColor: "$gray-40"
81
+ },
82
+ ...focusOutline
83
+ },
84
+ ghost: {
85
+ color: "$font-primary",
86
+ backgroundColor: "transparent",
87
+ ...focusFilled,
88
+ "&:hover": {
89
+ backgroundColor: "$gray-30"
90
+ },
91
+ [activeSelector]: {
92
+ backgroundColor: "$gray-40"
93
+ },
94
+ "&[disabled]": {
95
+ color: "$gray-50"
96
+ }
97
+ }
98
+ },
99
+ size: {
100
+ medium: {
101
+ height: "$8",
102
+ paddingX: "$50"
103
+ },
104
+ large: {
105
+ height: "$10",
106
+ paddingX: "$100"
107
+ },
108
+ "x-large": {
109
+ height: "$12",
110
+ paddingX: "$150"
111
+ }
112
+ }
113
+ }
114
+ });
115
+
116
+ const BaseButton = React.forwardRef(
117
+ ({
118
+ variant,
119
+ size,
120
+ disabled = false,
121
+ href,
122
+ target,
123
+ rel,
124
+ children,
125
+ onPress,
126
+ onClick,
127
+ asChild,
128
+ ...restProps
129
+ }, forwardRef) => {
130
+ const asLink = href != null;
131
+ const ref = useRef(null);
132
+ const refWithFallback = forwardRef != null ? forwardRef : ref;
133
+ const { buttonProps, isPressed } = useButton(
134
+ {
135
+ isDisabled: disabled,
136
+ href,
137
+ onPress: onPress != null ? onPress : onClick,
138
+ allowFocusWhenDisabled: false,
139
+ ...restProps
140
+ },
141
+ refWithFallback
142
+ );
143
+ const { linkProps } = useLink(
144
+ {
145
+ isDisabled: disabled,
146
+ onPress: onPress != null ? onPress : onClick,
147
+ ...restProps
148
+ },
149
+ refWithFallback
150
+ );
151
+ const elementProps = mergeProps(restProps, asLink ? linkProps : buttonProps);
152
+ const tabIndexProp = disabled && {
153
+ tabIndex: -1
154
+ };
155
+ const { isFocusVisible, focusProps } = useFocusRing();
156
+ return /* @__PURE__ */ React.createElement(StyledBaseButton, {
157
+ ...elementProps,
158
+ variant,
159
+ size,
160
+ disabled,
161
+ asChild: asLink || asChild,
162
+ ...tabIndexProp,
163
+ ...focusProps,
164
+ "data-pressed": isPressed ? "" : void 0,
165
+ "data-focused": isFocusVisible ? "" : void 0,
166
+ ref: refWithFallback
167
+ }, asLink ? /* @__PURE__ */ React.createElement("a", {
168
+ href,
169
+ target,
170
+ rel: target === "_blank" ? `noopener noreferrer ${rel}` : rel
171
+ }, children) : children);
172
+ }
173
+ );
174
+
175
+ export { BaseButton };
176
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sources":["../src/base-button.styled.ts","../src/base-button.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\n\n// todo move to general focus styles (focus-small)\nexport const focusFilled = {\n '&[data-focused]': {\n boxShadow: `0 0 0 2px var(--colors-blue-20), inset 0 0 0 2px var(--colors-blue-50), inset 0 0 0 3px var(--colors-white)`,\n outline: 'none',\n },\n}\n\nexport const focusOutline = {\n '&[data-focused]': {\n boxShadow: `0 0 0 2px var(--colors-blue-20), inset 0 0 0 1px var(--colors-blue-50), inset 0 0 0 2px var(--colors-white)`,\n outline: 'none',\n borderColor: '$blue-50',\n },\n}\n\nconst activeSelector = '&:active, &[data-pressed]'\n\nexport const StyledBaseButton = styled(Primitive.button, {\n all: 'unset',\n display: 'inline-flex',\n alignItems: 'center',\n boxSizing: 'border-box',\n borderRadius: '$50',\n cursor: 'pointer',\n\n '&[disabled]': {\n pointerEvents: 'none',\n },\n\n variants: {\n variant: {\n 'solid-prominent': {\n backgroundColor: '#3859FF', // todo after updating color change to 60\n color: '$font-cta-idle',\n ...focusFilled,\n\n '&:hover': {\n backgroundColor: '#2436B1', // todo after updating color change to 80\n },\n [activeSelector]: {\n backgroundColor: '$blue-80', // todo after updating color change to 90\n },\n '&[disabled]': {\n backgroundColor: '$gray-30',\n color: '$gray-50',\n },\n },\n 'solid-subtle': {\n backgroundColor: '$gray-20',\n color: '$font-primary',\n ...focusFilled,\n\n '&:hover': {\n backgroundColor: '$gray-30',\n },\n [activeSelector]: {\n backgroundColor: '$gray-40',\n },\n '&[disabled]': {\n backgroundColor: '$gray-30',\n color: '$gray-50',\n },\n },\n outline: {\n backgroundColor: '$white',\n color: '$font-primary',\n border: '1px solid $gray-50',\n\n '&:hover': {\n backgroundColor: '$gray-30',\n borderColor: '$indigo-20',\n },\n [activeSelector]: {\n backgroundColor: '$gray-40',\n borderColor: '$indigo-30',\n },\n '&[disabled]': {\n backgroundColor: '$gray-30',\n color: '$gray-50',\n borderColor: '$gray-40',\n },\n\n // order is important because of borderColor\n ...focusOutline,\n },\n ghost: {\n color: '$font-primary',\n backgroundColor: 'transparent',\n ...focusFilled,\n\n '&:hover': {\n backgroundColor: '$gray-30',\n },\n [activeSelector]: {\n backgroundColor: '$gray-40',\n },\n '&[disabled]': {\n color: '$gray-50',\n },\n },\n },\n size: {\n medium: {\n height: '$8',\n paddingX: '$50',\n },\n large: {\n height: '$10',\n paddingX: '$100',\n },\n 'x-large': {\n height: '$12',\n paddingX: '$150',\n },\n },\n },\n})\n\nexport type StyledBaseButtonProps = ComponentPropsWithRef<\n typeof StyledBaseButton\n>\n","import React, { useRef } from 'react'\nimport type { ElementRef, ReactNode } from 'react'\nimport type { ScaleProp } from '@mirohq/design-system-types'\nimport { useButton } from '@react-aria/button'\nimport type { AriaButtonProps } from '@react-types/button'\nimport { mergeProps } from '@react-aria/utils'\nimport { useLink } from '@react-aria/link'\nimport { useFocusRing } from '@react-aria/focus'\n\nimport type { StyledBaseButtonProps } from './base-button.styled'\nimport { StyledBaseButton } from './base-button.styled'\n\ntype ButtonPropsA11y = StyledBaseButtonProps & AriaButtonProps\n\nexport interface BaseButtonProps\n extends Omit<ButtonPropsA11y, 'onClick' | 'isDisabled' | 'elementType'> {\n /**\n * The content\n */\n children: ReactNode\n\n /**\n * Change the button style\n */\n variant?: StyledBaseButtonProps['variant']\n\n /**\n * Change the button size\n */\n size?: ScaleProp<StyledBaseButtonProps['size']>\n\n /**\n * Prevent pointer events\n */\n disabled?: boolean\n\n /**\n * A URL to link when using the button as a link\n */\n href?: string\n\n /**\n * The target window using the button as a link\n */\n target?: string\n\n /**\n * The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel)\n */\n rel?: string\n\n /**\n * Alias for onPress\n */\n onClick?: AriaButtonProps['onPress']\n}\n\nexport const BaseButton = React.forwardRef<\n ElementRef<typeof StyledBaseButton>,\n BaseButtonProps\n>(\n (\n {\n variant,\n size,\n disabled = false,\n href,\n target,\n rel,\n children,\n onPress,\n onClick,\n asChild,\n ...restProps\n },\n forwardRef\n ) => {\n const asLink = href != null\n\n const ref = useRef<HTMLButtonElement | HTMLAnchorElement>(null)\n const refWithFallback = forwardRef ?? ref\n const { buttonProps, isPressed } = useButton(\n {\n isDisabled: disabled,\n href,\n onPress: onPress ?? onClick,\n // @ts-expect-error\n allowFocusWhenDisabled: false,\n ...restProps,\n },\n refWithFallback\n )\n\n const { linkProps } = useLink(\n {\n isDisabled: disabled,\n onPress: onPress ?? onClick,\n ...restProps,\n },\n // @ts-expect-error\n refWithFallback\n )\n\n const elementProps = mergeProps(restProps, asLink ? linkProps : buttonProps)\n\n const tabIndexProp = disabled && {\n tabIndex: -1,\n }\n\n const { isFocusVisible, focusProps } = useFocusRing()\n\n return (\n <StyledBaseButton\n {...elementProps}\n variant={variant}\n size={size}\n disabled={disabled}\n asChild={asLink || asChild}\n {...tabIndexProp}\n {...focusProps}\n data-pressed={isPressed ? '' : undefined}\n data-focused={isFocusVisible ? '' : undefined}\n // @ts-expect-error\n ref={refWithFallback}\n >\n {asLink ? (\n <a\n href={href}\n target={target}\n rel={target === '_blank' ? `noopener noreferrer ${rel}` : rel}\n >\n {children}\n </a>\n ) : (\n children\n )}\n </StyledBaseButton>\n )\n }\n)\n"],"names":[],"mappings":";;;;;;;;AAKO,MAAM,WAAc,GAAA;AAAA,EACzB,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,CAAA,2GAAA,CAAA;AAAA,IACX,OAAS,EAAA,MAAA;AAAA,GACX;AACF,CAAA,CAAA;AAEO,MAAM,YAAe,GAAA;AAAA,EAC1B,iBAAmB,EAAA;AAAA,IACjB,SAAW,EAAA,CAAA,2GAAA,CAAA;AAAA,IACX,OAAS,EAAA,MAAA;AAAA,IACT,WAAa,EAAA,UAAA;AAAA,GACf;AACF,CAAA,CAAA;AAEA,MAAM,cAAiB,GAAA,2BAAA,CAAA;AAEV,MAAA,gBAAA,GAAmB,MAAO,CAAA,SAAA,CAAU,MAAQ,EAAA;AAAA,EACvD,GAAK,EAAA,OAAA;AAAA,EACL,OAAS,EAAA,aAAA;AAAA,EACT,UAAY,EAAA,QAAA;AAAA,EACZ,SAAW,EAAA,YAAA;AAAA,EACX,YAAc,EAAA,KAAA;AAAA,EACd,MAAQ,EAAA,SAAA;AAAA,EAER,aAAe,EAAA;AAAA,IACb,aAAe,EAAA,MAAA;AAAA,GACjB;AAAA,EAEA,QAAU,EAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP,iBAAmB,EAAA;AAAA,QACjB,eAAiB,EAAA,SAAA;AAAA,QACjB,KAAO,EAAA,gBAAA;AAAA,QACP,GAAG,WAAA;AAAA,QAEH,SAAW,EAAA;AAAA,UACT,eAAiB,EAAA,SAAA;AAAA,SACnB;AAAA,QACA,CAAC,cAAiB,GAAA;AAAA,UAChB,eAAiB,EAAA,UAAA;AAAA,SACnB;AAAA,QACA,aAAe,EAAA;AAAA,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pB,GAAG,SAAA;AAAA,OACL;AAAA,MAEA,eAAA;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,YAAe,GAAA,UAAA,CAAW,SAAW,EAAA,MAAA,GAAS,YAAY,WAAW,CAAA,CAAA;AAE3E,IAAA,MAAM,eAAe,QAAY,IAAA;AAAA,MAC/B,QAAU,EAAA,CAAA,CAAA;AAAA,KACZ,CAAA;AAEA,IAAA,MAAM,EAAE,cAAA,EAAgB,UAAW,EAAA,GAAI,YAAa,EAAA,CAAA;AAEpD,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,gBAAA,EAAA;AAAA,MACE,GAAG,YAAA;AAAA,MACJ,OAAA;AAAA,MACA,IAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAS,MAAU,IAAA,OAAA;AAAA,MAClB,GAAG,YAAA;AAAA,MACH,GAAG,UAAA;AAAA,MACJ,cAAA,EAAc,YAAY,EAAK,GAAA,KAAA,CAAA;AAAA,MAC/B,cAAA,EAAc,iBAAiB,EAAK,GAAA,KAAA,CAAA;AAAA,MAEpC,GAAK,EAAA,eAAA;AAAA,KAAA,EAEJ,yBACE,KAAA,CAAA,aAAA,CAAA,GAAA,EAAA;AAAA,MACC,IAAA;AAAA,MACA,MAAA;AAAA,MACA,GAAK,EAAA,MAAA,KAAW,QAAW,GAAA,CAAA,oBAAA,EAAuB,GAAQ,CAAA,CAAA,GAAA,GAAA;AAAA,KAEzD,EAAA,QACH,IAEA,QAEJ,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
@@ -0,0 +1,403 @@
1
+ import * as react from 'react';
2
+ import react__default, { ComponentPropsWithRef, ReactNode } from 'react';
3
+ import { ScaleProp } from '@mirohq/design-system-types';
4
+ import { AriaButtonProps } from '@react-types/button';
5
+ import * as _mirohq_design_system_stitches from '@mirohq/design-system-stitches';
6
+ import * as _stitches_react_types_css_util from '@stitches/react/types/css-util';
7
+ import * as _mirohq_design_system_primitive from '@mirohq/design-system-primitive';
8
+ import * as _stitches_react_types_styled_component from '@stitches/react/types/styled-component';
9
+
10
+ declare const StyledBaseButton: react.ForwardRefExoticComponent<Pick<Omit<{
11
+ variant?: "outline" | "solid-prominent" | "solid-subtle" | "ghost" | undefined;
12
+ size?: "medium" | "large" | "x-large" | undefined;
13
+ }, "size" | "variant"> & _stitches_react_types_styled_component.TransformProps<{
14
+ variant?: "outline" | "solid-prominent" | "solid-subtle" | "ghost" | undefined;
15
+ size?: "medium" | "large" | "x-large" | undefined;
16
+ }, {}> & _mirohq_design_system_stitches.StyledComponentProps<_stitches_react_types_styled_component.StyledComponent<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>, {}, {}, _stitches_react_types_css_util.CSS<{}, {
17
+ 'border-widths': {
18
+ readonly none: 0;
19
+ readonly sm: "1px";
20
+ readonly md: "2px";
21
+ readonly lg: "4px";
22
+ };
23
+ colors: {
24
+ readonly black: any;
25
+ readonly 'blue-10': any;
26
+ readonly 'blue-20': any;
27
+ readonly 'blue-50': any;
28
+ readonly 'blue-60': any;
29
+ readonly 'blue-70': any;
30
+ readonly 'blue-80': any;
31
+ readonly 'gray-20': any;
32
+ readonly 'gray-30': any;
33
+ readonly 'gray-40': any;
34
+ readonly 'gray-50': any;
35
+ readonly 'green-70': any;
36
+ readonly 'indigo-20': any;
37
+ readonly 'indigo-30': any;
38
+ readonly 'indigo-50': any;
39
+ readonly 'indigo-70': any;
40
+ readonly 'indigo-90': any;
41
+ readonly 'pink-20': any;
42
+ readonly 'pink-50': any;
43
+ readonly 'red-10': any;
44
+ readonly 'red-20': any;
45
+ readonly 'red-30': any;
46
+ readonly 'red-50': any;
47
+ readonly 'red-60': any;
48
+ readonly transparent: any;
49
+ readonly white: any;
50
+ readonly 'yellow-20': any;
51
+ readonly 'yellow-60': any;
52
+ readonly 'background-cta-active'?: any;
53
+ readonly 'background-cta-disabled'?: any;
54
+ readonly 'background-cta-hover'?: any;
55
+ readonly 'background-cta-idle'?: any;
56
+ readonly 'background-danger-active'?: any;
57
+ readonly 'background-danger-hover'?: any;
58
+ readonly 'background-danger-idle'?: any;
59
+ readonly 'background-default-active'?: any;
60
+ readonly 'background-default-disabled'?: any;
61
+ readonly 'background-default-hover'?: any;
62
+ readonly 'background-default-idle'?: any;
63
+ readonly 'background-default-selected'?: any;
64
+ readonly 'background-default-selected-active'?: any;
65
+ readonly 'background-info-idle'?: any;
66
+ readonly 'background-primary'?: any;
67
+ readonly 'background-secondary'?: any;
68
+ readonly 'background-success-idle'?: any;
69
+ readonly 'background-warning-idle'?: any;
70
+ readonly 'border-cta-idle'?: any;
71
+ readonly 'border-default-active'?: any;
72
+ readonly 'border-default-error'?: any;
73
+ readonly 'border-default-hover'?: any;
74
+ readonly 'border-default-idle'?: any;
75
+ readonly 'border-default-selected'?: any;
76
+ readonly 'canvas-primary'?: any;
77
+ readonly 'divider-default'?: any;
78
+ readonly 'focus-ring-default'?: any;
79
+ readonly 'font-cta-idle'?: any;
80
+ readonly 'font-default-active'?: any;
81
+ readonly 'font-default-disabled'?: any;
82
+ readonly 'font-default-error'?: any;
83
+ readonly 'font-default-hover'?: any;
84
+ readonly 'font-default-idle'?: any;
85
+ readonly 'font-default-selected'?: any;
86
+ readonly 'font-default-visited'?: any;
87
+ readonly 'font-primary'?: any;
88
+ readonly 'font-secondary'?: any;
89
+ readonly 'font-tertiary'?: any;
90
+ readonly 'icon-cta-idle'?: any;
91
+ readonly 'icon-default'?: any;
92
+ readonly 'icon-default-active'?: any;
93
+ readonly 'icon-default-disabled'?: any;
94
+ readonly 'icon-default-error'?: any;
95
+ readonly 'icon-default-hover'?: any;
96
+ readonly 'icon-default-idle'?: any;
97
+ readonly 'icon-default-selected'?: any;
98
+ };
99
+ 'font-sizes': {
100
+ readonly 150: "0.75rem";
101
+ readonly 175: "0.875rem";
102
+ readonly 200: "1rem";
103
+ readonly 225: "1.125rem";
104
+ readonly 250: "1.25rem";
105
+ readonly 300: "1.5rem";
106
+ readonly 400: "2rem";
107
+ readonly 500: "2.5rem";
108
+ readonly 600: "3rem";
109
+ readonly 800: "4rem";
110
+ readonly 900: "4.5rem";
111
+ };
112
+ radii: {
113
+ readonly none: 0;
114
+ readonly half: "999em";
115
+ readonly 25: "2px";
116
+ readonly 50: "4px";
117
+ readonly 75: "6px";
118
+ readonly 100: "8px";
119
+ readonly 200: "16px";
120
+ };
121
+ shadows: {
122
+ readonly 50: "0 4px 16px #05003812";
123
+ readonly 100: "0 8px 32px #05003808";
124
+ };
125
+ sizes: {
126
+ readonly number: string;
127
+ readonly 'icon-200': "16px";
128
+ readonly 'icon-300': "24px";
129
+ readonly 'icon-400': "32px";
130
+ };
131
+ space: {
132
+ readonly none: 0;
133
+ readonly 50: "4px";
134
+ readonly 100: "8px";
135
+ readonly 150: "12px";
136
+ readonly 200: "16px";
137
+ readonly 300: "24px";
138
+ readonly 400: "32px";
139
+ readonly 500: "64px";
140
+ readonly 600: "48px";
141
+ readonly 800: "64px";
142
+ readonly 1200: "96px";
143
+ readonly 1600: "128px";
144
+ };
145
+ 'space-gap': {
146
+ readonly none: any;
147
+ readonly 50: any;
148
+ readonly 100: any;
149
+ readonly 200: any;
150
+ readonly 300: any;
151
+ };
152
+ 'space-inset': {
153
+ readonly none: any;
154
+ readonly 50: any;
155
+ readonly 100: any;
156
+ readonly 150: any;
157
+ readonly 200: any;
158
+ readonly 300: any;
159
+ readonly 400: any;
160
+ readonly 600: any;
161
+ readonly 800: any;
162
+ readonly 1200: any;
163
+ readonly 1600: any;
164
+ };
165
+ 'space-offset': {
166
+ readonly none: any;
167
+ readonly 50: any;
168
+ readonly 100: any;
169
+ readonly 150: any;
170
+ readonly 200: any;
171
+ readonly 300: any;
172
+ readonly 400: any;
173
+ readonly 600: any;
174
+ readonly 800: any;
175
+ readonly 1200: any;
176
+ readonly 1600: any;
177
+ readonly 'stacking-none': any;
178
+ readonly 'stacking-100': any;
179
+ readonly 'stacking-200': any;
180
+ readonly 'stacking-300': any;
181
+ readonly 'stacking-400': any;
182
+ readonly 'stacking-500': any;
183
+ readonly 'stacking-800': any;
184
+ };
185
+ 'z-indices': {
186
+ readonly dropdownMenu: 100;
187
+ readonly popover: 200;
188
+ readonly tooltip: 300;
189
+ };
190
+ }, {
191
+ readonly background: "colors";
192
+ readonly backgroundColor: "colors";
193
+ readonly backgroundImage: "colors";
194
+ readonly blockSize: "sizes";
195
+ readonly border: "colors";
196
+ readonly borderBlock: "colors";
197
+ readonly borderBlockEnd: "colors";
198
+ readonly borderBlockStart: "colors";
199
+ readonly borderBottom: "colors";
200
+ readonly borderBottomColor: "colors";
201
+ readonly borderBottomLeftRadius: "radii";
202
+ readonly borderBottomRightRadius: "radii";
203
+ readonly borderBottomStyle: "border-styles";
204
+ readonly borderBottomWidth: "border-widths";
205
+ readonly borderColor: "colors";
206
+ readonly borderImage: "colors";
207
+ readonly borderInline: "colors";
208
+ readonly borderInlineEnd: "colors";
209
+ readonly borderInlineStart: "colors";
210
+ readonly borderLeft: "colors";
211
+ readonly borderLeftColor: "colors";
212
+ readonly borderLeftStyle: "border-styles";
213
+ readonly borderLeftWidth: "border-widths";
214
+ readonly borderRadius: "radii";
215
+ readonly borderRight: "colors";
216
+ readonly borderRightColor: "colors";
217
+ readonly borderRightStyle: "border-styles";
218
+ readonly borderRightWidth: "border-widths";
219
+ readonly borderStyle: "border-styles";
220
+ readonly borderTop: "colors";
221
+ readonly borderTopColor: "colors";
222
+ readonly borderTopLeftRadius: "radii";
223
+ readonly borderTopRightRadius: "radii";
224
+ readonly borderTopStyle: "border-styles";
225
+ readonly borderTopWidth: "border-widths";
226
+ readonly borderWidth: "border-widths";
227
+ readonly bottom: "space";
228
+ readonly boxShadow: "shadows";
229
+ readonly caretColor: "colors";
230
+ readonly color: "colors";
231
+ readonly columnGap: "space-gap";
232
+ readonly columnRuleColor: "colors";
233
+ readonly fill: "colors";
234
+ readonly flexBasis: "sizes";
235
+ readonly fontFamily: "fonts";
236
+ readonly fontSize: "font-sizes";
237
+ readonly fontWeight: "font-weights";
238
+ readonly gap: "space-gap";
239
+ readonly gridColumnGap: "space-gap";
240
+ readonly gridGap: "space-gap";
241
+ readonly gridRowGap: "space-gap";
242
+ readonly gridTemplateColumns: "sizes";
243
+ readonly gridTemplateRows: "sizes";
244
+ readonly height: "sizes";
245
+ readonly inlineSize: "sizes";
246
+ readonly inset: "space-inset";
247
+ readonly insetBlock: "space-inset";
248
+ readonly insetBlockEnd: "space-inset";
249
+ readonly insetBlockStart: "space-inset";
250
+ readonly insetInline: "space-inset";
251
+ readonly insetInlineEnd: "space-inset";
252
+ readonly insetInlineStart: "space-inset";
253
+ readonly left: "space";
254
+ readonly letterSpacing: "letter-spacings";
255
+ readonly lineHeight: "line-heights";
256
+ readonly margin: "space-offset";
257
+ readonly marginBlock: "space-offset";
258
+ readonly marginBlockEnd: "space-offset";
259
+ readonly marginBlockStart: "space-offset";
260
+ readonly marginBottom: "space-offset";
261
+ readonly marginInline: "space-offset";
262
+ readonly marginInlineEnd: "space-offset";
263
+ readonly marginInlineStart: "space-offset";
264
+ readonly marginLeft: "space-offset";
265
+ readonly marginRight: "space-offset";
266
+ readonly marginTop: "space-offset";
267
+ readonly maxBlockSize: "sizes";
268
+ readonly maxHeight: "sizes";
269
+ readonly maxInlineSize: "sizes";
270
+ readonly maxWidth: "sizes";
271
+ readonly minBlockSize: "sizes";
272
+ readonly minHeight: "sizes";
273
+ readonly minInlineSize: "sizes";
274
+ readonly minWidth: "sizes";
275
+ readonly outline: "colors";
276
+ readonly outlineColor: "colors";
277
+ readonly padding: "space-inset";
278
+ readonly paddingBlock: "space-inset";
279
+ readonly paddingBlockEnd: "space-inset";
280
+ readonly paddingBlockStart: "space-inset";
281
+ readonly paddingBottom: "space-inset";
282
+ readonly paddingInline: "space-inset";
283
+ readonly paddingInlineEnd: "space-inset";
284
+ readonly paddingInlineStart: "space-inset";
285
+ readonly paddingLeft: "space-inset";
286
+ readonly paddingRight: "space-inset";
287
+ readonly paddingTop: "space-inset";
288
+ readonly right: "space";
289
+ readonly rowGap: "space-gap";
290
+ readonly scrollMargin: "space-offset";
291
+ readonly scrollMarginBlock: "space-offset";
292
+ readonly scrollMarginBlockEnd: "space-offset";
293
+ readonly scrollMarginBlockStart: "space-offset";
294
+ readonly scrollMarginBottom: "space-offset";
295
+ readonly scrollMarginInline: "space-offset";
296
+ readonly scrollMarginInlineEnd: "space-offset";
297
+ readonly scrollMarginInlineStart: "space-offset";
298
+ readonly scrollMarginLeft: "space-offset";
299
+ readonly scrollMarginRight: "space-offset";
300
+ readonly scrollMarginTop: "space-offset";
301
+ readonly scrollPadding: "space-inset";
302
+ readonly scrollPaddingBlock: "space-inset";
303
+ readonly scrollPaddingBlockEnd: "space-inset";
304
+ readonly scrollPaddingBlockStart: "space-inset";
305
+ readonly scrollPaddingBottom: "space-inset";
306
+ readonly scrollPaddingInline: "space-inset";
307
+ readonly scrollPaddingInlineEnd: "space-inset";
308
+ readonly scrollPaddingInlineStart: "space-inset";
309
+ readonly scrollPaddingLeft: "space-inset";
310
+ readonly scrollPaddingRight: "space-inset";
311
+ readonly scrollPaddingTop: "space-inset";
312
+ readonly stroke: "colors";
313
+ readonly textDecorationColor: "colors";
314
+ readonly textShadow: "shadows";
315
+ readonly top: "space";
316
+ readonly transition: "transitions";
317
+ readonly width: "sizes";
318
+ readonly zIndex: "z-indices";
319
+ }, {
320
+ paddingX: (value: {
321
+ readonly [$$PropertyValue]: "padding";
322
+ }) => {
323
+ paddingLeft: {
324
+ readonly [$$PropertyValue]: "padding";
325
+ };
326
+ paddingRight: {
327
+ readonly [$$PropertyValue]: "padding";
328
+ };
329
+ };
330
+ paddingY: (value: {
331
+ readonly [$$PropertyValue]: "padding";
332
+ }) => {
333
+ paddingTop: {
334
+ readonly [$$PropertyValue]: "padding";
335
+ };
336
+ paddingBottom: {
337
+ readonly [$$PropertyValue]: "padding";
338
+ };
339
+ };
340
+ marginX: (value: {
341
+ readonly [$$PropertyValue]: "margin";
342
+ }) => {
343
+ marginLeft: {
344
+ readonly [$$PropertyValue]: "margin";
345
+ };
346
+ marginRight: {
347
+ readonly [$$PropertyValue]: "margin";
348
+ };
349
+ };
350
+ marginY: (value: {
351
+ readonly [$$PropertyValue]: "margin";
352
+ }) => {
353
+ marginTop: {
354
+ readonly [$$PropertyValue]: "margin";
355
+ };
356
+ marginBottom: {
357
+ readonly [$$PropertyValue]: "margin";
358
+ };
359
+ };
360
+ }>>> & _mirohq_design_system_stitches.CustomStylesProps, "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "size" | "asChild" | keyof _mirohq_design_system_stitches.CustomStylesProps | "variant"> & react.RefAttributes<HTMLButtonElement>> & _mirohq_design_system_stitches.StitchesInternals<react.ForwardRefExoticComponent<_mirohq_design_system_primitive.PrimitiveProps<"button">>, {
361
+ variant?: "outline" | "solid-prominent" | "solid-subtle" | "ghost" | undefined;
362
+ size?: "medium" | "large" | "x-large" | undefined;
363
+ }, {}>;
364
+ declare type StyledBaseButtonProps = ComponentPropsWithRef<typeof StyledBaseButton>;
365
+
366
+ declare type ButtonPropsA11y = StyledBaseButtonProps & AriaButtonProps;
367
+ interface BaseButtonProps extends Omit<ButtonPropsA11y, 'onClick' | 'isDisabled' | 'elementType'> {
368
+ /**
369
+ * The content
370
+ */
371
+ children: ReactNode;
372
+ /**
373
+ * Change the button style
374
+ */
375
+ variant?: StyledBaseButtonProps['variant'];
376
+ /**
377
+ * Change the button size
378
+ */
379
+ size?: ScaleProp<StyledBaseButtonProps['size']>;
380
+ /**
381
+ * Prevent pointer events
382
+ */
383
+ disabled?: boolean;
384
+ /**
385
+ * A URL to link when using the button as a link
386
+ */
387
+ href?: string;
388
+ /**
389
+ * The target window using the button as a link
390
+ */
391
+ target?: string;
392
+ /**
393
+ * The relationship between the linked resource and the current page. See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel)
394
+ */
395
+ rel?: string;
396
+ /**
397
+ * Alias for onPress
398
+ */
399
+ onClick?: AriaButtonProps['onPress'];
400
+ }
401
+ declare const BaseButton: react__default.ForwardRefExoticComponent<Pick<BaseButtonProps, "form" | "slot" | "title" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "autoFocus" | "disabled" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "size" | "target" | "href" | "rel" | "asChild" | "css" | "UNSAFE_style" | "variant" | "onPress" | "onPressStart" | "onPressEnd" | "onPressChange" | "onPressUp" | "onFocusChange" | "excludeFromTabOrder"> & react__default.RefAttributes<HTMLButtonElement>>;
402
+
403
+ export { BaseButton, BaseButtonProps };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@mirohq/design-system-base-button",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "",
5
5
  "author": "Miro",
6
6
  "source": "src/index.ts",
7
- "main": "../dist/main.js",
8
- "module": "../dist/module.js",
7
+ "main": "dist/main.js",
8
+ "module": "dist/module.js",
9
9
  "types": "dist/types.d.ts",
10
10
  "sideEffects": false,
11
11
  "exports": {
@@ -16,7 +16,7 @@
16
16
  }
17
17
  },
18
18
  "files": [
19
- "../dist"
19
+ "dist"
20
20
  ],
21
21
  "publishConfig": {
22
22
  "access": "public"