@mirohq/design-system-button 5.2.13 → 5.2.15
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 +47 -44
- package/dist/main.js.map +1 -1
- package/dist/module.js +47 -44
- package/dist/module.js.map +1 -1
- package/package.json +6 -6
package/dist/main.js
CHANGED
|
@@ -50,10 +50,10 @@ const iconSlotSelector = "& ".concat(StyledIconSlot);
|
|
|
50
50
|
const externalIconSelector = "& svg:not([data-icon-component]), & img:not([data-icon-component])";
|
|
51
51
|
const solidDisabled = {
|
|
52
52
|
[disabledSelector]: {
|
|
53
|
-
backgroundColor: "$background-
|
|
54
|
-
color: "$text-
|
|
53
|
+
backgroundColor: "$background-disabled",
|
|
54
|
+
color: "$text-on-disabled",
|
|
55
55
|
[iconSlotSelector]: {
|
|
56
|
-
color: "$icon-
|
|
56
|
+
color: "$icon-on-disabled"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
};
|
|
@@ -102,39 +102,39 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
102
102
|
variants: {
|
|
103
103
|
variant: {
|
|
104
104
|
primary: {
|
|
105
|
-
backgroundColor: "$background-primary
|
|
106
|
-
color: "$text-
|
|
105
|
+
backgroundColor: "$button-background-primary",
|
|
106
|
+
color: "$button-text-on-primary",
|
|
107
107
|
"&[data-pressed]": {
|
|
108
|
-
backgroundColor: "$background-primary-
|
|
108
|
+
backgroundColor: "$button-background-primary-pressed"
|
|
109
109
|
},
|
|
110
110
|
[iconSlotSelector]: {
|
|
111
|
-
color: "$icon-primary
|
|
111
|
+
color: "$button-icon-on-primary"
|
|
112
112
|
},
|
|
113
113
|
"&[data-hovered]": {
|
|
114
|
-
backgroundColor: "$background-primary-
|
|
114
|
+
backgroundColor: "$button-background-primary-hover"
|
|
115
115
|
},
|
|
116
116
|
...solidDisabled
|
|
117
117
|
},
|
|
118
118
|
tertiary: {
|
|
119
|
-
color: "$text-
|
|
120
|
-
border: "1.5px solid $border-
|
|
119
|
+
color: "$button-text-on-tertiary",
|
|
120
|
+
border: "1.5px solid $button-border-tertiary",
|
|
121
121
|
[iconSlotSelector]: {
|
|
122
|
-
color: "$icon-
|
|
122
|
+
color: "$button-icon-on-tertiary"
|
|
123
123
|
},
|
|
124
124
|
"&[data-hovered]": {
|
|
125
|
-
backgroundColor: "$background-
|
|
126
|
-
borderColor: "$border-
|
|
127
|
-
color: "$text-
|
|
125
|
+
backgroundColor: "$button-background-tertiary-hover",
|
|
126
|
+
borderColor: "$button-border-tertiary-hover",
|
|
127
|
+
color: "$button-text-on-tertiary",
|
|
128
128
|
[iconSlotSelector]: {
|
|
129
|
-
color: "$icon-
|
|
129
|
+
color: "$button-icon-on-tertiary"
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
"&[data-pressed]": {
|
|
133
|
-
backgroundColor: "$background-
|
|
134
|
-
borderColor: "$border-
|
|
135
|
-
color: "$text-
|
|
133
|
+
backgroundColor: "$button-background-tertiary-pressed",
|
|
134
|
+
borderColor: "$button-border-tertiary-pressed",
|
|
135
|
+
color: "$button-text-on-tertiary",
|
|
136
136
|
[iconSlotSelector]: {
|
|
137
|
-
color: "$icon-
|
|
137
|
+
color: "$button-icon-on-tertiary"
|
|
138
138
|
}
|
|
139
139
|
},
|
|
140
140
|
...outlineDisabled
|
|
@@ -159,18 +159,21 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
159
159
|
...ghostDisabled
|
|
160
160
|
},
|
|
161
161
|
secondary: {
|
|
162
|
-
color: "$text-
|
|
162
|
+
color: "$button-text-on-secondary",
|
|
163
163
|
backgroundColor: "$button-background-secondary",
|
|
164
|
+
borderColor: "$button-border-secondary",
|
|
164
165
|
"&[data-hovered]": {
|
|
165
|
-
color: "$text-
|
|
166
|
-
backgroundColor: "$button-background-secondary-hover"
|
|
166
|
+
color: "$button-text-on-secondary",
|
|
167
|
+
backgroundColor: "$button-background-secondary-hover",
|
|
168
|
+
borderColor: "$button-border-secondary-hover"
|
|
167
169
|
},
|
|
168
170
|
"&[data-pressed]": {
|
|
169
|
-
color: "$text-
|
|
170
|
-
backgroundColor: "$button-background-secondary-pressed"
|
|
171
|
+
color: "$button-text-on-secondary",
|
|
172
|
+
backgroundColor: "$button-background-secondary-pressed",
|
|
173
|
+
borderColor: "$button-border-secondary-pressed"
|
|
171
174
|
},
|
|
172
175
|
[iconSlotSelector]: {
|
|
173
|
-
color: "$icon-
|
|
176
|
+
color: "$button-icon-on-secondary"
|
|
174
177
|
},
|
|
175
178
|
...solidDisabled
|
|
176
179
|
},
|
|
@@ -192,52 +195,52 @@ const StyledButton = designSystemStitches.styled(designSystemBaseButton.BaseButt
|
|
|
192
195
|
...outlineDisabled
|
|
193
196
|
},
|
|
194
197
|
ghost: {
|
|
195
|
-
color: "$text-
|
|
198
|
+
color: "$text-default",
|
|
196
199
|
[iconSlotSelector]: {
|
|
197
|
-
color: "$icon-
|
|
200
|
+
color: "$icon-default"
|
|
198
201
|
},
|
|
199
202
|
"&[data-hovered]": {
|
|
200
|
-
backgroundColor: "$background-
|
|
201
|
-
color: "$text-
|
|
203
|
+
backgroundColor: "$button-background-ghost-hover",
|
|
204
|
+
color: "$text-default"
|
|
202
205
|
},
|
|
203
206
|
"&[data-pressed]": {
|
|
204
|
-
backgroundColor: "$background-
|
|
205
|
-
color: "$text-
|
|
207
|
+
backgroundColor: "$button-background-ghost-pressed",
|
|
208
|
+
color: "$text-default"
|
|
206
209
|
},
|
|
207
210
|
...ghostDisabled
|
|
208
211
|
},
|
|
209
212
|
danger: {
|
|
210
|
-
backgroundColor: "$background-danger
|
|
211
|
-
color: "$text-danger
|
|
213
|
+
backgroundColor: "$button-background-danger",
|
|
214
|
+
color: "$button-text-on-danger",
|
|
212
215
|
[iconSlotSelector]: {
|
|
213
|
-
color: "$icon-danger
|
|
216
|
+
color: "$button-icon-on-danger"
|
|
214
217
|
},
|
|
215
218
|
"&[data-hovered]": {
|
|
216
|
-
backgroundColor: "$background-danger-
|
|
219
|
+
backgroundColor: "$button-background-danger-hover"
|
|
217
220
|
},
|
|
218
221
|
"&[data-pressed]": {
|
|
219
|
-
backgroundColor: "$background-danger-
|
|
222
|
+
backgroundColor: "$button-background-danger-pressed"
|
|
220
223
|
},
|
|
221
224
|
...solidDisabled
|
|
222
225
|
},
|
|
223
226
|
"danger-secondary": {
|
|
224
|
-
borderColor: "$border-danger",
|
|
225
|
-
color: "$text-
|
|
227
|
+
borderColor: "$button-border-danger",
|
|
228
|
+
color: "$status-text-error",
|
|
226
229
|
[iconSlotSelector]: {
|
|
227
|
-
color: "$icon-
|
|
230
|
+
color: "$status-icon-error"
|
|
228
231
|
},
|
|
229
232
|
"&[data-hovered]": {
|
|
230
|
-
borderColor: "$border-danger-hover",
|
|
233
|
+
borderColor: "$button-border-danger-hover",
|
|
231
234
|
backgroundColor: "$background-danger-subtle-hover",
|
|
232
235
|
[iconSlotSelector]: {
|
|
233
|
-
color: "$icon-
|
|
236
|
+
color: "$status-icon-error"
|
|
234
237
|
}
|
|
235
238
|
},
|
|
236
239
|
"&[data-pressed]": {
|
|
237
|
-
borderColor: "$border-danger-
|
|
238
|
-
backgroundColor: "$background-danger-subtle-
|
|
240
|
+
borderColor: "$button-border-danger-pressed",
|
|
241
|
+
backgroundColor: "$background-danger-subtle-pressed",
|
|
239
242
|
[iconSlotSelector]: {
|
|
240
|
-
color: "$icon-
|
|
243
|
+
color: "$status-icon-error"
|
|
241
244
|
}
|
|
242
245
|
},
|
|
243
246
|
...outlineDisabled
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/hooks/use-button-context.tsx","../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { StyledButtonProps } from '../button.styled'\n\ninterface ButtonProps {\n size?: StyledButtonProps['size']\n}\n\ninterface ButtonContextProps extends ButtonProps {}\n\nexport interface ButtonProviderProps extends ButtonProps {\n children: React.ReactNode\n}\n\nconst ButtonContext = createContext<ButtonContextProps>({} as any)\n\nexport const ButtonProvider = ({\n children,\n ...restProps\n}: ButtonProviderProps): JSX.Element => (\n <ButtonContext.Provider\n value={{\n ...restProps,\n }}\n >\n {children}\n </ButtonContext.Provider>\n)\n\nexport const useButtonContext = (): ButtonContextProps =>\n useContext(ButtonContext)\n","import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport type {\n IconReactElement,\n IconSizes,\n} from '@mirohq/design-system-base-icon'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\n\nimport { useButtonContext } from '../hooks/use-button-context'\nimport type { StyledButtonProps } from '../button.styled'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\ntype ButtonSize = ExtractValidKeys<StyledButtonProps['size']>\n\nconst buttonIconSizes: { [key in ButtonSize]: IconSizes } = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n 'x-large': 'medium',\n}\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => {\n const { size } = useButtonContext()\n\n const formattedChildren = addPropsToChildren(\n children,\n child => isIconComponent(child as IconReactElement),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n }\n )\n\n return (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {formattedChildren}\n </StyledIconSlot>\n )\n})\n","import { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\nimport type { ComponentPropsWithRef } from 'react'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\n// we might face className collision because of empty CSS in StyledIconSlot\n// https://github.com/stitchesjs/stitches/issues/976\nconst iconSlotSelector = `& ${StyledIconSlot}`\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nconst solidDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst outlineDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst ghostDisabled: CSS = {\n [disabledSelector]: {\n color: '$text-neutrals-disabled',\n backgroundColor: '$transparent',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst LABEL_OFFSET = 2\n\nexport const StyledButton = styled(BaseButton, {\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n fontWeight: '$semibold',\n position: 'relative',\n width: 'fit-content',\n maxWidth: '100%',\n\n lineHeight: 1,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n ...focus.css({\n boxShadow: '$focus',\n }),\n\n variants: {\n variant: {\n primary: {\n backgroundColor: '$background-primary-prominent',\n color: '$text-neutrals-inverted',\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n\n ...solidDisabled,\n },\n tertiary: {\n color: '$text-primary',\n border: '1.5px solid $border-primary',\n\n [iconSlotSelector]: {\n color: '$icon-primary',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n borderColor: '$border-primary-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-prominent': {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n secondary: {\n color: '$text-neutrals',\n backgroundColor: '$button-background-secondary',\n '&[data-hovered]': {\n color: '$text-neutrals-hover',\n backgroundColor: '$button-background-secondary-hover',\n },\n '&[data-pressed]': {\n color: '$text-neutrals-active',\n backgroundColor: '$button-background-secondary-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n ...solidDisabled,\n },\n 'outline-subtle': {\n backgroundColor: '$background-neutrals',\n border: '1px solid $border-neutrals',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n ghost: {\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-hover',\n color: '$text-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-pressed',\n color: '$text-neutrals-pressed',\n },\n\n ...ghostDisabled,\n },\n danger: {\n backgroundColor: '$background-danger-prominent',\n color: '$text-danger-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-danger-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-prominent-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-prominent-active',\n },\n ...solidDisabled,\n },\n 'danger-secondary': {\n borderColor: '$border-danger',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n borderColor: '$border-danger-hover',\n backgroundColor: '$background-danger-subtle-hover',\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n borderColor: '$border-danger-active',\n backgroundColor: '$background-danger-subtle-active',\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...ghostDisabled,\n },\n },\n size: {\n 'x-large': {\n height: sizes.xLarge,\n fontSize: '$200',\n paddingX: `calc($200 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n },\n },\n large: {\n height: sizes.large,\n fontSize: '$200',\n paddingX: `calc($150 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n },\n },\n medium: {\n height: sizes.medium,\n fontSize: '$175',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n },\n },\n small: {\n fontSize: '$175',\n height: '$6',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n },\n },\n },\n rounded: {\n true: {\n borderRadius: '$round',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import type { BaseButtonProps } from '@mirohq/design-system-base-button'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { ButtonProvider } from './hooks/use-button-context'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\nexport type ButtonProps = BaseButtonProps & {\n /**\n * Change the button style.\n * @default 'primary'\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n * @default 'large'\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n * @default false\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n * @default false\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n * @default false\n */\n fluid?: StyledButtonProps['fluid']\n}\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n asChild = false,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n let formattedChildren = children\n\n if (loading) {\n const spinnerTestId =\n process.env.NODE_ENV === 'test' ? 'button-spinner' : undefined\n\n if (\n asChild &&\n React.Children.toArray(children).length === 1 &&\n React.isValidElement(children)\n ) {\n // when using asChild we need to render element to merge props with first,\n // and spinner wrapper should be rendered between the element and its content\n const firstLevelChild = React.Children.only(children)\n\n const { children: secondLevelChildren, ...childProps } =\n firstLevelChild.props\n\n formattedChildren = React.cloneElement(firstLevelChild, {\n ...childProps,\n children: (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{secondLevelChildren}</StyledHiddenContent>\n </>\n ),\n })\n } else {\n formattedChildren = (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{children}</StyledHiddenContent>\n </>\n )\n }\n }\n\n return (\n <ButtonProvider size={size}>\n <StyledButton\n {...restProps}\n asChild={asChild}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {formattedChildren}\n </StyledButton>\n </ButtonProvider>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["createContext","jsx","useContext","styled","Primitive","addPropsToChildren","isIconComponent","BaseButton","focus","sizes","baseIconStyles","booleanify","jsxs","Fragment","Spinner"],"mappings":";;;;;;;;;;;;AAcA,MAAM,aAAA,GAAgBA,mBAAA,CAAkC,EAAS,CAAA;AAE1D,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACEC,cAAA;AAAA,EAAC,aAAA,CAAc,QAAA;AAAA,EAAd;AAAA,IACC,KAAA,EAAO;AAAA,MACL,GAAG;AAAA,KACL;AAAA,IAEC;AAAA;AACH,CAAA;AAGK,MAAM,gBAAA,GAAmB,MAC9BC,gBAAA,CAAW,aAAa,CAAA;;ACfnB,MAAM,cAAA,GAAiBC,2BAAA,CAAOC,+BAAA,CAAU,GAAA,EAAK,EAAE,CAAA;AAKtD,MAAM,eAAA,GAAsD;AAAA,EAC1D,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,OAAA;AAAA,EACR,KAAA,EAAO,QAAA;AAAA,EACP,SAAA,EAAW;AACb,CAAA;AASO,MAAM,QAAA,GAAW,MAAM,UAAA,CAG5B,CAAC,EAAE,QAAA,EAAU,GAAG,SAAA,EAAU,EAAG,UAAA,KAAe;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,gBAAA,EAAiB;AAElC,EAAA,MAAM,iBAAA,GAAoBC,oCAAA;AAAA,IACxB,QAAA;AAAA,IACA,CAAA,KAAA,KAASC,qCAAgB,KAAyB,CAAA;AAAA,IAClD;AAAA,MACE,q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Aa,aAAA,EAC7B,yCAACa,2BAAA,EAAA,EAAQ,IAAA,EAAM,aAAa,CAAA,EAC9B,CAAA;AAAA,4BACAb,cAAA,CAAC,uBAAqB,QAAA,EAAA,mBAAA,EAAoB;AAAA,WAAA,EAC5C;AAAA,SAEH,CAAA;AAAA,MACH,CAAA,MAAO;AACL,QAAA,iBAAA,mBACEW,eAAA,CAAAC,mBAAA,EAAA,EACE,QAAA,EAAA;AAAA,0BAAAZ,cAAA,CAAC,oBAAiB,aAAA,EAAa,aAAA,EAC7B,yCAACa,2BAAA,EAAA,EAAQ,IAAA,EAAM,aAAa,CAAA,EAC9B,CAAA;AAAA,0BACAb,cAAA,CAAC,uBAAqB,QAAA,EAAS;AAAA,SAAA,EACjC,CAAA;AAAA,MAEJ;AAAA,IACF;AAEA,IAAA,uBACEA,cAAA,CAAC,kBAAe,IAAA,EACd,QAAA,kBAAAA,cAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,SAAA;AAAA,QACJ,OAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,QACA,IAAA;AAAA,QAEA,eAAA,EAAe,yBAAyB,IAAA,GAAO,MAAA;AAAA,QAC/C,GAAA,EAAK,UAAA;AAAA,QAEJ,QAAA,EAAA;AAAA;AAAA,KACH,EACF,CAAA;AAAA,EAEJ;AACF;AAUA,MAAA,CAAO,QAAA,GAAW,QAAA;AAClB,MAAA,CAAO,KAAA,GAAQ,KAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/hooks/use-button-context.tsx","../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { StyledButtonProps } from '../button.styled'\n\ninterface ButtonProps {\n size?: StyledButtonProps['size']\n}\n\ninterface ButtonContextProps extends ButtonProps {}\n\nexport interface ButtonProviderProps extends ButtonProps {\n children: React.ReactNode\n}\n\nconst ButtonContext = createContext<ButtonContextProps>({} as any)\n\nexport const ButtonProvider = ({\n children,\n ...restProps\n}: ButtonProviderProps): JSX.Element => (\n <ButtonContext.Provider\n value={{\n ...restProps,\n }}\n >\n {children}\n </ButtonContext.Provider>\n)\n\nexport const useButtonContext = (): ButtonContextProps =>\n useContext(ButtonContext)\n","import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport type {\n IconReactElement,\n IconSizes,\n} from '@mirohq/design-system-base-icon'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\n\nimport { useButtonContext } from '../hooks/use-button-context'\nimport type { StyledButtonProps } from '../button.styled'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\ntype ButtonSize = ExtractValidKeys<StyledButtonProps['size']>\n\nconst buttonIconSizes: { [key in ButtonSize]: IconSizes } = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n 'x-large': 'medium',\n}\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => {\n const { size } = useButtonContext()\n\n const formattedChildren = addPropsToChildren(\n children,\n child => isIconComponent(child as IconReactElement),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n }\n )\n\n return (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {formattedChildren}\n </StyledIconSlot>\n )\n})\n","import { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\nimport type { ComponentPropsWithRef } from 'react'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\n// we might face className collision because of empty CSS in StyledIconSlot\n// https://github.com/stitchesjs/stitches/issues/976\nconst iconSlotSelector = `& ${StyledIconSlot}`\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nconst solidDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-disabled',\n color: '$text-on-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-on-disabled',\n },\n },\n}\n\nconst outlineDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst ghostDisabled: CSS = {\n [disabledSelector]: {\n color: '$text-neutrals-disabled',\n backgroundColor: '$transparent',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst LABEL_OFFSET = 2\n\nexport const StyledButton = styled(BaseButton, {\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n fontWeight: '$semibold',\n position: 'relative',\n width: 'fit-content',\n maxWidth: '100%',\n\n lineHeight: 1,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n ...focus.css({\n boxShadow: '$focus',\n }),\n\n variants: {\n variant: {\n primary: {\n backgroundColor: '$button-background-primary',\n color: '$button-text-on-primary',\n '&[data-pressed]': {\n backgroundColor: '$button-background-primary-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$button-icon-on-primary',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-primary-hover',\n },\n\n ...solidDisabled,\n },\n tertiary: {\n color: '$button-text-on-tertiary',\n border: '1.5px solid $button-border-tertiary',\n\n [iconSlotSelector]: {\n color: '$button-icon-on-tertiary',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-tertiary-hover',\n borderColor: '$button-border-tertiary-hover',\n color: '$button-text-on-tertiary',\n\n [iconSlotSelector]: {\n color: '$button-icon-on-tertiary',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-tertiary-pressed',\n borderColor: '$button-border-tertiary-pressed',\n color: '$button-text-on-tertiary',\n\n [iconSlotSelector]: {\n color: '$button-icon-on-tertiary',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-prominent': {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n secondary: {\n color: '$button-text-on-secondary',\n backgroundColor: '$button-background-secondary',\n borderColor: '$button-border-secondary',\n '&[data-hovered]': {\n color: '$button-text-on-secondary',\n backgroundColor: '$button-background-secondary-hover',\n borderColor: '$button-border-secondary-hover',\n },\n '&[data-pressed]': {\n color: '$button-text-on-secondary',\n backgroundColor: '$button-background-secondary-pressed',\n borderColor: '$button-border-secondary-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$button-icon-on-secondary',\n },\n\n ...solidDisabled,\n },\n 'outline-subtle': {\n backgroundColor: '$background-neutrals',\n border: '1px solid $border-neutrals',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n ghost: {\n color: '$text-default',\n\n [iconSlotSelector]: {\n color: '$icon-default',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-ghost-hover',\n color: '$text-default',\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-ghost-pressed',\n color: '$text-default',\n },\n\n ...ghostDisabled,\n },\n danger: {\n backgroundColor: '$button-background-danger',\n color: '$button-text-on-danger',\n\n [iconSlotSelector]: {\n color: '$button-icon-on-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-danger-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-danger-pressed',\n },\n ...solidDisabled,\n },\n 'danger-secondary': {\n borderColor: '$button-border-danger',\n color: '$status-text-error',\n\n [iconSlotSelector]: {\n color: '$status-icon-error',\n },\n\n '&[data-hovered]': {\n borderColor: '$button-border-danger-hover',\n backgroundColor: '$background-danger-subtle-hover',\n [iconSlotSelector]: {\n color: '$status-icon-error',\n },\n },\n '&[data-pressed]': {\n borderColor: '$button-border-danger-pressed',\n backgroundColor: '$background-danger-subtle-pressed',\n [iconSlotSelector]: {\n color: '$status-icon-error',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...ghostDisabled,\n },\n },\n size: {\n 'x-large': {\n height: sizes.xLarge,\n fontSize: '$200',\n paddingX: `calc($200 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n },\n },\n large: {\n height: sizes.large,\n fontSize: '$200',\n paddingX: `calc($150 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n },\n },\n medium: {\n height: sizes.medium,\n fontSize: '$175',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n },\n },\n small: {\n fontSize: '$175',\n height: '$6',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n },\n },\n },\n rounded: {\n true: {\n borderRadius: '$round',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import type { BaseButtonProps } from '@mirohq/design-system-base-button'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { ButtonProvider } from './hooks/use-button-context'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\nexport type ButtonProps = BaseButtonProps & {\n /**\n * Change the button style.\n * @default 'primary'\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n * @default 'large'\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n * @default false\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n * @default false\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n * @default false\n */\n fluid?: StyledButtonProps['fluid']\n}\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n asChild = false,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n let formattedChildren = children\n\n if (loading) {\n const spinnerTestId =\n process.env.NODE_ENV === 'test' ? 'button-spinner' : undefined\n\n if (\n asChild &&\n React.Children.toArray(children).length === 1 &&\n React.isValidElement(children)\n ) {\n // when using asChild we need to render element to merge props with first,\n // and spinner wrapper should be rendered between the element and its content\n const firstLevelChild = React.Children.only(children)\n\n const { children: secondLevelChildren, ...childProps } =\n firstLevelChild.props\n\n formattedChildren = React.cloneElement(firstLevelChild, {\n ...childProps,\n children: (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{secondLevelChildren}</StyledHiddenContent>\n </>\n ),\n })\n } else {\n formattedChildren = (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{children}</StyledHiddenContent>\n </>\n )\n }\n }\n\n return (\n <ButtonProvider size={size}>\n <StyledButton\n {...restProps}\n asChild={asChild}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {formattedChildren}\n </StyledButton>\n </ButtonProvider>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["createContext","jsx","useContext","styled","Primitive","addPropsToChildren","isIconComponent","BaseButton","focus","sizes","baseIconStyles","booleanify","jsxs","Fragment","Spinner"],"mappings":";;;;;;;;;;;;AAcA,MAAM,aAAA,GAAgBA,mBAAA,CAAkC,EAAS,CAAA;AAE1D,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACEC,cAAA;AAAA,EAAC,aAAA,CAAc,QAAA;AAAA,EAAd;AAAA,IACC,KAAA,EAAO;AAAA,MACL,GAAG;AAAA,KACL;AAAA,IAEC;AAAA;AACH,CAAA;AAGK,MAAM,gBAAA,GAAmB,MAC9BC,gBAAA,CAAW,aAAa,CAAA;;ACfnB,MAAM,cAAA,GAAiBC,2BAAA,CAAOC,+BAAA,CAAU,GAAA,EAAK,EAAE,CAAA;AAKtD,MAAM,eAAA,GAAsD;AAAA,EAC1D,KAAA,EAAO,OAAA;AAAA,EACP,MAAA,EAAQ,OAAA;AAAA,EACR,KAAA,EAAO,QAAA;AAAA,EACP,SAAA,EAAW;AACb,CAAA;AASO,MAAM,QAAA,GAAW,MAAM,UAAA,CAG5B,CAAC,EAAE,QAAA,EAAU,GAAG,SAAA,EAAU,EAAG,UAAA,KAAe;AAC5C,EAAA,MAAM,EAAE,IAAA,EAAK,GAAI,gBAAA,EAAiB;AAElC,EAAA,MAAM,iBAAA,GAAoBC,oCAAA;AAAA,IACxB,QAAA;AAAA,IACA,CAAA,KAAA,KAASC,qCAAgB,KAAyB,CAAA;AAAA,IAClD;AA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UACH,0BACEC,eAAA,CAAAC,mBAAA,EAAA,EACE,QAAA,EAAA;AAAA,4BAAAZ,cAAA,CAAC,oBAAiB,aAAA,EAAa,aAAA,EAC7B,yCAACa,2BAAA,EAAA,EAAQ,IAAA,EAAM,aAAa,CAAA,EAC9B,CAAA;AAAA,4BACAb,cAAA,CAAC,uBAAqB,QAAA,EAAA,mBAAA,EAAoB;AAAA,WAAA,EAC5C;AAAA,SAEH,CAAA;AAAA,MACH,CAAA,MAAO;AACL,QAAA,iBAAA,mBACEW,eAAA,CAAAC,mBAAA,EAAA,EACE,QAAA,EAAA;AAAA,0BAAAZ,cAAA,CAAC,oBAAiB,aAAA,EAAa,aAAA,EAC7B,yCAACa,2BAAA,EAAA,EAAQ,IAAA,EAAM,aAAa,CAAA,EAC9B,CAAA;AAAA,0BACAb,cAAA,CAAC,uBAAqB,QAAA,EAAS;AAAA,SAAA,EACjC,CAAA;AAAA,MAEJ;AAAA,IACF;AAEA,IAAA,uBACEA,cAAA,CAAC,kBAAe,IAAA,EACd,QAAA,kBAAAA,cAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACE,GAAG,SAAA;AAAA,QACJ,OAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,QACA,IAAA;AAAA,QAEA,eAAA,EAAe,yBAAyB,IAAA,GAAO,MAAA;AAAA,QAC/C,GAAA,EAAK,UAAA;AAAA,QAEJ,QAAA,EAAA;AAAA;AAAA,KACH,EACF,CAAA;AAAA,EAEJ;AACF;AAUA,MAAA,CAAO,QAAA,GAAW,QAAA;AAClB,MAAA,CAAO,KAAA,GAAQ,KAAA;;;;"}
|
package/dist/module.js
CHANGED
|
@@ -48,10 +48,10 @@ const iconSlotSelector = "& ".concat(StyledIconSlot);
|
|
|
48
48
|
const externalIconSelector = "& svg:not([data-icon-component]), & img:not([data-icon-component])";
|
|
49
49
|
const solidDisabled = {
|
|
50
50
|
[disabledSelector]: {
|
|
51
|
-
backgroundColor: "$background-
|
|
52
|
-
color: "$text-
|
|
51
|
+
backgroundColor: "$background-disabled",
|
|
52
|
+
color: "$text-on-disabled",
|
|
53
53
|
[iconSlotSelector]: {
|
|
54
|
-
color: "$icon-
|
|
54
|
+
color: "$icon-on-disabled"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
};
|
|
@@ -100,39 +100,39 @@ const StyledButton = styled(BaseButton, {
|
|
|
100
100
|
variants: {
|
|
101
101
|
variant: {
|
|
102
102
|
primary: {
|
|
103
|
-
backgroundColor: "$background-primary
|
|
104
|
-
color: "$text-
|
|
103
|
+
backgroundColor: "$button-background-primary",
|
|
104
|
+
color: "$button-text-on-primary",
|
|
105
105
|
"&[data-pressed]": {
|
|
106
|
-
backgroundColor: "$background-primary-
|
|
106
|
+
backgroundColor: "$button-background-primary-pressed"
|
|
107
107
|
},
|
|
108
108
|
[iconSlotSelector]: {
|
|
109
|
-
color: "$icon-primary
|
|
109
|
+
color: "$button-icon-on-primary"
|
|
110
110
|
},
|
|
111
111
|
"&[data-hovered]": {
|
|
112
|
-
backgroundColor: "$background-primary-
|
|
112
|
+
backgroundColor: "$button-background-primary-hover"
|
|
113
113
|
},
|
|
114
114
|
...solidDisabled
|
|
115
115
|
},
|
|
116
116
|
tertiary: {
|
|
117
|
-
color: "$text-
|
|
118
|
-
border: "1.5px solid $border-
|
|
117
|
+
color: "$button-text-on-tertiary",
|
|
118
|
+
border: "1.5px solid $button-border-tertiary",
|
|
119
119
|
[iconSlotSelector]: {
|
|
120
|
-
color: "$icon-
|
|
120
|
+
color: "$button-icon-on-tertiary"
|
|
121
121
|
},
|
|
122
122
|
"&[data-hovered]": {
|
|
123
|
-
backgroundColor: "$background-
|
|
124
|
-
borderColor: "$border-
|
|
125
|
-
color: "$text-
|
|
123
|
+
backgroundColor: "$button-background-tertiary-hover",
|
|
124
|
+
borderColor: "$button-border-tertiary-hover",
|
|
125
|
+
color: "$button-text-on-tertiary",
|
|
126
126
|
[iconSlotSelector]: {
|
|
127
|
-
color: "$icon-
|
|
127
|
+
color: "$button-icon-on-tertiary"
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
"&[data-pressed]": {
|
|
131
|
-
backgroundColor: "$background-
|
|
132
|
-
borderColor: "$border-
|
|
133
|
-
color: "$text-
|
|
131
|
+
backgroundColor: "$button-background-tertiary-pressed",
|
|
132
|
+
borderColor: "$button-border-tertiary-pressed",
|
|
133
|
+
color: "$button-text-on-tertiary",
|
|
134
134
|
[iconSlotSelector]: {
|
|
135
|
-
color: "$icon-
|
|
135
|
+
color: "$button-icon-on-tertiary"
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
138
|
...outlineDisabled
|
|
@@ -157,18 +157,21 @@ const StyledButton = styled(BaseButton, {
|
|
|
157
157
|
...ghostDisabled
|
|
158
158
|
},
|
|
159
159
|
secondary: {
|
|
160
|
-
color: "$text-
|
|
160
|
+
color: "$button-text-on-secondary",
|
|
161
161
|
backgroundColor: "$button-background-secondary",
|
|
162
|
+
borderColor: "$button-border-secondary",
|
|
162
163
|
"&[data-hovered]": {
|
|
163
|
-
color: "$text-
|
|
164
|
-
backgroundColor: "$button-background-secondary-hover"
|
|
164
|
+
color: "$button-text-on-secondary",
|
|
165
|
+
backgroundColor: "$button-background-secondary-hover",
|
|
166
|
+
borderColor: "$button-border-secondary-hover"
|
|
165
167
|
},
|
|
166
168
|
"&[data-pressed]": {
|
|
167
|
-
color: "$text-
|
|
168
|
-
backgroundColor: "$button-background-secondary-pressed"
|
|
169
|
+
color: "$button-text-on-secondary",
|
|
170
|
+
backgroundColor: "$button-background-secondary-pressed",
|
|
171
|
+
borderColor: "$button-border-secondary-pressed"
|
|
169
172
|
},
|
|
170
173
|
[iconSlotSelector]: {
|
|
171
|
-
color: "$icon-
|
|
174
|
+
color: "$button-icon-on-secondary"
|
|
172
175
|
},
|
|
173
176
|
...solidDisabled
|
|
174
177
|
},
|
|
@@ -190,52 +193,52 @@ const StyledButton = styled(BaseButton, {
|
|
|
190
193
|
...outlineDisabled
|
|
191
194
|
},
|
|
192
195
|
ghost: {
|
|
193
|
-
color: "$text-
|
|
196
|
+
color: "$text-default",
|
|
194
197
|
[iconSlotSelector]: {
|
|
195
|
-
color: "$icon-
|
|
198
|
+
color: "$icon-default"
|
|
196
199
|
},
|
|
197
200
|
"&[data-hovered]": {
|
|
198
|
-
backgroundColor: "$background-
|
|
199
|
-
color: "$text-
|
|
201
|
+
backgroundColor: "$button-background-ghost-hover",
|
|
202
|
+
color: "$text-default"
|
|
200
203
|
},
|
|
201
204
|
"&[data-pressed]": {
|
|
202
|
-
backgroundColor: "$background-
|
|
203
|
-
color: "$text-
|
|
205
|
+
backgroundColor: "$button-background-ghost-pressed",
|
|
206
|
+
color: "$text-default"
|
|
204
207
|
},
|
|
205
208
|
...ghostDisabled
|
|
206
209
|
},
|
|
207
210
|
danger: {
|
|
208
|
-
backgroundColor: "$background-danger
|
|
209
|
-
color: "$text-danger
|
|
211
|
+
backgroundColor: "$button-background-danger",
|
|
212
|
+
color: "$button-text-on-danger",
|
|
210
213
|
[iconSlotSelector]: {
|
|
211
|
-
color: "$icon-danger
|
|
214
|
+
color: "$button-icon-on-danger"
|
|
212
215
|
},
|
|
213
216
|
"&[data-hovered]": {
|
|
214
|
-
backgroundColor: "$background-danger-
|
|
217
|
+
backgroundColor: "$button-background-danger-hover"
|
|
215
218
|
},
|
|
216
219
|
"&[data-pressed]": {
|
|
217
|
-
backgroundColor: "$background-danger-
|
|
220
|
+
backgroundColor: "$button-background-danger-pressed"
|
|
218
221
|
},
|
|
219
222
|
...solidDisabled
|
|
220
223
|
},
|
|
221
224
|
"danger-secondary": {
|
|
222
|
-
borderColor: "$border-danger",
|
|
223
|
-
color: "$text-
|
|
225
|
+
borderColor: "$button-border-danger",
|
|
226
|
+
color: "$status-text-error",
|
|
224
227
|
[iconSlotSelector]: {
|
|
225
|
-
color: "$icon-
|
|
228
|
+
color: "$status-icon-error"
|
|
226
229
|
},
|
|
227
230
|
"&[data-hovered]": {
|
|
228
|
-
borderColor: "$border-danger-hover",
|
|
231
|
+
borderColor: "$button-border-danger-hover",
|
|
229
232
|
backgroundColor: "$background-danger-subtle-hover",
|
|
230
233
|
[iconSlotSelector]: {
|
|
231
|
-
color: "$icon-
|
|
234
|
+
color: "$status-icon-error"
|
|
232
235
|
}
|
|
233
236
|
},
|
|
234
237
|
"&[data-pressed]": {
|
|
235
|
-
borderColor: "$border-danger-
|
|
236
|
-
backgroundColor: "$background-danger-subtle-
|
|
238
|
+
borderColor: "$button-border-danger-pressed",
|
|
239
|
+
backgroundColor: "$background-danger-subtle-pressed",
|
|
237
240
|
[iconSlotSelector]: {
|
|
238
|
-
color: "$icon-
|
|
241
|
+
color: "$status-icon-error"
|
|
239
242
|
}
|
|
240
243
|
},
|
|
241
244
|
...outlineDisabled
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/hooks/use-button-context.tsx","../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { StyledButtonProps } from '../button.styled'\n\ninterface ButtonProps {\n size?: StyledButtonProps['size']\n}\n\ninterface ButtonContextProps extends ButtonProps {}\n\nexport interface ButtonProviderProps extends ButtonProps {\n children: React.ReactNode\n}\n\nconst ButtonContext = createContext<ButtonContextProps>({} as any)\n\nexport const ButtonProvider = ({\n children,\n ...restProps\n}: ButtonProviderProps): JSX.Element => (\n <ButtonContext.Provider\n value={{\n ...restProps,\n }}\n >\n {children}\n </ButtonContext.Provider>\n)\n\nexport const useButtonContext = (): ButtonContextProps =>\n useContext(ButtonContext)\n","import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport type {\n IconReactElement,\n IconSizes,\n} from '@mirohq/design-system-base-icon'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\n\nimport { useButtonContext } from '../hooks/use-button-context'\nimport type { StyledButtonProps } from '../button.styled'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\ntype ButtonSize = ExtractValidKeys<StyledButtonProps['size']>\n\nconst buttonIconSizes: { [key in ButtonSize]: IconSizes } = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n 'x-large': 'medium',\n}\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => {\n const { size } = useButtonContext()\n\n const formattedChildren = addPropsToChildren(\n children,\n child => isIconComponent(child as IconReactElement),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n }\n )\n\n return (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {formattedChildren}\n </StyledIconSlot>\n )\n})\n","import { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\nimport type { ComponentPropsWithRef } from 'react'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\n// we might face className collision because of empty CSS in StyledIconSlot\n// https://github.com/stitchesjs/stitches/issues/976\nconst iconSlotSelector = `& ${StyledIconSlot}`\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nconst solidDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst outlineDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst ghostDisabled: CSS = {\n [disabledSelector]: {\n color: '$text-neutrals-disabled',\n backgroundColor: '$transparent',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst LABEL_OFFSET = 2\n\nexport const StyledButton = styled(BaseButton, {\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n fontWeight: '$semibold',\n position: 'relative',\n width: 'fit-content',\n maxWidth: '100%',\n\n lineHeight: 1,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n ...focus.css({\n boxShadow: '$focus',\n }),\n\n variants: {\n variant: {\n primary: {\n backgroundColor: '$background-primary-prominent',\n color: '$text-neutrals-inverted',\n '&[data-pressed]': {\n backgroundColor: '$background-primary-prominent-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$icon-primary-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-prominent-hover',\n },\n\n ...solidDisabled,\n },\n tertiary: {\n color: '$text-primary',\n border: '1.5px solid $border-primary',\n\n [iconSlotSelector]: {\n color: '$icon-primary',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n borderColor: '$border-primary-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n borderColor: '$border-primary-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-prominent': {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n secondary: {\n color: '$text-neutrals',\n backgroundColor: '$button-background-secondary',\n '&[data-hovered]': {\n color: '$text-neutrals-hover',\n backgroundColor: '$button-background-secondary-hover',\n },\n '&[data-pressed]': {\n color: '$text-neutrals-active',\n backgroundColor: '$button-background-secondary-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n ...solidDisabled,\n },\n 'outline-subtle': {\n backgroundColor: '$background-neutrals',\n border: '1px solid $border-neutrals',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n ghost: {\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-hover',\n color: '$text-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-pressed',\n color: '$text-neutrals-pressed',\n },\n\n ...ghostDisabled,\n },\n danger: {\n backgroundColor: '$background-danger-prominent',\n color: '$text-danger-inverted',\n\n [iconSlotSelector]: {\n color: '$icon-danger-inverted',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-prominent-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-prominent-active',\n },\n ...solidDisabled,\n },\n 'danger-secondary': {\n borderColor: '$border-danger',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n borderColor: '$border-danger-hover',\n backgroundColor: '$background-danger-subtle-hover',\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n borderColor: '$border-danger-active',\n backgroundColor: '$background-danger-subtle-active',\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...ghostDisabled,\n },\n },\n size: {\n 'x-large': {\n height: sizes.xLarge,\n fontSize: '$200',\n paddingX: `calc($200 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n },\n },\n large: {\n height: sizes.large,\n fontSize: '$200',\n paddingX: `calc($150 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n },\n },\n medium: {\n height: sizes.medium,\n fontSize: '$175',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n },\n },\n small: {\n fontSize: '$175',\n height: '$6',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n },\n },\n },\n rounded: {\n true: {\n borderRadius: '$round',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import type { BaseButtonProps } from '@mirohq/design-system-base-button'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { ButtonProvider } from './hooks/use-button-context'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\nexport type ButtonProps = BaseButtonProps & {\n /**\n * Change the button style.\n * @default 'primary'\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n * @default 'large'\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n * @default false\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n * @default false\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n * @default false\n */\n fluid?: StyledButtonProps['fluid']\n}\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n asChild = false,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n let formattedChildren = children\n\n if (loading) {\n const spinnerTestId =\n process.env.NODE_ENV === 'test' ? 'button-spinner' : undefined\n\n if (\n asChild &&\n React.Children.toArray(children).length === 1 &&\n React.isValidElement(children)\n ) {\n // when using asChild we need to render element to merge props with first,\n // and spinner wrapper should be rendered between the element and its content\n const firstLevelChild = React.Children.only(children)\n\n const { children: secondLevelChildren, ...childProps } =\n firstLevelChild.props\n\n formattedChildren = React.cloneElement(firstLevelChild, {\n ...childProps,\n children: (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{secondLevelChildren}</StyledHiddenContent>\n </>\n ),\n })\n } else {\n formattedChildren = (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{children}</StyledHiddenContent>\n </>\n )\n }\n }\n\n return (\n <ButtonProvider size={size}>\n <StyledButton\n {...restProps}\n asChild={asChild}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {formattedChildren}\n </StyledButton>\n </ButtonProvider>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["baseIconStyles"],"mappings":";;;;;;;;;;AAcA,MAAM,aAAA,GAAgB,aAAA,CAAkC,EAAS,CAAA;AAE1D,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA;AAAA,EAAC,aAAA,CAAc,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SAAA;AAAA,QACJ,OAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,KAAA;AAAA,QACA,IAAA;AAAA,QAEA,eAAA,EAAe,yBAAyB,IAAA,GAAO,MAAA;AAAA,QAC/C,GAAA,EAAK,UAAA;AAAA,QAEJ,QAAA,EAAA;AAAA;AAAA,KACH,EACF,CAAA;AAAA,EAEJ;AACF;AAUA,MAAA,CAAO,QAAA,GAAW,QAAA;AAClB,MAAA,CAAO,KAAA,GAAQ,KAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/hooks/use-button-context.tsx","../src/partials/icon-slot.tsx","../src/button.styled.ts","../src/partials/label.ts","../src/button.tsx"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nimport type { StyledButtonProps } from '../button.styled'\n\ninterface ButtonProps {\n size?: StyledButtonProps['size']\n}\n\ninterface ButtonContextProps extends ButtonProps {}\n\nexport interface ButtonProviderProps extends ButtonProps {\n children: React.ReactNode\n}\n\nconst ButtonContext = createContext<ButtonContextProps>({} as any)\n\nexport const ButtonProvider = ({\n children,\n ...restProps\n}: ButtonProviderProps): JSX.Element => (\n <ButtonContext.Provider\n value={{\n ...restProps,\n }}\n >\n {children}\n </ButtonContext.Provider>\n)\n\nexport const useButtonContext = (): ButtonContextProps =>\n useContext(ButtonContext)\n","import React from 'react'\nimport { styled } from '@mirohq/design-system-stitches'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport type { ElementRef, ComponentPropsWithRef } from 'react'\nimport { addPropsToChildren } from '@mirohq/design-system-utils'\nimport type {\n IconReactElement,\n IconSizes,\n} from '@mirohq/design-system-base-icon'\nimport { isIconComponent } from '@mirohq/design-system-base-icon'\nimport type { ExtractValidKeys } from '@mirohq/design-system-types'\n\nimport { useButtonContext } from '../hooks/use-button-context'\nimport type { StyledButtonProps } from '../button.styled'\n\nexport const StyledIconSlot = styled(Primitive.div, {})\nexport type StyledIconSlotProps = ComponentPropsWithRef<typeof StyledIconSlot>\n\ntype ButtonSize = ExtractValidKeys<StyledButtonProps['size']>\n\nconst buttonIconSizes: { [key in ButtonSize]: IconSizes } = {\n small: 'small',\n medium: 'small',\n large: 'medium',\n 'x-large': 'medium',\n}\n\nexport interface IconSlotProps extends StyledIconSlotProps {\n /**\n * The icon.\n */\n children: React.ReactNode\n}\n\nexport const IconSlot = React.forwardRef<\n ElementRef<typeof StyledIconSlot>,\n IconSlotProps\n>(({ children, ...restProps }, forwardRef) => {\n const { size } = useButtonContext()\n\n const formattedChildren = addPropsToChildren(\n children,\n child => isIconComponent(child as IconReactElement),\n {\n 'data-icon-component': '',\n size: buttonIconSizes[size as ButtonSize],\n }\n )\n\n return (\n <StyledIconSlot {...restProps} ref={forwardRef} aria-hidden asChild>\n {formattedChildren}\n </StyledIconSlot>\n )\n})\n","import { BaseButton, sizes } from '@mirohq/design-system-base-button'\nimport { styles as baseIconStyles } from '@mirohq/design-system-base-icon'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\nimport { focus } from '@mirohq/design-system-styles'\nimport type { ComponentPropsWithRef } from 'react'\n\nimport { StyledIconSlot } from './partials/icon-slot'\n\nconst disabledSelector = '&[disabled], &[aria-disabled=\"true\"]'\n\n// we might face className collision because of empty CSS in StyledIconSlot\n// https://github.com/stitchesjs/stitches/issues/976\nconst iconSlotSelector = `& ${StyledIconSlot}`\nconst externalIconSelector =\n '& svg:not([data-icon-component]), & img:not([data-icon-component])'\n\nconst solidDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-disabled',\n color: '$text-on-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-on-disabled',\n },\n },\n}\n\nconst outlineDisabled: CSS = {\n [disabledSelector]: {\n backgroundColor: '$background-neutrals',\n borderColor: '$border-neutrals-disabled',\n color: '$text-neutrals-disabled',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst ghostDisabled: CSS = {\n [disabledSelector]: {\n color: '$text-neutrals-disabled',\n backgroundColor: '$transparent',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals-disabled',\n },\n },\n}\n\nconst LABEL_OFFSET = 2\n\nexport const StyledButton = styled(BaseButton, {\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n textAlign: 'center',\n fontWeight: '$semibold',\n position: 'relative',\n width: 'fit-content',\n maxWidth: '100%',\n\n lineHeight: 1,\n border: '1px solid transparent', // to make outline and solid/ghost variants the same width\n\n [`& ${StyledIconSlot}:first-child`]: {\n marginLeft: -LABEL_OFFSET,\n marginRight: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n [`& ${StyledIconSlot}:last-child`]: {\n marginRight: -LABEL_OFFSET,\n marginLeft: `calc($50 + ${LABEL_OFFSET}px)`,\n },\n ...focus.css({\n boxShadow: '$focus',\n }),\n\n variants: {\n variant: {\n primary: {\n backgroundColor: '$button-background-primary',\n color: '$button-text-on-primary',\n '&[data-pressed]': {\n backgroundColor: '$button-background-primary-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$button-icon-on-primary',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-primary-hover',\n },\n\n ...solidDisabled,\n },\n tertiary: {\n color: '$button-text-on-tertiary',\n border: '1.5px solid $button-border-tertiary',\n\n [iconSlotSelector]: {\n color: '$button-icon-on-tertiary',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-tertiary-hover',\n borderColor: '$button-border-tertiary-hover',\n color: '$button-text-on-tertiary',\n\n [iconSlotSelector]: {\n color: '$button-icon-on-tertiary',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-tertiary-pressed',\n borderColor: '$button-border-tertiary-pressed',\n color: '$button-text-on-tertiary',\n\n [iconSlotSelector]: {\n color: '$button-icon-on-tertiary',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-prominent': {\n backgroundColor: 'transparent',\n color: '$text-primary',\n\n '&[data-hovered]': {\n backgroundColor: '$background-primary-subtle-hover',\n color: '$text-primary-hover',\n\n [iconSlotSelector]: {\n color: '$icon-primary-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-primary-subtle-active',\n color: '$text-primary-active',\n\n [iconSlotSelector]: {\n color: '$icon-primary-active',\n },\n },\n ...ghostDisabled,\n },\n secondary: {\n color: '$button-text-on-secondary',\n backgroundColor: '$button-background-secondary',\n borderColor: '$button-border-secondary',\n '&[data-hovered]': {\n color: '$button-text-on-secondary',\n backgroundColor: '$button-background-secondary-hover',\n borderColor: '$button-border-secondary-hover',\n },\n '&[data-pressed]': {\n color: '$button-text-on-secondary',\n backgroundColor: '$button-background-secondary-pressed',\n borderColor: '$button-border-secondary-pressed',\n },\n\n [iconSlotSelector]: {\n color: '$button-icon-on-secondary',\n },\n\n ...solidDisabled,\n },\n 'outline-subtle': {\n backgroundColor: '$background-neutrals',\n border: '1px solid $border-neutrals',\n color: '$text-neutrals',\n\n [iconSlotSelector]: {\n color: '$icon-neutrals',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-neutrals-subtle-hover',\n borderColor: '$border-neutrals-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$background-neutrals-subtle-active',\n borderColor: '$border-neutrals-active',\n },\n ...outlineDisabled,\n },\n ghost: {\n color: '$text-default',\n\n [iconSlotSelector]: {\n color: '$icon-default',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-ghost-hover',\n color: '$text-default',\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-ghost-pressed',\n color: '$text-default',\n },\n\n ...ghostDisabled,\n },\n danger: {\n backgroundColor: '$button-background-danger',\n color: '$button-text-on-danger',\n\n [iconSlotSelector]: {\n color: '$button-icon-on-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$button-background-danger-hover',\n },\n '&[data-pressed]': {\n backgroundColor: '$button-background-danger-pressed',\n },\n ...solidDisabled,\n },\n 'danger-secondary': {\n borderColor: '$button-border-danger',\n color: '$status-text-error',\n\n [iconSlotSelector]: {\n color: '$status-icon-error',\n },\n\n '&[data-hovered]': {\n borderColor: '$button-border-danger-hover',\n backgroundColor: '$background-danger-subtle-hover',\n [iconSlotSelector]: {\n color: '$status-icon-error',\n },\n },\n '&[data-pressed]': {\n borderColor: '$button-border-danger-pressed',\n backgroundColor: '$background-danger-subtle-pressed',\n [iconSlotSelector]: {\n color: '$status-icon-error',\n },\n },\n ...outlineDisabled,\n },\n 'ghost-danger': {\n backgroundColor: 'transparent',\n color: '$text-danger',\n\n [iconSlotSelector]: {\n color: '$icon-danger',\n },\n\n '&[data-hovered]': {\n backgroundColor: '$background-danger-subtle',\n color: '$text-danger-hover',\n\n [iconSlotSelector]: {\n color: '$icon-danger-hover',\n },\n },\n '&[data-pressed]': {\n backgroundColor: '$background-danger-subtle-hover',\n color: '$text-danger-active',\n\n [iconSlotSelector]: {\n color: '$icon-danger-active',\n },\n },\n ...ghostDisabled,\n },\n },\n size: {\n 'x-large': {\n height: sizes.xLarge,\n fontSize: '$200',\n paddingX: `calc($200 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n },\n },\n large: {\n height: sizes.large,\n fontSize: '$200',\n paddingX: `calc($150 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.medium,\n },\n },\n medium: {\n height: sizes.medium,\n fontSize: '$175',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n },\n },\n small: {\n fontSize: '$175',\n height: '$6',\n paddingX: `calc($100 + ${LABEL_OFFSET}px)`,\n\n [externalIconSelector]: {\n ...baseIconStyles.size.small,\n },\n },\n },\n rounded: {\n true: {\n borderRadius: '$round',\n },\n },\n fluid: {\n true: {\n display: 'flex',\n justifyContent: 'center',\n maxWidth: '100%',\n width: '100%',\n },\n },\n },\n})\n\nexport const StyledHiddenContent = styled(Primitive.span, {\n visibility: 'hidden',\n})\n\nexport const StyledSpinnerBox = styled(Primitive.div, {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'absolute',\n top: 0,\n left: 0,\n bottom: 0,\n right: 0,\n margin: 'auto',\n})\n\nexport type StyledButtonProps = ComponentPropsWithRef<typeof StyledButton>\n","import { Primitive } from '@mirohq/design-system-primitive'\n\nexport const Label = Primitive.span\n\nLabel.displayName = 'Label'\n","import type { BaseButtonProps } from '@mirohq/design-system-base-button'\nimport { Spinner } from '@mirohq/design-system-spinner'\nimport type { SpinnerProps } from '@mirohq/design-system-spinner'\nimport { booleanify } from '@mirohq/design-system-utils'\nimport React from 'react'\nimport type { ElementRef, ForwardRefExoticComponent } from 'react'\n\nimport type { StyledButtonProps } from './button.styled'\nimport {\n StyledButton,\n StyledHiddenContent,\n StyledSpinnerBox,\n} from './button.styled'\nimport { ButtonProvider } from './hooks/use-button-context'\nimport { IconSlot } from './partials/icon-slot'\nimport { Label } from './partials/label'\n\nexport type ButtonProps = BaseButtonProps & {\n /**\n * Change the button style.\n * @default 'primary'\n */\n variant?: StyledButtonProps['variant']\n\n /**\n * Change the button size.\n * @default 'large'\n */\n size?: StyledButtonProps['size']\n\n /**\n * Make button border rounded.\n * @default false\n */\n rounded?: StyledButtonProps['rounded']\n\n /**\n * Add spinner and disable.\n * @default false\n */\n loading?: boolean\n\n /**\n * Make width 100%.\n * @default false\n */\n fluid?: StyledButtonProps['fluid']\n}\n\nexport const Button = React.forwardRef<ElementRef<'button' | 'a'>, ButtonProps>(\n (\n {\n variant = 'primary',\n size = 'large',\n loading = false,\n rounded = false,\n fluid = false,\n 'aria-disabled': ariaDisabled,\n asChild = false,\n children,\n ...restProps\n },\n forwardRef\n ) => {\n let spinnerSize: SpinnerProps['size'] = 'medium'\n\n if (typeof size === 'string' && ['small', 'medium'].includes(size)) {\n spinnerSize = 'small'\n }\n\n const shouldHaveAriaDisabled = booleanify(ariaDisabled) || loading\n\n let formattedChildren = children\n\n if (loading) {\n const spinnerTestId =\n process.env.NODE_ENV === 'test' ? 'button-spinner' : undefined\n\n if (\n asChild &&\n React.Children.toArray(children).length === 1 &&\n React.isValidElement(children)\n ) {\n // when using asChild we need to render element to merge props with first,\n // and spinner wrapper should be rendered between the element and its content\n const firstLevelChild = React.Children.only(children)\n\n const { children: secondLevelChildren, ...childProps } =\n firstLevelChild.props\n\n formattedChildren = React.cloneElement(firstLevelChild, {\n ...childProps,\n children: (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{secondLevelChildren}</StyledHiddenContent>\n </>\n ),\n })\n } else {\n formattedChildren = (\n <>\n <StyledSpinnerBox data-testid={spinnerTestId}>\n <Spinner size={spinnerSize} />\n </StyledSpinnerBox>\n <StyledHiddenContent>{children}</StyledHiddenContent>\n </>\n )\n }\n }\n\n return (\n <ButtonProvider size={size}>\n <StyledButton\n {...restProps}\n asChild={asChild}\n variant={variant}\n rounded={rounded}\n fluid={fluid}\n size={size}\n // without undefined it will be aria-disabled=\"false\" in html\n aria-disabled={shouldHaveAriaDisabled ? true : undefined}\n ref={forwardRef}\n >\n {formattedChildren}\n </StyledButton>\n </ButtonProvider>\n )\n }\n) as ForwardRefExoticComponent<ButtonProps> & Partials\n\n// Partials\n// -----------------------------------------------------------------------------\n\nexport interface Partials {\n IconSlot: typeof IconSlot\n Label: typeof Label\n}\n\nButton.IconSlot = IconSlot\nButton.Label = Label\n"],"names":["baseIconStyles"],"mappings":";;;;;;;;;;AAcA,MAAM,aAAA,GAAgB,aAAA,CAAkC,EAAS,CAAA;AAE1D,MAAM,iBAAiB,CAAC;AAAA,EAC7B,QAAA;AAAA,EACA,GAAG;AACL,CAAA,qBACE,GAAA;AAAA,EAAC,aAAA,CAAc,QAAA;AAAA,EAAd;AAAA,IACC,KAAA,EAAO;AAAA,MACL,GAAG;AAAA,KACL;AAAA,IAEC;AAAA;AACH,CAAA;AAGK,MAAM,gBAAA,GAAmB,MAC9B,UAAA,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QACA,OAAA;AAAA,QACA,KAAA;AAAA,QACA,IAAA;AAAA,QAEA,eAAA,EAAe,yBAAyB,IAAA,GAAO,MAAA;AAAA,QAC/C,GAAA,EAAK,UAAA;AAAA,QAEJ,QAAA,EAAA;AAAA;AAAA,KACH,EACF,CAAA;AAAA,EAEJ;AACF;AAUA,MAAA,CAAO,QAAA,GAAW,QAAA;AAClB,MAAA,CAAO,KAAA,GAAQ,KAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirohq/design-system-button",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.15",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Miro",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"react": "^16.14 || ^17 || ^18 || ^19"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@mirohq/design-system-
|
|
30
|
-
"@mirohq/design-system-base-
|
|
29
|
+
"@mirohq/design-system-spinner": "^2.2.12",
|
|
30
|
+
"@mirohq/design-system-base-button": "^1.2.13",
|
|
31
31
|
"@mirohq/design-system-primitive": "^2.2.1",
|
|
32
|
-
"@mirohq/design-system-
|
|
33
|
-
"@mirohq/design-system-
|
|
34
|
-
"@mirohq/design-system-
|
|
32
|
+
"@mirohq/design-system-stitches": "^3.3.10",
|
|
33
|
+
"@mirohq/design-system-styles": "^3.2.9",
|
|
34
|
+
"@mirohq/design-system-base-icon": "^1.2.1",
|
|
35
35
|
"@mirohq/design-system-types": "^1.0.3",
|
|
36
36
|
"@mirohq/design-system-utils": "^1.3.0"
|
|
37
37
|
},
|