@jobber/components 6.20.8 → 6.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Banner/index.cjs +1 -0
- package/dist/Banner/index.mjs +1 -0
- package/dist/Button/Button.d.ts +8 -74
- package/dist/Button/Button.types.d.ts +85 -0
- package/dist/Button/ButtonInternals.d.ts +10 -0
- package/dist/Button/ButtonProvider.d.ts +10 -0
- package/dist/Button/index.cjs +4 -1
- package/dist/Button/index.d.ts +4 -1
- package/dist/Button/index.mjs +3 -2
- package/dist/Button/useButtonStyles.d.ts +17 -0
- package/dist/Button-cjs.js +67 -22
- package/dist/Button-es.js +67 -24
- package/dist/ButtonDismiss/index.cjs +2 -1
- package/dist/ButtonDismiss/index.mjs +2 -1
- package/dist/ButtonDismiss-cjs.js +1 -0
- package/dist/ButtonDismiss-es.js +1 -0
- package/dist/Card/index.cjs +1 -0
- package/dist/Card/index.mjs +1 -0
- package/dist/Chips/InternalChipDismissible/index.cjs +1 -1
- package/dist/Chips/InternalChipDismissible/index.mjs +1 -1
- package/dist/Chips/index.cjs +1 -1
- package/dist/Chips/index.mjs +1 -1
- package/dist/Combobox/components/ComboboxActivator/index.cjs +2 -2
- package/dist/Combobox/components/ComboboxActivator/index.mjs +2 -2
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/index.cjs +1 -0
- package/dist/Combobox/components/ComboboxContent/ComboboxContentHeader/index.mjs +1 -0
- package/dist/ComboboxActivator-cjs.js +1 -0
- package/dist/ComboboxActivator-es.js +1 -0
- package/dist/ComboboxContentHeader-cjs.js +1 -0
- package/dist/ComboboxContentHeader-es.js +1 -0
- package/dist/ConfirmationModal/index.cjs +1 -0
- package/dist/ConfirmationModal/index.mjs +1 -0
- package/dist/DataDump/index.cjs +1 -0
- package/dist/DataDump/index.mjs +1 -0
- package/dist/DataList/components/DataListActions/index.cjs +1 -0
- package/dist/DataList/components/DataListActions/index.mjs +1 -0
- package/dist/DataList/components/DataListBulkActions/index.cjs +1 -0
- package/dist/DataList/components/DataListBulkActions/index.mjs +1 -0
- package/dist/DataList/components/DataListHeader/index.cjs +1 -1
- package/dist/DataList/components/DataListHeader/index.mjs +1 -1
- package/dist/DataList/components/DataListItem/index.cjs +1 -1
- package/dist/DataList/components/DataListItem/index.mjs +1 -1
- package/dist/DataList/components/DataListItemActions/index.cjs +1 -0
- package/dist/DataList/components/DataListItemActions/index.mjs +1 -0
- package/dist/DataList/components/DataListItemActionsOverflow/index.cjs +2 -1
- package/dist/DataList/components/DataListItemActionsOverflow/index.mjs +2 -1
- package/dist/DataList/components/DataListItems/index.cjs +1 -1
- package/dist/DataList/components/DataListItems/index.mjs +1 -1
- package/dist/DataList/components/DataListLayout/index.cjs +1 -1
- package/dist/DataList/components/DataListLayout/index.mjs +1 -1
- package/dist/DataList/components/DataListLayoutActions/index.cjs +2 -2
- package/dist/DataList/components/DataListLayoutActions/index.mjs +2 -2
- package/dist/DataList/components/DataListLoadMore/index.cjs +1 -0
- package/dist/DataList/components/DataListLoadMore/index.mjs +1 -0
- package/dist/DataList/components/DataListSearch/index.cjs +1 -1
- package/dist/DataList/components/DataListSearch/index.mjs +1 -1
- package/dist/DataListActions-cjs.js +1 -0
- package/dist/DataListActions-es.js +1 -0
- package/dist/DataListEmptyState-cjs.js +1 -0
- package/dist/DataListEmptyState-es.js +1 -0
- package/dist/DataListItemActionsOverflow-cjs.js +1 -0
- package/dist/DataListItemActionsOverflow-es.js +1 -0
- package/dist/DataListLoadMore-cjs.js +1 -0
- package/dist/DataListLoadMore-es.js +1 -0
- package/dist/DatePicker/index.cjs +1 -0
- package/dist/DatePicker/index.mjs +1 -0
- package/dist/Drawer/index.cjs +1 -0
- package/dist/Drawer/index.mjs +1 -0
- package/dist/FeatureSwitch/index.cjs +1 -0
- package/dist/FeatureSwitch/index.mjs +1 -0
- package/dist/FormField/index.cjs +1 -1
- package/dist/FormField/index.mjs +1 -1
- package/dist/FormatFile/index.cjs +1 -1
- package/dist/FormatFile/index.mjs +1 -1
- package/dist/InputAvatar/index.cjs +2 -2
- package/dist/InputAvatar/index.mjs +2 -2
- package/dist/InputAvatar-cjs.js +1 -0
- package/dist/InputAvatar-es.js +1 -0
- package/dist/InputDate/index.cjs +3 -3
- package/dist/InputDate/index.mjs +3 -3
- package/dist/InputEmail/index.cjs +1 -1
- package/dist/InputEmail/index.mjs +1 -1
- package/dist/InputEmail-cjs.js +1 -1
- package/dist/InputEmail-es.js +1 -1
- package/dist/InputFile/InputFile.d.ts +20 -2
- package/dist/InputFile/InputFileButton.d.ts +5 -0
- package/dist/InputFile/InputFileContentContext.d.ts +12 -0
- package/dist/InputFile/InputFileDescription.d.ts +3 -0
- package/dist/InputFile/InputFileDropzoneWrapper.d.ts +4 -0
- package/dist/InputFile/InputFileHintText.d.ts +3 -0
- package/dist/InputFile/InputFileValidationErrors.d.ts +4 -0
- package/dist/InputFile/index.cjs +6 -4
- package/dist/InputFile/index.d.ts +1 -0
- package/dist/InputFile/index.mjs +5 -5
- package/dist/InputFile/types.d.ts +4 -0
- package/dist/InputFile-cjs.js +90 -26
- package/dist/InputFile-es.js +91 -29
- package/dist/InputNumber/index.cjs +1 -1
- package/dist/InputNumber/index.mjs +1 -1
- package/dist/InputNumber-cjs.js +1 -1
- package/dist/InputNumber-es.js +1 -1
- package/dist/InputPassword/index.cjs +1 -1
- package/dist/InputPassword/index.mjs +1 -1
- package/dist/InputPassword-cjs.js +1 -1
- package/dist/InputPassword-es.js +1 -1
- package/dist/InputPhoneNumber-cjs.js +1 -1
- package/dist/InputPhoneNumber-es.js +1 -1
- package/dist/InputText/index.cjs +3 -3
- package/dist/InputText/index.mjs +3 -3
- package/dist/InputTime-cjs.js +1 -1
- package/dist/InputTime-es.js +1 -1
- package/dist/LightBox/index.cjs +1 -0
- package/dist/LightBox/index.mjs +1 -0
- package/dist/Menu/index.cjs +1 -0
- package/dist/Menu/index.mjs +1 -0
- package/dist/Modal/index.cjs +1 -0
- package/dist/Modal/index.mjs +1 -0
- package/dist/Option-cjs.js +1 -1
- package/dist/Option-es.js +1 -1
- package/dist/Page/index.cjs +1 -0
- package/dist/Page/index.mjs +1 -0
- package/dist/Popover/index.cjs +1 -0
- package/dist/Popover/index.mjs +1 -0
- package/dist/RecurringSelect/index.cjs +1 -1
- package/dist/RecurringSelect/index.mjs +1 -1
- package/dist/Select/index.cjs +1 -1
- package/dist/Select/index.mjs +1 -1
- package/dist/SideDrawer/index.cjs +1 -0
- package/dist/SideDrawer/index.mjs +1 -0
- package/dist/Text/Text.d.ts +1 -2
- package/dist/Text/index.d.ts +1 -0
- package/dist/Toast/index.cjs +2 -1
- package/dist/Toast/index.mjs +2 -1
- package/dist/Typography/Typography.d.ts +1 -2
- package/dist/index.cjs +4 -0
- package/dist/index.mjs +2 -2
- package/dist/showToast-cjs.js +1 -0
- package/dist/showToast-es.js +1 -0
- package/dist/styles.css +10 -17
- package/dist/utils/meta/meta.json +8 -0
- package/package.json +2 -2
package/dist/Banner/index.cjs
CHANGED
package/dist/Banner/index.mjs
CHANGED
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,74 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
readonly ariaLabel?: string;
|
|
11
|
-
readonly ariaControls?: string;
|
|
12
|
-
readonly ariaHaspopup?: boolean;
|
|
13
|
-
readonly ariaExpanded?: boolean;
|
|
14
|
-
readonly disabled?: boolean;
|
|
15
|
-
readonly external?: boolean;
|
|
16
|
-
readonly fullWidth?: boolean;
|
|
17
|
-
readonly icon?: IconNames;
|
|
18
|
-
readonly iconOnRight?: boolean;
|
|
19
|
-
readonly id?: string;
|
|
20
|
-
readonly label?: string;
|
|
21
|
-
readonly loading?: boolean;
|
|
22
|
-
readonly size?: "small" | "base" | "large";
|
|
23
|
-
onClick?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
24
|
-
onMouseDown?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
25
|
-
}
|
|
26
|
-
interface ButtonIconProps extends ButtonFoundationProps {
|
|
27
|
-
readonly icon: IconNames;
|
|
28
|
-
readonly ariaLabel: string;
|
|
29
|
-
}
|
|
30
|
-
interface ButtonLabelProps extends ButtonFoundationProps {
|
|
31
|
-
readonly label: string;
|
|
32
|
-
}
|
|
33
|
-
interface ButtonAnchorProps extends ButtonFoundationProps {
|
|
34
|
-
/**
|
|
35
|
-
* Used to create an 'href' on an anchor tag.
|
|
36
|
-
*/
|
|
37
|
-
readonly url?: string;
|
|
38
|
-
}
|
|
39
|
-
interface ButtonLinkProps<S = unknown> extends ButtonFoundationProps {
|
|
40
|
-
/**
|
|
41
|
-
* **Deprecated**: to will be removed in the next major version
|
|
42
|
-
* @deprecated
|
|
43
|
-
*/
|
|
44
|
-
readonly to?: LinkProps<S>["to"];
|
|
45
|
-
}
|
|
46
|
-
interface BaseActionProps extends ButtonFoundationProps {
|
|
47
|
-
readonly variation?: "work" | "learning" | "subtle" | "destructive";
|
|
48
|
-
readonly type?: "primary" | "secondary" | "tertiary";
|
|
49
|
-
}
|
|
50
|
-
interface DestructiveActionProps extends ButtonFoundationProps {
|
|
51
|
-
readonly variation: "destructive";
|
|
52
|
-
readonly type?: "primary" | "secondary" | "tertiary";
|
|
53
|
-
}
|
|
54
|
-
interface SubmitActionProps extends Omit<BaseActionProps, "external" | "onClick"> {
|
|
55
|
-
readonly name?: string;
|
|
56
|
-
readonly submit: boolean;
|
|
57
|
-
readonly type?: "primary" | "secondary" | "tertiary";
|
|
58
|
-
readonly value?: string;
|
|
59
|
-
}
|
|
60
|
-
interface SubmitButtonProps extends Omit<ButtonFoundationProps, "external" | "onClick"> {
|
|
61
|
-
/**
|
|
62
|
-
* Allows the button to submit a form
|
|
63
|
-
*/
|
|
64
|
-
submit: boolean;
|
|
65
|
-
}
|
|
66
|
-
interface BasicButtonProps extends ButtonFoundationProps {
|
|
67
|
-
/**
|
|
68
|
-
* Used to override the default button role.
|
|
69
|
-
*/
|
|
70
|
-
readonly role?: string;
|
|
71
|
-
}
|
|
72
|
-
export type ButtonProps = XOR<BaseActionProps, XOR<DestructiveActionProps, SubmitActionProps>> & XOR<XOR<SubmitButtonProps, BasicButtonProps>, XOR<ButtonLinkProps, ButtonAnchorProps>> & XOR<ButtonIconProps, ButtonLabelProps>;
|
|
73
|
-
export declare function Button(props: ButtonProps): JSX.Element;
|
|
74
|
-
export {};
|
|
1
|
+
import { ButtonProps } from "./Button.types";
|
|
2
|
+
import { ButtonIcon, ButtonLabel } from "./ButtonInternals";
|
|
3
|
+
declare function Button(props: ButtonProps): JSX.Element;
|
|
4
|
+
declare namespace Button {
|
|
5
|
+
var Label: typeof ButtonLabel;
|
|
6
|
+
var Icon: typeof ButtonIcon;
|
|
7
|
+
}
|
|
8
|
+
export { Button, ButtonProps };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { IconNames } from "@jobber/design";
|
|
2
|
+
import { LinkProps } from "react-router-dom";
|
|
3
|
+
import { XOR } from "ts-xor";
|
|
4
|
+
export type HTMLButtonType = "button" | "submit";
|
|
5
|
+
export type ButtonVariation = "work" | "learning" | "subtle" | "destructive";
|
|
6
|
+
export type ButtonSize = "small" | "base" | "large";
|
|
7
|
+
export type ButtonType = "primary" | "secondary" | "tertiary";
|
|
8
|
+
export interface ButtonFoundationProps {
|
|
9
|
+
/**
|
|
10
|
+
* Used for screen readers. Will override label on screen
|
|
11
|
+
* reader if present.
|
|
12
|
+
*/
|
|
13
|
+
readonly ariaControls?: string;
|
|
14
|
+
readonly ariaHaspopup?: boolean;
|
|
15
|
+
readonly ariaExpanded?: boolean;
|
|
16
|
+
readonly disabled?: boolean;
|
|
17
|
+
readonly external?: boolean;
|
|
18
|
+
readonly fullWidth?: boolean;
|
|
19
|
+
readonly id?: string;
|
|
20
|
+
readonly loading?: boolean;
|
|
21
|
+
readonly size?: ButtonSize;
|
|
22
|
+
readonly ariaLabel?: string;
|
|
23
|
+
onClick?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
24
|
+
onMouseDown?(event: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;
|
|
25
|
+
}
|
|
26
|
+
interface ButtonNonComposableProps extends ButtonFoundationProps {
|
|
27
|
+
readonly icon?: IconNames;
|
|
28
|
+
readonly iconOnRight?: boolean;
|
|
29
|
+
readonly label?: string;
|
|
30
|
+
}
|
|
31
|
+
interface ButtonIconProps extends ButtonNonComposableProps {
|
|
32
|
+
readonly icon: IconNames;
|
|
33
|
+
readonly ariaLabel: string;
|
|
34
|
+
}
|
|
35
|
+
interface ButtonLabelProps extends ButtonNonComposableProps {
|
|
36
|
+
readonly label: string;
|
|
37
|
+
}
|
|
38
|
+
interface ButtonAnchorProps extends ButtonFoundationProps {
|
|
39
|
+
/**
|
|
40
|
+
* Used to create an 'href' on an anchor tag.
|
|
41
|
+
*/
|
|
42
|
+
readonly url?: string;
|
|
43
|
+
}
|
|
44
|
+
interface ButtonLinkProps<S = unknown> extends ButtonFoundationProps {
|
|
45
|
+
/**
|
|
46
|
+
* **Deprecated**: to will be removed in the next major version
|
|
47
|
+
* @deprecated
|
|
48
|
+
*/
|
|
49
|
+
readonly to?: LinkProps<S>["to"];
|
|
50
|
+
}
|
|
51
|
+
interface BaseActionProps extends ButtonFoundationProps {
|
|
52
|
+
readonly variation?: ButtonVariation;
|
|
53
|
+
readonly type?: ButtonType;
|
|
54
|
+
}
|
|
55
|
+
interface DestructiveActionProps extends ButtonFoundationProps {
|
|
56
|
+
readonly variation: Extract<ButtonVariation, "destructive">;
|
|
57
|
+
readonly type?: ButtonType;
|
|
58
|
+
}
|
|
59
|
+
interface SubmitActionProps extends Omit<BaseActionProps, "external" | "onClick"> {
|
|
60
|
+
readonly name?: string;
|
|
61
|
+
readonly submit: boolean;
|
|
62
|
+
readonly type?: ButtonType;
|
|
63
|
+
readonly value?: string;
|
|
64
|
+
}
|
|
65
|
+
interface SubmitButtonProps extends Omit<ButtonFoundationProps, "external" | "onClick"> {
|
|
66
|
+
/**
|
|
67
|
+
* Allows the button to submit a form
|
|
68
|
+
*/
|
|
69
|
+
submit: boolean;
|
|
70
|
+
}
|
|
71
|
+
interface BasicButtonProps extends ButtonFoundationProps {
|
|
72
|
+
/**
|
|
73
|
+
* Used to override the default button role.
|
|
74
|
+
*/
|
|
75
|
+
readonly role?: string;
|
|
76
|
+
}
|
|
77
|
+
type BaseButtonProps = XOR<BaseActionProps, XOR<DestructiveActionProps, SubmitActionProps>> & XOR<XOR<SubmitButtonProps, BasicButtonProps>, XOR<ButtonLinkProps, ButtonAnchorProps>>;
|
|
78
|
+
export type ButtonWithChildrenProps = BaseButtonProps & {
|
|
79
|
+
readonly children: React.ReactNode;
|
|
80
|
+
};
|
|
81
|
+
export type ButtonWithoutChildrenProps = BaseButtonProps & XOR<ButtonIconProps, ButtonLabelProps> & {
|
|
82
|
+
readonly children?: never;
|
|
83
|
+
};
|
|
84
|
+
export type ButtonProps = XOR<ButtonWithChildrenProps, ButtonWithoutChildrenProps>;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ButtonProps } from "./Button.types";
|
|
2
|
+
import { IconProps } from "../Icon";
|
|
3
|
+
import { TypographyProps } from "../Typography";
|
|
4
|
+
/**
|
|
5
|
+
* For backwards compatibility with the legacy button
|
|
6
|
+
* @deprecated Used composed solution instead
|
|
7
|
+
*/
|
|
8
|
+
export declare function ButtonContent({ label, icon, size, iconOnRight, }: Pick<ButtonProps, "label" | "icon" | "size" | "iconOnRight">): JSX.Element;
|
|
9
|
+
export declare function ButtonIcon({ size: sizeProp, ...props }: Pick<IconProps, "size" | "name" | "testID">): JSX.Element;
|
|
10
|
+
export declare function ButtonLabel({ element, fontWeight, fontFamily, size: sizeProp, ...props }: Omit<TypographyProps, "textColor">): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { ButtonSize } from "./Button.types";
|
|
3
|
+
interface ButtonContextProps {
|
|
4
|
+
size: ButtonSize;
|
|
5
|
+
}
|
|
6
|
+
export declare function ButtonProvider({ children, size, }: PropsWithChildren<{
|
|
7
|
+
readonly size?: ButtonSize;
|
|
8
|
+
}>): JSX.Element;
|
|
9
|
+
export declare function useButton(): ButtonContextProps;
|
|
10
|
+
export {};
|
package/dist/Button/index.cjs
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var Button = require('../Button-cjs.js');
|
|
4
4
|
require('react');
|
|
5
|
-
require('classnames');
|
|
6
5
|
require('react-router-dom');
|
|
6
|
+
require('classnames');
|
|
7
|
+
require('../tslib.es6-cjs.js');
|
|
7
8
|
require('../Icon-cjs.js');
|
|
8
9
|
require('@jobber/design');
|
|
9
10
|
require('../Typography-cjs.js');
|
|
@@ -11,3 +12,5 @@ require('../Typography-cjs.js');
|
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
exports.Button = Button.Button;
|
|
15
|
+
exports.useButton = Button.useButton;
|
|
16
|
+
exports.useButtonStyles = Button.useButtonStyles;
|
package/dist/Button/index.d.ts
CHANGED
package/dist/Button/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { B as Button } from '../Button-es.js';
|
|
1
|
+
export { B as Button, a as useButton, u as useButtonStyles } from '../Button-es.js';
|
|
2
2
|
import 'react';
|
|
3
|
-
import 'classnames';
|
|
4
3
|
import 'react-router-dom';
|
|
4
|
+
import 'classnames';
|
|
5
|
+
import '../tslib.es6-es.js';
|
|
5
6
|
import '../Icon-es.js';
|
|
6
7
|
import '@jobber/design';
|
|
7
8
|
import '../Typography-es.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ButtonSize, ButtonType, ButtonVariation } from "./Button.types";
|
|
2
|
+
/**
|
|
3
|
+
* The props that are used to style the button
|
|
4
|
+
*/
|
|
5
|
+
export interface UseButtonStylesProps {
|
|
6
|
+
size?: ButtonSize;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
variation?: ButtonVariation;
|
|
11
|
+
type?: ButtonType;
|
|
12
|
+
}
|
|
13
|
+
export declare function useButtonStyles({ size: sizeProp, disabled, fullWidth, loading, variation, type, }: UseButtonStylesProps): {
|
|
14
|
+
wrapper: string;
|
|
15
|
+
children: string;
|
|
16
|
+
combined: string;
|
|
17
|
+
};
|
package/dist/Button-cjs.js
CHANGED
|
@@ -1,39 +1,49 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var classnames = require('classnames');
|
|
5
4
|
var reactRouterDom = require('react-router-dom');
|
|
5
|
+
var classnames = require('classnames');
|
|
6
|
+
var tslib_es6 = require('./tslib.es6-cjs.js');
|
|
6
7
|
var Icon = require('./Icon-cjs.js');
|
|
7
8
|
var Typography = require('./Typography-cjs.js');
|
|
8
9
|
|
|
9
|
-
var styles = {"button":"_7BLGtYNuJOU-","work":"amVSJ50CiOo-","learning":"V4GfDDF1ESI-","subtle":"MVT-qs-bO9M-","destructive":"_9YS8IK6Inew-","primary":"TrzCxs3OEpM-","disabled":"zgRx3ehZ2z8-","secondary":"QaWL8FLJ5Aw-","tertiary":"MhDYVRl8PUc-","small":"lPPuBfTJl5k-","base":"VyMJpVxCrxI-","large":"Uh29dvNk6I0-","
|
|
10
|
+
var styles = {"button":"_7BLGtYNuJOU-","work":"amVSJ50CiOo-","learning":"V4GfDDF1ESI-","subtle":"MVT-qs-bO9M-","destructive":"_9YS8IK6Inew-","primary":"TrzCxs3OEpM-","disabled":"zgRx3ehZ2z8-","secondary":"QaWL8FLJ5Aw-","tertiary":"MhDYVRl8PUc-","small":"lPPuBfTJl5k-","base":"VyMJpVxCrxI-","large":"Uh29dvNk6I0-","buttonChildren":"H8uYM7Udc4o-","fullWidth":"yBId-F-geAA-","loading":"NCs-BISj1XU-","animateStripes":"M0LU-Rdq-MA-","spinning":"IHmVqV9ionc-"};
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const ButtonContext = React.createContext({
|
|
13
|
+
size: "base",
|
|
14
|
+
});
|
|
15
|
+
function ButtonProvider({ children, size = "base", }) {
|
|
16
|
+
return (React.createElement(ButtonContext.Provider, { value: { size } }, children));
|
|
17
|
+
}
|
|
18
|
+
function useButton() {
|
|
19
|
+
return React.useContext(ButtonContext);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function useButtonStyles({ size: sizeProp, disabled, fullWidth, loading, variation = "work", type = "primary", }) {
|
|
23
|
+
const { size: contextSize } = useButton();
|
|
24
|
+
const size = sizeProp || contextSize;
|
|
25
|
+
const wrapper = classnames([styles.button, styles[size], styles[variation], styles[type]], {
|
|
19
26
|
[styles.disabled]: disabled,
|
|
20
27
|
[styles.fullWidth]: fullWidth,
|
|
21
28
|
[styles.loading]: loading,
|
|
22
29
|
});
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
const Tag = url ? "a" : "button";
|
|
31
|
-
return React.createElement(Tag, Object.assign({}, tagProps), buttonInternals);
|
|
30
|
+
const children = styles.buttonChildren;
|
|
31
|
+
return {
|
|
32
|
+
wrapper,
|
|
33
|
+
children,
|
|
34
|
+
combined: classnames(wrapper, children),
|
|
35
|
+
};
|
|
32
36
|
}
|
|
33
|
-
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* For backwards compatibility with the legacy button
|
|
40
|
+
* @deprecated Used composed solution instead
|
|
41
|
+
*/
|
|
42
|
+
function ButtonContent({ label, icon, size = "base", iconOnRight = false, }) {
|
|
34
43
|
return (React.createElement(React.Fragment, null,
|
|
35
|
-
icon && React.createElement(
|
|
36
|
-
React.createElement(
|
|
44
|
+
icon && !iconOnRight && React.createElement(ButtonIcon, { name: icon, size: size }),
|
|
45
|
+
label && React.createElement(ButtonLabel, { size: size }, label),
|
|
46
|
+
icon && iconOnRight && React.createElement(ButtonIcon, { name: icon, size: size })));
|
|
37
47
|
}
|
|
38
48
|
function getTypeSizes(size) {
|
|
39
49
|
switch (size) {
|
|
@@ -45,5 +55,40 @@ function getTypeSizes(size) {
|
|
|
45
55
|
return "base";
|
|
46
56
|
}
|
|
47
57
|
}
|
|
58
|
+
function ButtonIcon(_a) {
|
|
59
|
+
var { size: sizeProp } = _a, props = tslib_es6.__rest(_a, ["size"]);
|
|
60
|
+
const { size: contextSize } = useButton();
|
|
61
|
+
const size = sizeProp || contextSize;
|
|
62
|
+
return React.createElement(Icon.Icon, Object.assign({}, props, { size: size }));
|
|
63
|
+
}
|
|
64
|
+
function ButtonLabel(_a) {
|
|
65
|
+
var { element = "span", fontWeight = "semiBold", fontFamily = "base", size: sizeProp } = _a, props = tslib_es6.__rest(_a, ["element", "fontWeight", "fontFamily", "size"]);
|
|
66
|
+
const { size: contextSize } = useButton();
|
|
67
|
+
const size = sizeProp || contextSize;
|
|
68
|
+
return (React.createElement(Typography.Typography, Object.assign({ element: element, fontWeight: fontWeight, fontFamily: fontFamily, size: getTypeSizes(size) }, props)));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function Button(props) {
|
|
72
|
+
const { size } = props;
|
|
73
|
+
return (React.createElement(ButtonProvider, { size: size },
|
|
74
|
+
React.createElement(ButtonWrapper, Object.assign({}, props))));
|
|
75
|
+
}
|
|
76
|
+
function ButtonWrapper(props) {
|
|
77
|
+
const { ariaControls, ariaHaspopup, ariaExpanded, ariaLabel, disabled = false, external, id, name, onClick, onMouseDown, role, value, submit, to, url, } = props;
|
|
78
|
+
const { combined } = useButtonStyles(props);
|
|
79
|
+
const buttonType = submit ? "submit" : "button";
|
|
80
|
+
const tagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ className: combined, disabled,
|
|
81
|
+
id }, (submit && { name, value })), (!disabled && { href: url })), (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), (external && { target: "_blank" })), (url === undefined && to === undefined && { type: buttonType })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
|
|
82
|
+
const buttonInternals = props.children || React.createElement(ButtonContent, Object.assign({}, props));
|
|
83
|
+
if (to) {
|
|
84
|
+
return (React.createElement(reactRouterDom.Link, Object.assign({}, tagProps, { to: to }), buttonInternals));
|
|
85
|
+
}
|
|
86
|
+
const Tag = url ? "a" : "button";
|
|
87
|
+
return React.createElement(Tag, Object.assign({}, tagProps), buttonInternals);
|
|
88
|
+
}
|
|
89
|
+
Button.Label = ButtonLabel;
|
|
90
|
+
Button.Icon = ButtonIcon;
|
|
48
91
|
|
|
49
92
|
exports.Button = Button;
|
|
93
|
+
exports.useButton = useButton;
|
|
94
|
+
exports.useButtonStyles = useButtonStyles;
|
package/dist/Button-es.js
CHANGED
|
@@ -1,37 +1,47 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import classnames from 'classnames';
|
|
1
|
+
import React, { createContext, useContext } from 'react';
|
|
3
2
|
import { Link } from 'react-router-dom';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
import { _ as __rest } from './tslib.es6-es.js';
|
|
4
5
|
import { I as Icon } from './Icon-es.js';
|
|
5
6
|
import { T as Typography } from './Typography-es.js';
|
|
6
7
|
|
|
7
|
-
var styles = {"button":"_7BLGtYNuJOU-","work":"amVSJ50CiOo-","learning":"V4GfDDF1ESI-","subtle":"MVT-qs-bO9M-","destructive":"_9YS8IK6Inew-","primary":"TrzCxs3OEpM-","disabled":"zgRx3ehZ2z8-","secondary":"QaWL8FLJ5Aw-","tertiary":"MhDYVRl8PUc-","small":"lPPuBfTJl5k-","base":"VyMJpVxCrxI-","large":"Uh29dvNk6I0-","
|
|
8
|
+
var styles = {"button":"_7BLGtYNuJOU-","work":"amVSJ50CiOo-","learning":"V4GfDDF1ESI-","subtle":"MVT-qs-bO9M-","destructive":"_9YS8IK6Inew-","primary":"TrzCxs3OEpM-","disabled":"zgRx3ehZ2z8-","secondary":"QaWL8FLJ5Aw-","tertiary":"MhDYVRl8PUc-","small":"lPPuBfTJl5k-","base":"VyMJpVxCrxI-","large":"Uh29dvNk6I0-","buttonChildren":"H8uYM7Udc4o-","fullWidth":"yBId-F-geAA-","loading":"NCs-BISj1XU-","animateStripes":"M0LU-Rdq-MA-","spinning":"IHmVqV9ionc-"};
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const ButtonContext = createContext({
|
|
11
|
+
size: "base",
|
|
12
|
+
});
|
|
13
|
+
function ButtonProvider({ children, size = "base", }) {
|
|
14
|
+
return (React.createElement(ButtonContext.Provider, { value: { size } }, children));
|
|
15
|
+
}
|
|
16
|
+
function useButton() {
|
|
17
|
+
return useContext(ButtonContext);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function useButtonStyles({ size: sizeProp, disabled, fullWidth, loading, variation = "work", type = "primary", }) {
|
|
21
|
+
const { size: contextSize } = useButton();
|
|
22
|
+
const size = sizeProp || contextSize;
|
|
23
|
+
const wrapper = classnames([styles.button, styles[size], styles[variation], styles[type]], {
|
|
17
24
|
[styles.disabled]: disabled,
|
|
18
25
|
[styles.fullWidth]: fullWidth,
|
|
19
26
|
[styles.loading]: loading,
|
|
20
27
|
});
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
const Tag = url ? "a" : "button";
|
|
29
|
-
return React.createElement(Tag, Object.assign({}, tagProps), buttonInternals);
|
|
28
|
+
const children = styles.buttonChildren;
|
|
29
|
+
return {
|
|
30
|
+
wrapper,
|
|
31
|
+
children,
|
|
32
|
+
combined: classnames(wrapper, children),
|
|
33
|
+
};
|
|
30
34
|
}
|
|
31
|
-
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* For backwards compatibility with the legacy button
|
|
38
|
+
* @deprecated Used composed solution instead
|
|
39
|
+
*/
|
|
40
|
+
function ButtonContent({ label, icon, size = "base", iconOnRight = false, }) {
|
|
32
41
|
return (React.createElement(React.Fragment, null,
|
|
33
|
-
icon && React.createElement(
|
|
34
|
-
React.createElement(
|
|
42
|
+
icon && !iconOnRight && React.createElement(ButtonIcon, { name: icon, size: size }),
|
|
43
|
+
label && React.createElement(ButtonLabel, { size: size }, label),
|
|
44
|
+
icon && iconOnRight && React.createElement(ButtonIcon, { name: icon, size: size })));
|
|
35
45
|
}
|
|
36
46
|
function getTypeSizes(size) {
|
|
37
47
|
switch (size) {
|
|
@@ -43,5 +53,38 @@ function getTypeSizes(size) {
|
|
|
43
53
|
return "base";
|
|
44
54
|
}
|
|
45
55
|
}
|
|
56
|
+
function ButtonIcon(_a) {
|
|
57
|
+
var { size: sizeProp } = _a, props = __rest(_a, ["size"]);
|
|
58
|
+
const { size: contextSize } = useButton();
|
|
59
|
+
const size = sizeProp || contextSize;
|
|
60
|
+
return React.createElement(Icon, Object.assign({}, props, { size: size }));
|
|
61
|
+
}
|
|
62
|
+
function ButtonLabel(_a) {
|
|
63
|
+
var { element = "span", fontWeight = "semiBold", fontFamily = "base", size: sizeProp } = _a, props = __rest(_a, ["element", "fontWeight", "fontFamily", "size"]);
|
|
64
|
+
const { size: contextSize } = useButton();
|
|
65
|
+
const size = sizeProp || contextSize;
|
|
66
|
+
return (React.createElement(Typography, Object.assign({ element: element, fontWeight: fontWeight, fontFamily: fontFamily, size: getTypeSizes(size) }, props)));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function Button(props) {
|
|
70
|
+
const { size } = props;
|
|
71
|
+
return (React.createElement(ButtonProvider, { size: size },
|
|
72
|
+
React.createElement(ButtonWrapper, Object.assign({}, props))));
|
|
73
|
+
}
|
|
74
|
+
function ButtonWrapper(props) {
|
|
75
|
+
const { ariaControls, ariaHaspopup, ariaExpanded, ariaLabel, disabled = false, external, id, name, onClick, onMouseDown, role, value, submit, to, url, } = props;
|
|
76
|
+
const { combined } = useButtonStyles(props);
|
|
77
|
+
const buttonType = submit ? "submit" : "button";
|
|
78
|
+
const tagProps = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ className: combined, disabled,
|
|
79
|
+
id }, (submit && { name, value })), (!disabled && { href: url })), (!disabled && { onClick: onClick })), (!disabled && { onMouseDown: onMouseDown })), (external && { target: "_blank" })), (url === undefined && to === undefined && { type: buttonType })), { "aria-controls": ariaControls, "aria-haspopup": ariaHaspopup, "aria-expanded": ariaExpanded, "aria-label": ariaLabel, role: role });
|
|
80
|
+
const buttonInternals = props.children || React.createElement(ButtonContent, Object.assign({}, props));
|
|
81
|
+
if (to) {
|
|
82
|
+
return (React.createElement(Link, Object.assign({}, tagProps, { to: to }), buttonInternals));
|
|
83
|
+
}
|
|
84
|
+
const Tag = url ? "a" : "button";
|
|
85
|
+
return React.createElement(Tag, Object.assign({}, tagProps), buttonInternals);
|
|
86
|
+
}
|
|
87
|
+
Button.Label = ButtonLabel;
|
|
88
|
+
Button.Icon = ButtonIcon;
|
|
46
89
|
|
|
47
|
-
export { Button as B };
|
|
90
|
+
export { Button as B, useButton as a, useButtonStyles as u };
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
var ButtonDismiss = require('../ButtonDismiss-cjs.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('../Button-cjs.js');
|
|
6
|
-
require('classnames');
|
|
7
6
|
require('react-router-dom');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('../tslib.es6-cjs.js');
|
|
8
9
|
require('../Icon-cjs.js');
|
|
9
10
|
require('@jobber/design');
|
|
10
11
|
require('../Typography-cjs.js');
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { B as ButtonDismiss } from '../ButtonDismiss-es.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../Button-es.js';
|
|
4
|
-
import 'classnames';
|
|
5
4
|
import 'react-router-dom';
|
|
5
|
+
import 'classnames';
|
|
6
|
+
import '../tslib.es6-es.js';
|
|
6
7
|
import '../Icon-es.js';
|
|
7
8
|
import '@jobber/design';
|
|
8
9
|
import '../Typography-es.js';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var Button = require('./Button-cjs.js');
|
|
5
|
+
require('classnames');
|
|
5
6
|
|
|
6
7
|
function ButtonDismiss({ onClick, ariaLabel }) {
|
|
7
8
|
return (React.createElement(Button.Button, { ariaLabel: ariaLabel, icon: "remove", onClick: onClick, type: "tertiary", variation: "subtle" }));
|
package/dist/ButtonDismiss-es.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { B as Button } from './Button-es.js';
|
|
3
|
+
import 'classnames';
|
|
3
4
|
|
|
4
5
|
function ButtonDismiss({ onClick, ariaLabel }) {
|
|
5
6
|
return (React.createElement(Button, { ariaLabel: ariaLabel, icon: "remove", onClick: onClick, type: "tertiary", variation: "subtle" }));
|
package/dist/Card/index.cjs
CHANGED
package/dist/Card/index.mjs
CHANGED
|
@@ -25,6 +25,7 @@ require('../../Text-cjs.js');
|
|
|
25
25
|
require('../../Typography-cjs.js');
|
|
26
26
|
require('../../Button-cjs.js');
|
|
27
27
|
require('react-router-dom');
|
|
28
|
+
require('../../tslib.es6-cjs.js');
|
|
28
29
|
require('../../Spinner-cjs.js');
|
|
29
30
|
require('../../Chip-cjs.js');
|
|
30
31
|
require('../../useInView-cjs.js');
|
|
@@ -35,7 +36,6 @@ require('../../Tooltip-cjs.js');
|
|
|
35
36
|
require('react-dom');
|
|
36
37
|
require('framer-motion');
|
|
37
38
|
require('../../useIsMounted-cjs.js');
|
|
38
|
-
require('../../tslib.es6-cjs.js');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -23,6 +23,7 @@ import '../../Text-es.js';
|
|
|
23
23
|
import '../../Typography-es.js';
|
|
24
24
|
import '../../Button-es.js';
|
|
25
25
|
import 'react-router-dom';
|
|
26
|
+
import '../../tslib.es6-es.js';
|
|
26
27
|
import '../../Spinner-es.js';
|
|
27
28
|
import '../../Chip-es.js';
|
|
28
29
|
import '../../useInView-es.js';
|
|
@@ -33,4 +34,3 @@ import '../../Tooltip-es.js';
|
|
|
33
34
|
import 'react-dom';
|
|
34
35
|
import 'framer-motion';
|
|
35
36
|
import '../../useIsMounted-es.js';
|
|
36
|
-
import '../../tslib.es6-es.js';
|
package/dist/Chips/index.cjs
CHANGED
|
@@ -28,8 +28,8 @@ require('../Text-cjs.js');
|
|
|
28
28
|
require('../Typography-cjs.js');
|
|
29
29
|
require('../Button-cjs.js');
|
|
30
30
|
require('react-router-dom');
|
|
31
|
-
require('../Spinner-cjs.js');
|
|
32
31
|
require('../tslib.es6-cjs.js');
|
|
32
|
+
require('../Spinner-cjs.js');
|
|
33
33
|
require('../useInView-cjs.js');
|
|
34
34
|
require('../Avatar-cjs.js');
|
|
35
35
|
require('color');
|
package/dist/Chips/index.mjs
CHANGED
|
@@ -26,8 +26,8 @@ import '../Text-es.js';
|
|
|
26
26
|
import '../Typography-es.js';
|
|
27
27
|
import '../Button-es.js';
|
|
28
28
|
import 'react-router-dom';
|
|
29
|
-
import '../Spinner-es.js';
|
|
30
29
|
import '../tslib.es6-es.js';
|
|
30
|
+
import '../Spinner-es.js';
|
|
31
31
|
import '../useInView-es.js';
|
|
32
32
|
import '../Avatar-es.js';
|
|
33
33
|
import 'color';
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
var ComboboxActivator = require('../../../ComboboxActivator-cjs.js');
|
|
4
4
|
require('react');
|
|
5
5
|
require('../../../Button-cjs.js');
|
|
6
|
-
require('classnames');
|
|
7
6
|
require('react-router-dom');
|
|
7
|
+
require('classnames');
|
|
8
|
+
require('../../../tslib.es6-cjs.js');
|
|
8
9
|
require('../../../Icon-cjs.js');
|
|
9
10
|
require('@jobber/design');
|
|
10
11
|
require('../../../Typography-cjs.js');
|
|
@@ -19,7 +20,6 @@ require('framer-motion');
|
|
|
19
20
|
require('../../../useSafeLayoutEffect-cjs.js');
|
|
20
21
|
require('../../../useIsMounted-cjs.js');
|
|
21
22
|
require('react-popper');
|
|
22
|
-
require('../../../tslib.es6-cjs.js');
|
|
23
23
|
require('../../../ComboboxProvider-cjs.js');
|
|
24
24
|
require('../../../constants-cjs.js');
|
|
25
25
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export { C as ComboboxActivator } from '../../../ComboboxActivator-es.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '../../../Button-es.js';
|
|
4
|
-
import 'classnames';
|
|
5
4
|
import 'react-router-dom';
|
|
5
|
+
import 'classnames';
|
|
6
|
+
import '../../../tslib.es6-es.js';
|
|
6
7
|
import '../../../Icon-es.js';
|
|
7
8
|
import '@jobber/design';
|
|
8
9
|
import '../../../Typography-es.js';
|
|
@@ -17,6 +18,5 @@ import 'framer-motion';
|
|
|
17
18
|
import '../../../useSafeLayoutEffect-es.js';
|
|
18
19
|
import '../../../useIsMounted-es.js';
|
|
19
20
|
import 'react-popper';
|
|
20
|
-
import '../../../tslib.es6-es.js';
|
|
21
21
|
import '../../../ComboboxProvider-es.js';
|
|
22
22
|
import '../../../constants-es.js';
|