@apify/ui-library 1.155.1 → 1.156.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/components/button/button.d.ts +6 -33
  2. package/dist/components/button/button.d.ts.map +1 -1
  3. package/dist/components/button/button.js +46 -231
  4. package/dist/components/button/button.style.d.ts +37 -0
  5. package/dist/components/button/button.style.d.ts.map +1 -0
  6. package/dist/components/button/button.style.js +250 -0
  7. package/dist/components/icon_button/icon_button.js +2 -1
  8. package/dist/components/select/select.js +2 -2
  9. package/dist/components/select/select.test_ids.d.ts +1 -0
  10. package/dist/components/select/select.test_ids.d.ts.map +1 -1
  11. package/dist/components/select/select.test_ids.js +2 -1
  12. package/dist/components/spinner/spinner.d.ts.map +1 -1
  13. package/dist/components/spinner/spinner.js +3 -0
  14. package/dist/components/spinner/spinner.test_ids.d.ts +4 -0
  15. package/dist/components/spinner/spinner.test_ids.d.ts.map +1 -0
  16. package/dist/components/spinner/spinner.test_ids.js +4 -0
  17. package/dist/components/tabs/tab.d.ts.map +1 -1
  18. package/dist/components/tabs/tab.js +1 -1
  19. package/dist/files_hash_at_build.txt +1 -1
  20. package/dist/index.js +2 -1
  21. package/dist/src/components/button/button.d.ts +6 -33
  22. package/dist/src/components/button/button.d.ts.map +1 -1
  23. package/dist/src/components/button/button.js +24 -221
  24. package/dist/src/components/button/button.js.map +1 -1
  25. package/dist/src/components/button/button.style.d.ts +37 -0
  26. package/dist/src/components/button/button.style.d.ts.map +1 -0
  27. package/dist/src/components/button/button.style.js +256 -0
  28. package/dist/src/components/button/button.style.js.map +1 -0
  29. package/dist/src/components/select/select.js +2 -2
  30. package/dist/src/components/select/select.js.map +1 -1
  31. package/dist/src/components/select/select.test_ids.d.ts +1 -0
  32. package/dist/src/components/select/select.test_ids.d.ts.map +1 -1
  33. package/dist/src/components/select/select.test_ids.js +2 -0
  34. package/dist/src/components/select/select.test_ids.js.map +1 -1
  35. package/dist/src/components/spinner/spinner.d.ts.map +1 -1
  36. package/dist/src/components/spinner/spinner.js +2 -1
  37. package/dist/src/components/spinner/spinner.js.map +1 -1
  38. package/dist/src/components/spinner/spinner.test_ids.d.ts +4 -0
  39. package/dist/src/components/spinner/spinner.test_ids.d.ts.map +1 -0
  40. package/dist/src/components/spinner/spinner.test_ids.js +4 -0
  41. package/dist/src/components/spinner/spinner.test_ids.js.map +1 -0
  42. package/dist/src/components/tabs/tab.d.ts.map +1 -1
  43. package/dist/src/components/tabs/tab.js +1 -1
  44. package/dist/src/components/tabs/tab.js.map +1 -1
  45. package/dist/src/test_ids.d.ts +2 -1
  46. package/dist/src/test_ids.d.ts.map +1 -1
  47. package/dist/src/test_ids.js +2 -1
  48. package/dist/src/test_ids.js.map +1 -1
  49. package/dist/test_ids.d.ts +2 -1
  50. package/dist/test_ids.d.ts.map +1 -1
  51. package/dist/test_ids.js +3 -2
  52. package/dist/tsconfig.build.tsbuildinfo +1 -1
  53. package/package.json +2 -2
  54. package/src/components/button/button.stories.tsx +55 -0
  55. package/src/components/button/button.style.ts +311 -0
  56. package/src/components/button/button.tsx +75 -293
  57. package/src/components/select/select.test_ids.ts +3 -0
  58. package/src/components/select/select.tsx +2 -2
  59. package/src/components/spinner/spinner.test_ids.ts +3 -0
  60. package/src/components/spinner/spinner.tsx +8 -1
  61. package/src/components/tabs/tab.tsx +6 -1
  62. package/src/test_ids.ts +2 -1
@@ -1,7 +1,7 @@
1
1
  import { theme } from "../../design_system/theme.js";
2
2
  import { TextShared } from "../text/text_shared.js";
3
3
  import { IconButton } from "../icon_button/icon_button.js";
4
- import { selectClearTestId } from "./select.test_ids.js";
4
+ import { selectClearTestId, selectMultiValueLabelTestId } from "./select.test_ids.js";
5
5
  import styled from "styled-components";
6
6
  import { forwardRef, useCallback, useMemo } from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -199,7 +199,7 @@ var SelectMultiValueLabel = ({ innerProps, ...rest }) => /* @__PURE__ */ jsx(com
199
199
  ...rest,
200
200
  innerProps: {
201
201
  ...innerProps,
202
- "data-test": `${rest.selectProps?.id ?? rest.selectProps?.name}--multi-value-label`
202
+ "data-test": selectMultiValueLabelTestId(rest.selectProps?.id ?? rest.selectProps?.name)
203
203
  }
204
204
  });
205
205
  var IndicatorSeparator = () => null;
@@ -1,2 +1,3 @@
1
1
  export declare const selectClearTestId: (idOrName: string | undefined) => string;
2
+ export declare const selectMultiValueLabelTestId: (idOrName: string | undefined) => string;
2
3
  //# sourceMappingURL=select.test_ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.test_ids.d.ts","sourceRoot":"","sources":["../../../src/components/select/select.test_ids.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,MAA8B,CAAC"}
1
+ {"version":3,"file":"select.test_ids.d.ts","sourceRoot":"","sources":["../../../src/components/select/select.test_ids.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,MAA8B,CAAC;AAGhG,eAAO,MAAM,2BAA2B,GAAI,UAAU,MAAM,GAAG,SAAS,KAAG,MAA0C,CAAC"}
@@ -1,4 +1,5 @@
1
1
  //#region src/components/select/select.test_ids.ts
2
2
  var selectClearTestId = (idOrName) => `${idOrName}--clear`;
3
+ var selectMultiValueLabelTestId = (idOrName) => `${idOrName}--multi-value-label`;
3
4
  //#endregion
4
- export { selectClearTestId };
5
+ export { selectClearTestId, selectMultiValueLabelTestId };
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;CAE7B,CAAC;AAuBF,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AA8BF;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,GAAI,oCAAoC,YAAY,4CAgBvE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,qLAtBmC,YAAY,4FA0BvE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;WAA4B,MAAM;yDA/BA,YAAY,4FA0CvE,CAAC"}
1
+ {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,iBAAiB;;CAE7B,CAAC;AAuBF,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AA8BF;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,GAAI,oCAAoC,YAAY,4CAsBvE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,qLA5BmC,YAAY,4FAgCvE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa;WAA4B,MAAM;yDArCA,YAAY,4FAgDvE,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { theme } from "../../design_system/theme.js";
2
+ import { spinnerTestIds } from "./spinner.test_ids.js";
2
3
  import styled, { keyframes } from "styled-components";
3
4
  import { jsx } from "react/jsx-runtime";
4
5
  //#region src/components/spinner/spinner.tsx
@@ -57,6 +58,8 @@ var Spinner = ({ loadingReason, small, ...props }) => {
57
58
  ...props,
58
59
  title: loadingReason,
59
60
  $small: small,
61
+ "data-testid": spinnerTestIds.SPINNER,
62
+ "aria-busy": "true",
60
63
  children: /* @__PURE__ */ jsx("svg", {
61
64
  className: spinnerClassNames.SPINNER,
62
65
  viewBox: "0 0 50 50",
@@ -0,0 +1,4 @@
1
+ export declare const spinnerTestIds: {
2
+ SPINNER: string;
3
+ };
4
+ //# sourceMappingURL=spinner.test_ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.test_ids.d.ts","sourceRoot":"","sources":["../../../src/components/spinner/spinner.test_ids.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;CAE1B,CAAC"}
@@ -0,0 +1,4 @@
1
+ //#region src/components/spinner/spinner.test_ids.ts
2
+ var spinnerTestIds = { SPINNER: "spinner" };
3
+ //#endregion
4
+ export { spinnerTestIds };
@@ -1 +1 @@
1
- {"version":3,"file":"tab.d.ts","sourceRoot":"","sources":["../../../src/components/tabs/tab.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAMhD,KAAK,cAAc,GAAG,IAAI,CAAC,eAAe,EAAE,IAAI,GAAG,SAAS,CAAC,GACzD,kBAAkB,GAClB,IAAI,CAAC,gBAAgB,EAAE,kBAAkB,GAAG,kBAAkB,CAAC,CAAC;AAEpE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,CAAC;AAE1D,MAAM,MAAM,OAAO,GAAG,cAAc,GAAG;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,IAAI,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GAAG,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG;IAC7B,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAA;KAAE,KAAK,IAAI,CAAC;CACpF,CAAC;AA4GF,eAAO,MAAM,cAAc;;;CAG1B,CAAC;AAoCF,eAAO,MAAM,GAAG,GAAI,kGAajB,QAAQ,4CAmCV,CAAC"}
@@ -171,7 +171,7 @@ var Tab = ({ variant = "default", id, to, Icon, title, chip, rollout, className,
171
171
  /* @__PURE__ */ jsx(TextShared, {
172
172
  size: tabVariantTextSize[variant],
173
173
  className: TAB_CLASSNAMES.TITLE,
174
- weight: "bold",
174
+ weight: active ? "bold" : "medium",
175
175
  as: "div",
176
176
  children: title
177
177
  }),
@@ -1 +1 @@
1
- bc3b48d394c5df371c9dc78be8a471aa11b29c60
1
+ 37571b60420478e87fb6d796de56c4a7bbfa7062
package/dist/index.js CHANGED
@@ -27,7 +27,8 @@ import { ActorAvatar, ActorAvatarInner, actorAvatarClassnames } from "./componen
27
27
  import { UserAvatar, userAvatarBaseClassNames } from "./components/avatar/user_avatar.js";
28
28
  import { CardContainer, cardContainerClassNames } from "./components/card_container/card_container.js";
29
29
  import { Link, StyledAsLink, hasUrlHttpProtocol, isUrlEmail, isUrlExternal, omitDomainAndProtocol } from "./components/link/link.js";
30
- import { BUTTON_COLOR_VARIANTS_CSS, BUTTON_SIZE_VARIANTS_CSS, Button, getButtonColorStyles, getButtonSizeStyles } from "./components/button/button.js";
30
+ import { BUTTON_COLOR_VARIANTS_CSS, BUTTON_SIZE_VARIANTS_CSS, getButtonColorStyles, getButtonSizeStyles } from "./components/button/button.style.js";
31
+ import { Button } from "./components/button/button.js";
31
32
  import { DangerMessage, InfoMessage, Message, SuccessMessage, WarningMessage, messageClassNames } from "./components/message/message.js";
32
33
  import { useFloatingMenu } from "./components/floating/menu_common.js";
33
34
  import { BADGE_SIZES, BADGE_VARIANTS, Badge } from "./components/badge/badge.js";
@@ -1,12 +1,12 @@
1
1
  import type { AriaAttributes } from 'react';
2
2
  import type React from 'react';
3
- import { type IconSize } from '@apify/ui-icons';
4
3
  import { type WithRequired } from '../../type_utils';
5
4
  import { type MarginSpacingProps, type RegularBoxProps } from '../box';
6
5
  import { type LinkProps } from '../link';
6
+ export { BUTTON_COLOR_VARIANTS_CSS, BUTTON_SIZE_VARIANTS_CSS, getButtonColorStyles, getButtonSizeStyles, } from './button.style';
7
7
  export type ButtonSize = 'extraLarge' | 'large' | 'medium' | 'small' | 'extraSmall';
8
- type ButtonColor = 'default' | 'success' | 'danger' | 'primaryBlack';
9
- type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
8
+ export type ButtonColor = 'default' | 'success' | 'danger' | 'primaryBlack';
9
+ export type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
10
10
  type ButtonType = 'button' | 'submit';
11
11
  export interface TransientButtonProps {
12
12
  size?: ButtonSize;
@@ -22,37 +22,10 @@ export interface RegularButtonProps {
22
22
  type?: ButtonType;
23
23
  }
24
24
  type ButtonAriaProps = Pick<AriaAttributes, 'aria-label' | 'aria-labelledby'>;
25
- export type CommonButtonProps = RegularButtonProps & ButtonAriaProps & TransientButtonProps & MarginSpacingProps;
25
+ export type CommonButtonProps = RegularButtonProps & ButtonAriaProps & TransientButtonProps & MarginSpacingProps & {
26
+ animated?: boolean;
27
+ };
26
28
  export type ButtonProps = CommonButtonProps & WithRequired<RegularBoxProps, 'onClick'>;
27
29
  export type AnchorButtonProps = CommonButtonProps & RegularBoxProps & LinkProps;
28
- type ButtonColorCombinations = {
29
- [Type in ButtonVariant]: {
30
- [Size in ButtonColor]: {
31
- textColor: string;
32
- borderColor: string;
33
- backgroundColor: string;
34
- actionTextColor?: string;
35
- actionBorderColor?: string;
36
- hoverColor?: string;
37
- hoverGradient?: string;
38
- activeColor?: string;
39
- activeTextColor?: string;
40
- };
41
- };
42
- };
43
- type ButtonSizeCombinations = {
44
- [Size in ButtonSize]: {
45
- typography: string;
46
- size: number;
47
- horizontalPadding: number;
48
- borderRadius: string;
49
- iconSize: IconSize;
50
- };
51
- };
52
- export declare const BUTTON_COLOR_VARIANTS_CSS: ButtonColorCombinations;
53
- export declare const BUTTON_SIZE_VARIANTS_CSS: ButtonSizeCombinations;
54
- export declare const getButtonColorStyles: (variant?: ButtonVariant, color?: ButtonColor) => import("styled-components").RuleSet<object>;
55
- export declare const getButtonSizeStyles: (size?: ButtonSize) => import("styled-components").RuleSet<object>;
56
30
  export declare const Button: React.ForwardRefExoticComponent<(ButtonProps | AnchorButtonProps) & React.RefAttributes<HTMLElement>>;
57
- export {};
58
31
  //# sourceMappingURL=button.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/components/button/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGlE,OAAO,EAAE,KAAK,YAAY,EAA2B,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAO,KAAK,kBAAkB,EAAE,KAAK,eAAe,EAAE,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,YAAY,CAAC;AACpF,KAAK,WAAW,GAAG,SAAS,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,SAAS,GAAG,QAAQ,GAAG,cAAc,CAAC;AAC5E,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;AACjE,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEtC,MAAM,WAAW,oBAAoB;IACjC,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED,MAAM,WAAW,kBAAkB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC7B,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,KAAK,eAAe,GAAG,IAAI,CAAC,cAAc,EAAE,YAAY,GAAG,iBAAiB,CAAC,CAAC;AAG9E,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAC9C,eAAe,GACf,oBAAoB,GACpB,kBAAkB,GAAG;IAEjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEN,MAAM,MAAM,WAAW,GAAG,iBAAiB,GAAG,YAAY,CAAC,eAAe,EAAE,SAAS,CAAC,CAAC;AAEvF,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAAG,eAAe,GAAG,SAAS,CAAC;AAOhF,eAAO,MAAM,MAAM,uGA6FjB,CAAC"}
@@ -1,225 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
- import styled, { css } from 'styled-components';
4
3
  import { ExternalLinkIcon } from '@apify/ui-icons';
5
- import { theme } from '../../design_system/theme';
6
4
  import {} from '../../type_utils';
7
5
  import { useSharedUiDependencies } from '../../ui_dependency_provider';
8
- import { Box } from '../box';
6
+ import {} from '../box';
9
7
  import { isUrlExternal, Link } from '../link';
8
+ import { AnimatedBorder, BUTTON_SIZE_VARIANTS_CSS, StyledButton } from './button.style';
9
+ export { BUTTON_COLOR_VARIANTS_CSS, BUTTON_SIZE_VARIANTS_CSS, getButtonColorStyles, getButtonSizeStyles, } from './button.style';
10
10
  // typeguard to distinguish between the two options for props
11
11
  function isAnchorButton(props) {
12
12
  return props.to !== undefined;
13
13
  }
14
- export const BUTTON_COLOR_VARIANTS_CSS = {
15
- primary: {
16
- default: {
17
- textColor: theme.color.neutral.textOnPrimary,
18
- backgroundColor: theme.color.primary.action,
19
- borderColor: theme.color.primary.action,
20
- hoverColor: theme.color.primary.actionHover,
21
- activeColor: theme.color.primary.actionActive,
22
- },
23
- success: {
24
- textColor: theme.color.neutral.textOnPrimary,
25
- backgroundColor: theme.color.success.action,
26
- borderColor: theme.color.success.action,
27
- hoverColor: theme.color.success.actionHover,
28
- activeColor: theme.color.success.actionActive,
29
- },
30
- danger: {
31
- textColor: theme.color.neutral.textOnPrimary,
32
- backgroundColor: theme.color.danger.action,
33
- borderColor: theme.color.danger.action,
34
- hoverColor: theme.color.danger.actionHover,
35
- activeColor: theme.color.danger.actionActive,
36
- },
37
- primaryBlack: {
38
- textColor: theme.color.neutral.textOnPrimary,
39
- backgroundColor: theme.color.primaryBlack.action,
40
- borderColor: theme.color.primaryBlack.action,
41
- hoverGradient: `linear-gradient(to bottom, color-mix(in srgb, ${theme.color.neutral.textOnPrimary} 16%, transparent), transparent)`,
42
- activeColor: theme.color.primaryBlack.actionActive,
43
- },
44
- },
45
- secondary: {
46
- default: {
47
- textColor: theme.color.neutral.text,
48
- backgroundColor: theme.color.neutral.backgroundMuted,
49
- borderColor: theme.color.neutral.border,
50
- hoverColor: theme.color.neutral.actionSecondaryHover,
51
- activeColor: theme.color.neutral.actionSecondaryActive,
52
- actionBorderColor: theme.color.neutral.border,
53
- },
54
- success: {
55
- textColor: theme.color.success.text,
56
- backgroundColor: theme.color.neutral.backgroundMuted,
57
- borderColor: theme.color.neutral.border,
58
- hoverColor: theme.color.success.actionHover,
59
- activeColor: theme.color.success.actionActive,
60
- actionTextColor: theme.color.neutral.background,
61
- },
62
- danger: {
63
- textColor: theme.color.danger.text,
64
- backgroundColor: theme.color.neutral.backgroundMuted,
65
- borderColor: theme.color.neutral.border,
66
- hoverColor: theme.color.danger.backgroundHover,
67
- actionBorderColor: theme.color.danger.borderSubtle,
68
- activeColor: theme.color.danger.actionActive,
69
- activeTextColor: theme.color.neutral.textOnPrimary,
70
- },
71
- primaryBlack: {
72
- textColor: theme.color.neutral.textOnPrimary,
73
- backgroundColor: theme.color.primaryBlack.action,
74
- borderColor: theme.color.primaryBlack.action,
75
- hoverGradient: `linear-gradient(to bottom, color-mix(in srgb, ${theme.color.neutral.textOnPrimary} 16%, transparent), transparent)`,
76
- activeColor: theme.color.primaryBlack.actionActive,
77
- },
78
- },
79
- tertiary: {
80
- default: {
81
- textColor: theme.color.neutral.text,
82
- backgroundColor: 'transparent',
83
- borderColor: 'transparent',
84
- // TODO: Not sure about these
85
- hoverColor: theme.color.neutral.hover,
86
- activeColor: theme.color.neutral.actionSecondaryActive,
87
- },
88
- success: {
89
- textColor: theme.color.success.text,
90
- backgroundColor: 'transparent',
91
- borderColor: 'transparent',
92
- hoverColor: theme.color.success.backgroundSubtleHover,
93
- activeColor: theme.color.success.backgroundSubtleActive,
94
- },
95
- danger: {
96
- textColor: theme.color.danger.text,
97
- backgroundColor: 'transparent',
98
- borderColor: 'transparent',
99
- hoverColor: theme.color.danger.backgroundSubtleHover,
100
- activeColor: theme.color.danger.backgroundSubtleActive,
101
- },
102
- primaryBlack: {
103
- textColor: theme.color.neutral.textOnPrimary,
104
- backgroundColor: theme.color.primaryBlack.action,
105
- borderColor: theme.color.primaryBlack.action,
106
- hoverGradient: `linear-gradient(to bottom, color-mix(in srgb, ${theme.color.neutral.textOnPrimary} 16%, transparent), transparent)`,
107
- activeColor: theme.color.primaryBlack.actionActive,
108
- },
109
- },
110
- };
111
- export const BUTTON_SIZE_VARIANTS_CSS = {
112
- extraLarge: {
113
- typography: theme.typography.shared.mobile.bodyMMedium,
114
- size: 40,
115
- horizontalPadding: 12,
116
- borderRadius: theme.radius.radius8,
117
- iconSize: '20',
118
- },
119
- large: {
120
- typography: theme.typography.shared.mobile.bodyMMedium,
121
- size: 36,
122
- horizontalPadding: 12,
123
- borderRadius: theme.radius.radius6,
124
- iconSize: '20',
125
- },
126
- medium: {
127
- typography: theme.typography.shared.mobile.bodyMMedium,
128
- size: 32,
129
- horizontalPadding: 12,
130
- borderRadius: theme.radius.radius6,
131
- iconSize: '20',
132
- },
133
- small: {
134
- typography: theme.typography.shared.mobile.bodySMedium,
135
- size: 28,
136
- horizontalPadding: 8,
137
- borderRadius: theme.radius.radius6,
138
- iconSize: '16',
139
- },
140
- extraSmall: {
141
- typography: theme.typography.shared.mobile.bodySMedium,
142
- size: 24,
143
- horizontalPadding: 6,
144
- borderRadius: theme.radius.radius6,
145
- iconSize: '16',
146
- },
147
- };
148
- export const getButtonColorStyles = (variant = 'primary', color = 'default') => {
149
- const { backgroundColor, borderColor, textColor, actionBorderColor, actionTextColor, hoverColor, hoverGradient, activeColor, activeTextColor, } = BUTTON_COLOR_VARIANTS_CSS[variant][color];
150
- return css `
151
- color: ${textColor};
152
- background-color: ${backgroundColor};
153
- border-color: ${borderColor};
154
-
155
- &:hover {
156
- color: ${actionTextColor || textColor};
157
- ${hoverGradient
158
- ? css `
159
- background-image: ${hoverGradient};
160
- background-color: ${backgroundColor};
161
- `
162
- : css `
163
- background-color: ${hoverColor};
164
- `}
165
- border-color: ${actionBorderColor || (hoverGradient ? borderColor : hoverColor)};
166
- }
167
-
168
- &:active {
169
- color: ${activeTextColor || actionTextColor || textColor};
170
- background-color: ${activeColor};
171
- ${hoverGradient && 'background-image: none;'}
172
- border-color: ${actionBorderColor || activeColor};
173
- }
174
-
175
- &:disabled {
176
- color: ${theme.color.neutral.textDisabled};
177
- background-color: ${variant === 'tertiary' ? 'transparent' : theme.color.neutral.disabled};
178
- border-color: ${variant === 'tertiary' ? 'transparent' : theme.color.neutral.disabled};
179
-
180
- cursor: default;
181
- }
182
- `;
183
- };
184
- export const getButtonSizeStyles = (size = 'medium') => {
185
- const { typography, size: height, horizontalPadding, borderRadius } = BUTTON_SIZE_VARIANTS_CSS[size];
186
- return css `
187
- ${typography};
188
- height: ${height}px;
189
- /* We just want to ensure padding on the sides. Height is set the the hard way for simplicity */
190
- padding: 0 ${horizontalPadding}px;
191
- border-radius: ${borderRadius};
192
- `;
193
- };
194
- const StyledButton = styled(Box) `
195
- /* Basic positioning */
196
- display: inline-flex;
197
- align-items: center;
198
- /* NOT sure about this. It needs to be set when we want 100% width button */
199
- /* Maybe we can add block property */
200
- justify-content: center;
201
- gap: ${theme.space.space4};
202
-
203
- /* Basic styles */
204
- white-space: nowrap;
205
- cursor: pointer;
206
- transition:
207
- border-color ${theme.transition.fastEaseOut},
208
- background-color ${theme.transition.fastEaseOut};
209
-
210
- /* Border is always defined, but it can be set to transparent */
211
- border-style: solid;
212
- border-width: 1px;
213
- border-color: transparent;
214
-
215
- /* Colors */
216
- ${(props) => getButtonColorStyles(props.$variant, props.$color)}
217
-
218
- /* Paddings & font size */
219
- ${(props) => getButtonSizeStyles(props.$size)}
220
- `;
221
14
  export const Button = forwardRef((props, ref) => {
222
- const { as, children, size = 'medium', color = 'default', variant = 'primary', type = 'button', LeftIcon, RightIcon, onClick, trackingId, trackingData, ...rest } = props;
15
+ const { as, children, size = 'medium', color = 'default', variant = 'primary', animated = false, type = 'button', LeftIcon, RightIcon, onClick, trackingId, trackingData, className, m, mt, mb, ml, mr, mx, my, ...rest } = props;
223
16
  const { trackClick, windowLocationHost } = useSharedUiDependencies();
224
17
  const trackedOnClick = (e) => {
225
18
  if (trackClick && trackingId)
@@ -227,16 +20,26 @@ export const Button = forwardRef((props, ref) => {
227
20
  if (onClick)
228
21
  onClick(e);
229
22
  };
230
- const { iconSize } = BUTTON_SIZE_VARIANTS_CSS[size];
231
- if (isAnchorButton(props)) {
232
- const isExternal = isUrlExternal(props.to, windowLocationHost);
233
- const EffectiveRightIcon = isExternal && !props.hideExternalIcon ? ExternalLinkIcon : RightIcon;
234
- return (_jsxs(StyledButton, { "$size": size, "$color": color, "$variant": variant,
235
- // If anchor is undefined, we just render it as a regular button
236
- forwardedAs: props.disabled ? 'button' : Link, ref: ref, onClick: trackedOnClick, to: props.to, ...rest,
237
- // If we want to show external icon, we use button's slot for icon
238
- hideExternalIcon: true, children: [LeftIcon && _jsx(LeftIcon, { size: iconSize }), children, EffectiveRightIcon && _jsx(EffectiveRightIcon, { size: iconSize })] }));
23
+ const { iconSize, borderRadius } = BUTTON_SIZE_VARIANTS_CSS[size];
24
+ // When animated, these are applied to the outer wrapper instead of the button (see below).
25
+ const layoutProps = { className, m, mt, mb, ml, mr, mx, my };
26
+ const renderButton = (buttonLayoutProps = {}) => {
27
+ if (isAnchorButton(props)) {
28
+ const isExternal = isUrlExternal(props.to, windowLocationHost);
29
+ const EffectiveRightIcon = isExternal && !props.hideExternalIcon ? ExternalLinkIcon : RightIcon;
30
+ return (_jsxs(StyledButton, { "$size": size, "$color": color, "$variant": variant,
31
+ // If anchor is undefined, we just render it as a regular button
32
+ forwardedAs: props.disabled ? 'button' : Link, ref: ref, onClick: trackedOnClick, to: props.to, ...rest, ...buttonLayoutProps,
33
+ // If we want to show external icon, we use button's slot for icon
34
+ hideExternalIcon: true, children: [LeftIcon && _jsx(LeftIcon, { size: iconSize }), children, EffectiveRightIcon && _jsx(EffectiveRightIcon, { size: iconSize })] }));
35
+ }
36
+ return (_jsxs(StyledButton, { "$size": size, "$color": color, "$variant": variant, forwardedAs: as || 'button', ref: ref, onClick: trackedOnClick, type: type, ...rest, ...buttonLayoutProps, children: [LeftIcon && _jsx(LeftIcon, { size: iconSize }), children, RightIcon && _jsx(RightIcon, { size: iconSize })] }));
37
+ };
38
+ // The animated shine sweep is only available for the primary variant.
39
+ // A disabled button should look inert, so it never shimmers.
40
+ if (animated && variant === 'primary' && !props.disabled) {
41
+ return (_jsx(AnimatedBorder, { forwardedAs: "span", "$radius": borderRadius, ...layoutProps, children: renderButton() }));
239
42
  }
240
- return (_jsxs(StyledButton, { "$size": size, "$color": color, "$variant": variant, forwardedAs: as || 'button', ref: ref, onClick: trackedOnClick, type: type, ...rest, children: [LeftIcon && _jsx(LeftIcon, { size: iconSize }), children, RightIcon && _jsx(RightIcon, { size: iconSize })] }));
43
+ return renderButton(layoutProps);
241
44
  });
242
45
  //# sourceMappingURL=button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../src/components/button/button.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAiB,MAAM,iBAAiB,CAAC;AAElE,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAA8C,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,GAAG,EAAiD,MAAM,QAAQ,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,IAAI,EAAkB,MAAM,SAAS,CAAC;AA+B9D,6DAA6D;AAC7D,SAAS,cAAc,CAAC,KAAsC;IAC1D,OAAQ,KAA2B,CAAC,EAAE,KAAK,SAAS,CAAC;AACzD,CAAC;AAoCD,MAAM,CAAC,MAAM,yBAAyB,GAA4B;IAC9D,OAAO,EAAE;QACL,OAAO,EAAE;YACL,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa;YAC5C,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM;YAC3C,WA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,IAAI,EAAE,QAAQ,GAAI,EACxC,QAAQ,EACR,SAAS,IAAI,KAAC,SAAS,IAAC,IAAI,EAAE,QAAQ,GAAI,IAChC,CAClB,CAAC;IACN,CAAC,CAAC;IAEF,sEAAsE;IACtE,6DAA6D;IAC7D,IAAI,QAAQ,IAAI,OAAO,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;QACvD,OAAO,CACH,KAAC,cAAc,IAAC,WAAW,EAAC,MAAM,aAAU,YAAY,KAAM,WAAW,YACpE,YAAY,EAAE,GACF,CACpB,CAAC;IACN,CAAC;IAED,OAAO,YAAY,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { type IconSize } from '@apify/ui-icons';
2
+ import { type WithTransientProps } from '../../type_utils';
3
+ import type { ButtonColor, ButtonSize, ButtonVariant, TransientButtonProps } from './button';
4
+ type ButtonColorCombinations = {
5
+ [Type in ButtonVariant]: {
6
+ [Size in ButtonColor]: {
7
+ textColor: string;
8
+ borderColor: string;
9
+ backgroundColor: string;
10
+ actionTextColor?: string;
11
+ actionBorderColor?: string;
12
+ hoverColor?: string;
13
+ hoverGradient?: string;
14
+ activeColor?: string;
15
+ activeTextColor?: string;
16
+ };
17
+ };
18
+ };
19
+ type ButtonSizeCombinations = {
20
+ [Size in ButtonSize]: {
21
+ typography: string;
22
+ size: number;
23
+ horizontalPadding: number;
24
+ borderRadius: string;
25
+ iconSize: IconSize;
26
+ };
27
+ };
28
+ export declare const BUTTON_COLOR_VARIANTS_CSS: ButtonColorCombinations;
29
+ export declare const BUTTON_SIZE_VARIANTS_CSS: ButtonSizeCombinations;
30
+ export declare const getButtonColorStyles: (variant?: ButtonVariant, color?: ButtonColor) => import("styled-components").RuleSet<object>;
31
+ export declare const getButtonSizeStyles: (size?: ButtonSize) => import("styled-components").RuleSet<object>;
32
+ export declare const StyledButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(import("..").BoxProps & import("react").RefAttributes<HTMLElement>) & import("styled-components/dist/types").BaseObject, WithTransientProps<Required<TransientButtonProps>>>> & string & Omit<import("react").ForwardRefExoticComponent<import("..").BoxProps & import("react").RefAttributes<HTMLElement>>, keyof import("react").Component<any, {}, any>>;
33
+ export declare const AnimatedBorder: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<(import("..").BoxProps & import("react").RefAttributes<HTMLElement>) & import("styled-components/dist/types").BaseObject, {
34
+ $radius: string;
35
+ }>> & string & Omit<import("react").ForwardRefExoticComponent<import("..").BoxProps & import("react").RefAttributes<HTMLElement>>, keyof import("react").Component<any, {}, any>>;
36
+ export {};
37
+ //# sourceMappingURL=button.style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.style.d.ts","sourceRoot":"","sources":["../../../../src/components/button/button.style.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAE7F,KAAK,uBAAuB,GAAG;KAC1B,IAAI,IAAI,aAAa,GAAG;SACpB,IAAI,IAAI,WAAW,GAAG;YACnB,SAAS,EAAE,MAAM,CAAC;YAClB,WAAW,EAAE,MAAM,CAAC;YACpB,eAAe,EAAE,MAAM,CAAC;YAGxB,eAAe,CAAC,EAAE,MAAM,CAAC;YAEzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;YAG3B,UAAU,CAAC,EAAE,MAAM,CAAC;YAEpB,aAAa,CAAC,EAAE,MAAM,CAAC;YAGvB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,eAAe,CAAC,EAAE,MAAM,CAAC;SAC5B;KACJ;CACJ,CAAC;AAEF,KAAK,sBAAsB,GAAG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