@alto-avios/alto-ui 2.4.0 → 3.1.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/README.md +13 -0
- package/dist/assets/AviosCurrencySymbol.css +1 -0
- package/dist/assets/Badge.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/CardSection.css +1 -1
- package/dist/assets/CreditCardNumberField.css +1 -0
- package/dist/assets/DateField.css +1 -1
- package/dist/assets/DetailsDisclosure.css +1 -0
- package/dist/assets/Dialog.css +1 -0
- package/dist/assets/Fieldset.css +1 -0
- package/dist/assets/FieldsetHeader.css +1 -0
- package/dist/assets/Form.css +1 -0
- package/dist/assets/Icon.css +1 -0
- package/dist/assets/IconBackdrop.css +1 -0
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Image.css +1 -0
- package/dist/assets/Link.css +1 -1
- package/dist/assets/NumberField.css +1 -1
- package/dist/assets/PasswordField.css +1 -0
- package/dist/assets/PhoneNumberField.css +1 -0
- package/dist/assets/Popover.css +1 -0
- package/dist/assets/Section.css +1 -1
- package/dist/assets/SelectNative.css +1 -0
- package/dist/assets/Slider.css +1 -0
- package/dist/assets/Switch.css +1 -0
- package/dist/assets/TextAreaField.css +1 -1
- package/dist/assets/ToggleButton.css +1 -1
- package/dist/assets/ToggleIconButton.css +1 -1
- package/dist/assets/backgroundColor.css +1 -0
- package/dist/assets/flex.css +1 -1
- package/dist/assets/focusStyles.css +1 -1
- package/dist/assets/foregroundColor.css +1 -0
- package/dist/assets/global.css +1 -1
- package/dist/assets/padding.css +1 -1
- package/dist/components/AviosCurrencySymbol/AviosCurrencySymbol.d.ts +25 -0
- package/dist/components/AviosCurrencySymbol/AviosCurrencySymbol.js +80 -0
- package/dist/components/AviosCurrencySymbol/AviosCurrencySymbol.js.map +1 -0
- package/dist/components/AviosCurrencySymbol/index.d.ts +1 -0
- package/dist/components/AviosCurrencySymbol/index.js +5 -0
- package/dist/components/Badge/Badge.js +11 -11
- package/dist/components/Box/Box.d.ts +21 -2
- package/dist/components/Box/Box.js +16 -4
- package/dist/components/Box/Box.js.map +1 -1
- package/dist/components/Button/Button.d.ts +128 -36
- package/dist/components/Button/Button.js +129 -66
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/CardSection/CardSection.d.ts +12 -6
- package/dist/components/CardSection/CardSection.js +9 -7
- package/dist/components/CardSection/CardSection.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +3 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/ClearFieldButton/ClearFieldButton.d.ts +4 -6
- package/dist/components/CreditCardNumberField/CreditCardNumberField.d.ts +29 -0
- package/dist/components/CreditCardNumberField/CreditCardNumberField.js +45 -0
- package/dist/components/CreditCardNumberField/CreditCardNumberField.js.map +1 -0
- package/dist/components/CreditCardNumberField/index.d.ts +1 -0
- package/dist/components/CreditCardNumberField/index.js +5 -0
- package/dist/components/CreditCardNumberField/index.js.map +1 -0
- package/dist/components/DateField/DateField.d.ts +4 -24
- package/dist/components/DateField/DateField.js +7 -19
- package/dist/components/DateField/DateField.js.map +1 -1
- package/dist/components/DetailsDisclosure/DetailsDisclosure.d.ts +33 -0
- package/dist/components/DetailsDisclosure/DetailsDisclosure.js +39 -0
- package/dist/components/DetailsDisclosure/DetailsDisclosure.js.map +1 -0
- package/dist/components/DetailsDisclosure/index.d.ts +2 -0
- package/dist/components/DetailsDisclosure/index.js +5 -0
- package/dist/components/DetailsDisclosure/index.js.map +1 -0
- package/dist/components/Dialog/Dialog.d.ts +46 -0
- package/dist/components/Dialog/Dialog.js +117 -0
- package/dist/components/Dialog/Dialog.js.map +1 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +5 -0
- package/dist/components/Dialog/index.js.map +1 -0
- package/dist/components/FieldError/FieldError.d.ts +1 -1
- package/dist/components/FieldError/FieldError.js +11 -8
- package/dist/components/FieldError/FieldError.js.map +1 -1
- package/dist/components/FieldHeader/index.d.ts +1 -0
- package/dist/components/Fieldset/Fieldset.d.ts +18 -0
- package/dist/components/Fieldset/Fieldset.js +24 -0
- package/dist/components/Fieldset/Fieldset.js.map +1 -0
- package/dist/components/Fieldset/index.d.ts +2 -0
- package/dist/components/Fieldset/index.js +5 -0
- package/dist/components/Fieldset/index.js.map +1 -0
- package/dist/components/FieldsetHeader/FieldsetHeader.d.ts +7 -0
- package/dist/components/FieldsetHeader/FieldsetHeader.js +21 -0
- package/dist/components/FieldsetHeader/FieldsetHeader.js.map +1 -0
- package/dist/components/FieldsetHeader/index.d.ts +1 -0
- package/dist/components/FieldsetHeader/index.js +5 -0
- package/dist/components/FieldsetHeader/index.js.map +1 -0
- package/dist/components/Form/Form.d.ts +7 -0
- package/dist/components/Form/Form.js +17 -0
- package/dist/components/Form/Form.js.map +1 -0
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/Form/index.js +5 -0
- package/dist/components/Form/index.js.map +1 -0
- package/dist/components/Heading/Heading.d.ts +26 -7
- package/dist/components/Heading/Heading.js +12 -5
- package/dist/components/Heading/Heading.js.map +1 -1
- package/dist/components/Icon/Icon.d.ts +30 -4
- package/dist/components/Icon/Icon.js +98 -5
- package/dist/components/Icon/Icon.js.map +1 -1
- package/dist/components/IconBackdrop/IconBackdrop.d.ts +24 -0
- package/dist/components/IconBackdrop/IconBackdrop.js +34 -0
- package/dist/components/IconBackdrop/IconBackdrop.js.map +1 -0
- package/dist/components/IconBackdrop/index.d.ts +1 -0
- package/dist/components/IconBackdrop/index.js +5 -0
- package/dist/components/IconBackdrop/index.js.map +1 -0
- package/dist/components/IconButton/IconButton.d.ts +13 -4
- package/dist/components/IconButton/IconButton.js +40 -31
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/Image/Image.d.ts +24 -0
- package/dist/components/Image/Image.js +135 -0
- package/dist/components/Image/Image.js.map +1 -0
- package/dist/components/Image/index.d.ts +1 -0
- package/dist/components/Image/index.js +5 -0
- package/dist/components/Image/index.js.map +1 -0
- package/dist/components/Link/Link.d.ts +32 -34
- package/dist/components/Link/Link.js +34 -22
- package/dist/components/Link/Link.js.map +1 -1
- package/dist/components/NumberField/NumberField.d.ts +4 -34
- package/dist/components/NumberField/NumberField.js +11 -19
- package/dist/components/NumberField/NumberField.js.map +1 -1
- package/dist/components/Paragraph/Paragraph.d.ts +9 -5
- package/dist/components/Paragraph/Paragraph.js +9 -4
- package/dist/components/Paragraph/Paragraph.js.map +1 -1
- package/dist/components/PasswordField/PasswordField.d.ts +30 -0
- package/dist/components/PasswordField/PasswordField.js +104 -0
- package/dist/components/PasswordField/PasswordField.js.map +1 -0
- package/dist/components/PasswordField/index.d.ts +1 -0
- package/dist/components/PasswordField/index.js +5 -0
- package/dist/components/PasswordField/index.js.map +1 -0
- package/dist/components/PhoneNumberField/PhoneNumberField.d.ts +53 -0
- package/dist/components/PhoneNumberField/PhoneNumberField.js +91 -0
- package/dist/components/PhoneNumberField/PhoneNumberField.js.map +1 -0
- package/dist/components/PhoneNumberField/index.d.ts +3 -0
- package/dist/components/PhoneNumberField/index.js +7 -0
- package/dist/components/PhoneNumberField/index.js.map +1 -0
- package/dist/components/Popover/Popover.d.ts +16 -0
- package/dist/components/Popover/Popover.js +68 -0
- package/dist/components/Popover/Popover.js.map +1 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Popover/index.js +5 -0
- package/dist/components/Popover/index.js.map +1 -0
- package/dist/components/Section/Section.d.ts +4 -3
- package/dist/components/Section/Section.js +18 -13
- package/dist/components/Section/Section.js.map +1 -1
- package/dist/components/SelectNative/SelectNative.d.ts +56 -0
- package/dist/components/SelectNative/SelectNative.js +40 -0
- package/dist/components/SelectNative/SelectNative.js.map +1 -0
- package/dist/components/SelectNative/index.d.ts +1 -0
- package/dist/components/SelectNative/index.js +5 -0
- package/dist/components/SelectNative/index.js.map +1 -0
- package/dist/components/Slider/Slider.d.ts +33 -0
- package/dist/components/Slider/Slider.js +113 -0
- package/dist/components/Slider/Slider.js.map +1 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +5 -0
- package/dist/components/Slider/index.js.map +1 -0
- package/dist/components/SubHeading/SubHeading.d.ts +26 -5
- package/dist/components/SubHeading/SubHeading.js +9 -4
- package/dist/components/SubHeading/SubHeading.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +7 -0
- package/dist/components/Switch/Switch.js +18 -0
- package/dist/components/Switch/Switch.js.map +1 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch/index.js +5 -0
- package/dist/components/Switch/index.js.map +1 -0
- package/dist/components/TagGroup/TagGroup.js +1 -1
- package/dist/components/TextAreaField/TextAreaField.d.ts +1 -1
- package/dist/components/TextAreaField/TextAreaField.js +6 -18
- package/dist/components/TextAreaField/TextAreaField.js.map +1 -1
- package/dist/components/TextField/TextField.d.ts +4 -31
- package/dist/components/TextField/TextField.js +7 -17
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/ToggleButton/ToggleButton.js +6 -6
- package/dist/components/ToggleIconButton/ToggleIconButton.d.ts +9 -1
- package/dist/components/ToggleIconButton/ToggleIconButton.js +15 -8
- package/dist/components/ToggleIconButton/ToggleIconButton.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts +5 -1
- package/dist/components/Tooltip/Tooltip.js +3 -2
- package/dist/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/_base/Field/Field.d.ts +16 -0
- package/dist/components/_base/Field/Field.js +29 -0
- package/dist/components/_base/Field/Field.js.map +1 -0
- package/dist/components/_base/Field/index.d.ts +2 -0
- package/dist/components/_base/Field/index.js +5 -0
- package/dist/components/_base/Field/index.js.map +1 -0
- package/dist/components/index.d.ts +15 -1
- package/dist/components/index.js +41 -14
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +41 -14
- package/dist/index.js.map +1 -1
- package/dist/react-number-format.es-DMLgWFZX.js +760 -0
- package/dist/react-number-format.es-DMLgWFZX.js.map +1 -0
- package/dist/utils/backgroundColor/backgroundColor.d.ts +8 -0
- package/dist/utils/backgroundColor/backgroundColor.js +102 -0
- package/dist/utils/backgroundColor/backgroundColor.js.map +1 -0
- package/dist/utils/border/border.d.ts +3 -3
- package/dist/utils/creditCard/creditCard.d.ts +7 -0
- package/dist/utils/creditCard/creditCard.js +25 -0
- package/dist/utils/creditCard/creditCard.js.map +1 -0
- package/dist/utils/flex/flex.d.ts +3 -3
- package/dist/utils/flex/flex.js +49 -35
- package/dist/utils/flex/flex.js.map +1 -1
- package/dist/utils/focus/focusStyles.d.ts +1 -1
- package/dist/utils/focus/focusStyles.js +2 -2
- package/dist/utils/foregroundColour/foregroundColor.d.ts +8 -0
- package/dist/utils/foregroundColour/foregroundColor.js +125 -0
- package/dist/utils/foregroundColour/foregroundColor.js.map +1 -0
- package/dist/utils/forms/formProps.d.ts +2 -0
- package/dist/utils/forms/formProps.js +2 -0
- package/dist/utils/forms/formProps.js.map +1 -0
- package/dist/utils/padding/padding.d.ts +7 -7
- package/dist/utils/padding/padding.js +98 -98
- package/dist/utils/phoneNumber/phoneNumber.d.ts +24 -0
- package/dist/utils/phoneNumber/phoneNumber.js +566 -0
- package/dist/utils/phoneNumber/phoneNumber.js.map +1 -0
- package/dist/utils/stories/iconPropsArgTypes.js +50 -13
- package/dist/utils/stories/iconPropsArgTypes.js.map +1 -1
- package/package.json +39 -19
- package/dist/assets/NewButton.css +0 -1
- package/dist/assets/backgroundColour.css +0 -1
- package/dist/assets/fgColor.css +0 -1
- package/dist/components/NewButton/NewButton.d.ts +0 -87
- package/dist/components/NewButton/NewButton.js +0 -189
- package/dist/components/NewButton/NewButton.js.map +0 -1
- package/dist/components/NewButton/index.d.ts +0 -1
- package/dist/components/NewButton/index.js +0 -5
- package/dist/utils/backgroundColour/backgroundColour.d.ts +0 -8
- package/dist/utils/backgroundColour/backgroundColour.js +0 -102
- package/dist/utils/backgroundColour/backgroundColour.js.map +0 -1
- package/dist/utils/fgColour/fgColor.d.ts +0 -5
- package/dist/utils/fgColour/fgColor.js +0 -84
- package/dist/utils/fgColour/fgColor.js.map +0 -1
- /package/dist/components/{NewButton → AviosCurrencySymbol}/index.js.map +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { FormProps as FormAriaProps } from 'react-aria-components';
|
|
3
|
+
export interface FormProps extends FormAriaProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare const Form: ({ children, ...props }: FormProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export default Form;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Form as Form$1 } from "react-aria-components";
|
|
3
|
+
import '../../assets/Form.css';const form = "_form_11vpr_1";
|
|
4
|
+
const styles = {
|
|
5
|
+
form
|
|
6
|
+
};
|
|
7
|
+
const Form = ({
|
|
8
|
+
children,
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(Form$1, { className: styles["form"], ...props, children });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
Form,
|
|
15
|
+
Form as default
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Form';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,20 +1,39 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
|
-
import {
|
|
3
|
+
import { ForegroundVariants } from '../../utils/foregroundColour/foregroundColor';
|
|
4
4
|
declare const heading: (props?: ({
|
|
5
|
-
size?: "lg" | "sm" | "xs" | "
|
|
6
|
-
textAlign?: "
|
|
5
|
+
size?: "lg" | "sm" | "xs" | "xl" | "md" | "xxs" | null | undefined;
|
|
6
|
+
textAlign?: "end" | "start" | "center" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
type HeadingVariants = VariantProps<typeof heading>;
|
|
9
|
-
type
|
|
10
|
-
type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span';
|
|
9
|
+
type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span' | 'legend';
|
|
11
10
|
type HeadingSize = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
12
11
|
export interface HeadingProps extends HeadingVariants {
|
|
12
|
+
/**
|
|
13
|
+
* children
|
|
14
|
+
*/
|
|
13
15
|
children: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* The heading element to render
|
|
18
|
+
*/
|
|
14
19
|
as?: HeadingLevel;
|
|
20
|
+
/**
|
|
21
|
+
* The size of the heading
|
|
22
|
+
*/
|
|
15
23
|
size?: HeadingSize;
|
|
16
|
-
|
|
24
|
+
/**
|
|
25
|
+
* The foreground color of the heading
|
|
26
|
+
*/
|
|
27
|
+
foregroundColor?: ForegroundVariants['foregroundColor'];
|
|
28
|
+
/**
|
|
29
|
+
* The foreground color of the heading
|
|
30
|
+
* @deprecated Use `foregroundColor` instead
|
|
31
|
+
*/
|
|
32
|
+
fgColor?: ForegroundVariants['foregroundColor'];
|
|
33
|
+
/**
|
|
34
|
+
* The text alignment of the heading
|
|
35
|
+
*/
|
|
17
36
|
textAlign?: 'start' | 'center' | 'end';
|
|
18
37
|
}
|
|
19
|
-
export declare const Heading: ({ children, as: Component, size, fgColor, textAlign, ...props }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const Heading: ({ children, as: Component, size, foregroundColor, fgColor, textAlign, ...props }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
39
|
export default Heading;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
3
|
-
import {
|
|
3
|
+
import { foregroundColorVariants } from "../../utils/foregroundColour/foregroundColor.js";
|
|
4
4
|
import '../../assets/Heading.css';const heading$1 = "_heading_15puj_1";
|
|
5
5
|
const xxs = "_xxs_15puj_8";
|
|
6
6
|
const xs = "_xs_15puj_15";
|
|
@@ -51,23 +51,30 @@ const DEFAULT_HEADING_SIZE_MAP = {
|
|
|
51
51
|
h4: "sm",
|
|
52
52
|
h5: "xs",
|
|
53
53
|
h6: "xxs",
|
|
54
|
-
span: "md"
|
|
54
|
+
span: "md",
|
|
55
55
|
// Default for span elements
|
|
56
|
+
legend: "sm"
|
|
57
|
+
// Default for legend elements
|
|
56
58
|
};
|
|
57
59
|
const Heading = ({
|
|
58
60
|
children,
|
|
59
61
|
as: Component = "h1",
|
|
60
62
|
size,
|
|
61
|
-
|
|
63
|
+
foregroundColor = "accentSecondary",
|
|
64
|
+
fgColor,
|
|
62
65
|
textAlign = "start",
|
|
63
66
|
...props
|
|
64
67
|
}) => {
|
|
65
68
|
const effectiveSize = size || DEFAULT_HEADING_SIZE_MAP[Component];
|
|
69
|
+
if (fgColor) {
|
|
70
|
+
console.warn("The `fgColor` prop has been deprecated. Please use `foregroundColor` instead.");
|
|
71
|
+
}
|
|
72
|
+
const resolvedFontColor = fgColor ?? foregroundColor ?? "accentSecondary";
|
|
66
73
|
return /* @__PURE__ */ jsx(Component, { className: `${heading({
|
|
67
74
|
size: effectiveSize,
|
|
68
75
|
textAlign
|
|
69
|
-
})} ${
|
|
70
|
-
|
|
76
|
+
})} ${foregroundColorVariants({
|
|
77
|
+
foregroundColor: resolvedFontColor
|
|
71
78
|
})}`, ...props, children });
|
|
72
79
|
};
|
|
73
80
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Heading.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { ForegroundVariants } from '../../utils/foregroundColour/foregroundColor';
|
|
2
|
+
import { BackgroundVariants } from '../../utils/backgroundColor/backgroundColor';
|
|
3
|
+
export type IconSize = '0.5x' | '0.75x' | '1x' | '1.25x' | '1.5x' | '2x' | '2.5x' | '3x' | '4x' | '5x' | '6x' | '7x' | '8x' | '9x' | '10x';
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated These sizes will be removed in the next major version. Use 1x instead.
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
8
|
+
export type DeprecatedIconSize = 'lg' | 'sm' | 'xs' | '2xs' | 'xl' | '2xl';
|
|
2
9
|
export interface IconProps {
|
|
3
10
|
/**
|
|
4
11
|
* What Icon to load from fontAwesome
|
|
@@ -8,11 +15,25 @@ export interface IconProps {
|
|
|
8
15
|
* The prefix of the icon to load.
|
|
9
16
|
* @default 'fas'
|
|
10
17
|
*/
|
|
11
|
-
iconPrefix?: 'fas' | 'far' | 'fal' | 'fab' | 'fad';
|
|
18
|
+
iconPrefix?: 'fas' | 'far' | 'fal' | 'fab' | 'fad' | 'fak';
|
|
19
|
+
/**
|
|
20
|
+
* The icon pack to load.
|
|
21
|
+
* Example: 'brands'
|
|
22
|
+
*/
|
|
23
|
+
iconPack?: string;
|
|
12
24
|
/**
|
|
13
25
|
* The size of the icon.
|
|
14
26
|
*/
|
|
15
|
-
iconSize?: IconSize;
|
|
27
|
+
iconSize?: IconSize | DeprecatedIconSize;
|
|
28
|
+
/**
|
|
29
|
+
* The color of the icon.
|
|
30
|
+
*/
|
|
31
|
+
color?: ForegroundVariants['foregroundColor'];
|
|
32
|
+
/**
|
|
33
|
+
* The padding of the icon.
|
|
34
|
+
* @default 'none'
|
|
35
|
+
*/
|
|
36
|
+
padding?: 'none' | 'fixedWidth' | 'square' | 'roomy';
|
|
16
37
|
/**
|
|
17
38
|
* Flip the icon horizontally, vertically, or both.
|
|
18
39
|
*/
|
|
@@ -54,6 +75,11 @@ export interface IconProps {
|
|
|
54
75
|
* Accessible text for the icon. If the icon is decorative, this can be omitted.
|
|
55
76
|
*/
|
|
56
77
|
ariaLabel?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Background color class for the icon used solely in iconBackdrop component
|
|
80
|
+
* @ignore
|
|
81
|
+
*/
|
|
82
|
+
privateBgColorVariant?: BackgroundVariants['backgroundColor'];
|
|
57
83
|
}
|
|
58
|
-
export declare const Icon: ({ iconName, iconPrefix, iconSize
|
|
84
|
+
export declare const Icon: ({ iconName, iconPrefix, iconSize, iconPack, color, padding, flip, fixedWidth, listItem, border, rotation, pull, spin, className, ariaLabel, privateBgColorVariant, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
85
|
export default Icon;
|
|
@@ -1,11 +1,92 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
2
3
|
import { useState, useEffect } from "react";
|
|
4
|
+
import { foregroundColorVariants } from "../../utils/foregroundColour/foregroundColor.js";
|
|
5
|
+
import { backgroundColorVariants } from "../../utils/backgroundColor/backgroundColor.js";
|
|
6
|
+
import '../../assets/Icon.css';const iconSize0_5x = "_iconSize0_5x_h11q1_8";
|
|
7
|
+
const iconSize0_75x = "_iconSize0_75x_h11q1_12";
|
|
8
|
+
const iconSize1_25x = "_iconSize1_25x_h11q1_16";
|
|
9
|
+
const iconSize1_5x = "_iconSize1_5x_h11q1_20";
|
|
10
|
+
const iconSize2_5x = "_iconSize2_5x_h11q1_24";
|
|
11
|
+
const iconSize1x = "_iconSize1x_h11q1_39";
|
|
12
|
+
const iconSize2x = "_iconSize2x_h11q1_54";
|
|
13
|
+
const iconSize3x = "_iconSize3x_h11q1_64";
|
|
14
|
+
const iconSize4x = "_iconSize4x_h11q1_69";
|
|
15
|
+
const iconSize5x = "_iconSize5x_h11q1_74";
|
|
16
|
+
const iconSize6x = "_iconSize6x_h11q1_79";
|
|
17
|
+
const iconSize7x = "_iconSize7x_h11q1_84";
|
|
18
|
+
const iconSize8x = "_iconSize8x_h11q1_89";
|
|
19
|
+
const iconSize9x = "_iconSize9x_h11q1_94";
|
|
20
|
+
const iconSize10x = "_iconSize10x_h11q1_99";
|
|
21
|
+
const icon$1 = "_icon_h11q1_1";
|
|
22
|
+
const fixedWidth = "_fixedWidth_h11q1_105";
|
|
23
|
+
const square = "_square_h11q1_109";
|
|
24
|
+
const roomy = "_roomy_h11q1_113";
|
|
25
|
+
const styles = {
|
|
26
|
+
"icon-wrapper": "_icon-wrapper_h11q1_1",
|
|
27
|
+
iconSize0_5x,
|
|
28
|
+
iconSize0_75x,
|
|
29
|
+
iconSize1_25x,
|
|
30
|
+
iconSize1_5x,
|
|
31
|
+
iconSize2_5x,
|
|
32
|
+
iconSize1x,
|
|
33
|
+
iconSize2x,
|
|
34
|
+
iconSize3x,
|
|
35
|
+
iconSize4x,
|
|
36
|
+
iconSize5x,
|
|
37
|
+
iconSize6x,
|
|
38
|
+
iconSize7x,
|
|
39
|
+
iconSize8x,
|
|
40
|
+
iconSize9x,
|
|
41
|
+
iconSize10x,
|
|
42
|
+
icon: icon$1,
|
|
43
|
+
fixedWidth,
|
|
44
|
+
square,
|
|
45
|
+
roomy
|
|
46
|
+
};
|
|
47
|
+
const icon = cva(styles.icon, {
|
|
48
|
+
variants: {
|
|
49
|
+
padding: {
|
|
50
|
+
none: "",
|
|
51
|
+
fixedWidth: styles.fixedWidth,
|
|
52
|
+
square: styles.square,
|
|
53
|
+
roomy: styles.roomy
|
|
54
|
+
},
|
|
55
|
+
iconSize: {
|
|
56
|
+
default: styles.iconSize1x,
|
|
57
|
+
"0.5x": styles.iconSize0_5x,
|
|
58
|
+
"0.75x": styles.iconSize0_75x,
|
|
59
|
+
"1x": styles.iconSize1x,
|
|
60
|
+
"1.25x": styles.iconSize1_25x,
|
|
61
|
+
"1.5x": styles.iconSize1_5x,
|
|
62
|
+
"2x": styles.iconSize2x,
|
|
63
|
+
"2.5x": styles.iconSize2_5x,
|
|
64
|
+
"3x": styles.iconSize3x,
|
|
65
|
+
"4x": styles.iconSize4x,
|
|
66
|
+
"5x": styles.iconSize5x,
|
|
67
|
+
"6x": styles.iconSize6x,
|
|
68
|
+
"7x": styles.iconSize7x,
|
|
69
|
+
"8x": styles.iconSize8x,
|
|
70
|
+
"9x": styles.iconSize9x,
|
|
71
|
+
"10x": styles.iconSize10x,
|
|
72
|
+
lg: styles.iconSize1_25x,
|
|
73
|
+
sm: styles.iconSize1x,
|
|
74
|
+
xs: styles.iconSize1x,
|
|
75
|
+
"2xs": styles.iconSize0_75x,
|
|
76
|
+
xl: styles.iconSize2x,
|
|
77
|
+
"2xl": styles.iconSize3x
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
3
81
|
const Icon = ({
|
|
4
82
|
iconName,
|
|
5
83
|
iconPrefix = "far",
|
|
6
|
-
iconSize
|
|
84
|
+
iconSize = "1x",
|
|
85
|
+
iconPack,
|
|
86
|
+
color,
|
|
87
|
+
padding = "none",
|
|
7
88
|
flip,
|
|
8
|
-
fixedWidth,
|
|
89
|
+
fixedWidth: fixedWidth2 = true,
|
|
9
90
|
listItem,
|
|
10
91
|
border,
|
|
11
92
|
rotation,
|
|
@@ -14,19 +95,31 @@ const Icon = ({
|
|
|
14
95
|
spin,
|
|
15
96
|
className,
|
|
16
97
|
ariaLabel,
|
|
98
|
+
privateBgColorVariant,
|
|
17
99
|
...props
|
|
18
100
|
}) => {
|
|
19
101
|
const [key, setKey] = useState(0);
|
|
20
102
|
useEffect(() => {
|
|
21
103
|
setKey((prevKey) => prevKey + 1);
|
|
22
|
-
}, [iconName, iconPrefix,
|
|
104
|
+
}, [iconName, iconPrefix, iconSize, iconPack, color, padding, flip, fixedWidth2, listItem, border, rotation, pull, spin, ariaLabel, privateBgColorVariant]);
|
|
105
|
+
const fontAwesomeSize = ["2x", "3x", "4x", "5x", "6x", "7x", "8x", "9x", "10x"].includes(iconSize || "") ? `fa-${iconSize}` : "";
|
|
106
|
+
const formatSize = (iconSize2) => `iconSize${iconSize2.replace(".", "_")}`;
|
|
107
|
+
const customSizeClass = iconSize && styles[formatSize(iconSize)];
|
|
23
108
|
const accessibilityProps = ariaLabel ? {
|
|
24
109
|
"aria-label": ariaLabel
|
|
25
110
|
} : {
|
|
26
111
|
"aria-label": iconName
|
|
27
112
|
};
|
|
28
|
-
const classNames = [iconPrefix, `fa-${iconName}`,
|
|
29
|
-
return /* @__PURE__ */ jsx("span", { className: `icon-wrapper ${
|
|
113
|
+
const classNames = [iconPrefix, `fa-${iconName}`, fontAwesomeSize, iconPack ? `fa-${iconPack}` : "", flip ? `fa-flip-${flip}` : "", fixedWidth2 ? "fa-fw" : "", listItem ? "fa-li" : "", border ? "fa-border" : "", rotation ? `fa-rotate-${rotation}` : "", pull ? `fa-pull-${pull}` : "", spin ? "fa-spin" : "", customSizeClass].filter(Boolean).join(" ");
|
|
114
|
+
return /* @__PURE__ */ jsx("span", { className: `icon-wrapper ${styles["icon-wrapper"]} ${className || ""} ${icon({
|
|
115
|
+
iconSize
|
|
116
|
+
})}`, children: /* @__PURE__ */ jsx("i", { className: `${classNames} ${icon({
|
|
117
|
+
padding
|
|
118
|
+
})} ${foregroundColorVariants({
|
|
119
|
+
foregroundColor: color
|
|
120
|
+
})} ${backgroundColorVariants({
|
|
121
|
+
backgroundColor: privateBgColorVariant ?? "transparent"
|
|
122
|
+
})}`, ...accessibilityProps, ...props, role: "img" }) }, key);
|
|
30
123
|
};
|
|
31
124
|
export {
|
|
32
125
|
Icon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BackgroundVariants } from '../../utils/backgroundColor/backgroundColor';
|
|
2
|
+
import { IconProps } from '../Icon/Icon';
|
|
3
|
+
export interface IconBackdropProps {
|
|
4
|
+
/**
|
|
5
|
+
* The shape of the backdrop
|
|
6
|
+
* @default 'squircle'
|
|
7
|
+
*/
|
|
8
|
+
backdropShape?: 'circle' | 'squircle';
|
|
9
|
+
/**
|
|
10
|
+
* The colour of the backdrop
|
|
11
|
+
* @default 'accentSubtle'
|
|
12
|
+
*/
|
|
13
|
+
backdropColor?: BackgroundVariants['backgroundColor'];
|
|
14
|
+
/**
|
|
15
|
+
* The size of the backdrop
|
|
16
|
+
*/
|
|
17
|
+
iconSize?: IconProps['iconSize'];
|
|
18
|
+
/**
|
|
19
|
+
* The icon properties
|
|
20
|
+
*/
|
|
21
|
+
iconProps?: Omit<IconProps, 'iconSize' | 'padding'>;
|
|
22
|
+
}
|
|
23
|
+
export declare const IconBackdrop: ({ backdropShape, backdropColor, iconSize, iconProps, }: IconBackdropProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export default IconBackdrop;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
3
|
+
import { Icon } from "../Icon/Icon.js";
|
|
4
|
+
import '../../assets/IconBackdrop.css';const iconBackdrop$1 = "_iconBackdrop_1e7m2_1";
|
|
5
|
+
const squircle = "_squircle_1e7m2_7";
|
|
6
|
+
const circle = "_circle_1e7m2_11";
|
|
7
|
+
const styles = {
|
|
8
|
+
iconBackdrop: iconBackdrop$1,
|
|
9
|
+
squircle,
|
|
10
|
+
circle
|
|
11
|
+
};
|
|
12
|
+
const iconBackdrop = cva(styles.iconBackdrop, {
|
|
13
|
+
variants: {
|
|
14
|
+
backdropShape: {
|
|
15
|
+
circle: styles.circle,
|
|
16
|
+
squircle: styles.squircle
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const IconBackdrop = ({
|
|
21
|
+
backdropShape = "squircle",
|
|
22
|
+
backdropColor = "accentSubtle",
|
|
23
|
+
iconSize = "2x",
|
|
24
|
+
iconProps = {}
|
|
25
|
+
}) => {
|
|
26
|
+
return /* @__PURE__ */ jsx("span", { className: `${iconBackdrop({
|
|
27
|
+
backdropShape
|
|
28
|
+
})}`, children: /* @__PURE__ */ jsx(Icon, { padding: "roomy", iconName: iconProps.iconName ?? "plane-up", ...iconProps, iconSize, privateBgColorVariant: backdropColor }) });
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
IconBackdrop,
|
|
32
|
+
IconBackdrop as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=IconBackdrop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconBackdrop.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './IconBackdrop';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PressEvent } from 'react-aria-components';
|
|
2
2
|
import { ButtonProps } from '../Button/Button';
|
|
3
3
|
import { IconProps } from '../Icon/Icon';
|
|
4
|
-
|
|
4
|
+
import { FormProps } from '../../utils/forms/formProps';
|
|
5
|
+
export interface IconButtonProps extends Omit<ButtonProps<'button'>, 'onClick'>, FormProps {
|
|
5
6
|
/**
|
|
6
7
|
* What icon from fontAwesome to use with all options
|
|
7
8
|
*/
|
|
@@ -11,13 +12,21 @@ export interface IconButtonProps extends ButtonProps {
|
|
|
11
12
|
*/
|
|
12
13
|
isLoading?: boolean;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Handler to be called when the button is clicked.
|
|
15
16
|
*/
|
|
16
17
|
onClick?: (e: PressEvent) => void;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* The Slot of the button
|
|
19
20
|
*/
|
|
20
21
|
slot?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Tooltip text to display on hover and focus
|
|
24
|
+
*/
|
|
25
|
+
tooltipLabel?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Tooltip placement relative to the button
|
|
28
|
+
*/
|
|
29
|
+
tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';
|
|
21
30
|
}
|
|
22
|
-
export declare const IconButton: (
|
|
31
|
+
export declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
23
32
|
export default IconButton;
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
3
|
-
import { useRef, useState, useEffect } from "react";
|
|
3
|
+
import { forwardRef, useRef, useState, useEffect } from "react";
|
|
4
4
|
import { Button } from "react-aria-components";
|
|
5
5
|
import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
|
|
6
6
|
import { Icon } from "../Icon/Icon.js";
|
|
7
7
|
import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
8
|
+
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
9
|
+
import '../../assets/IconButton.css';const iconButton$1 = "_iconButton_kb1oz_1";
|
|
10
|
+
const sm = "_sm_kb1oz_24";
|
|
11
|
+
const md = "_md_kb1oz_30";
|
|
12
|
+
const lg = "_lg_kb1oz_36";
|
|
13
|
+
const accentPrimary = "_accentPrimary_kb1oz_46";
|
|
14
|
+
const accentSecondary = "_accentSecondary_kb1oz_69";
|
|
15
|
+
const accentTertiary = "_accentTertiary_kb1oz_98";
|
|
16
|
+
const accentQuaternary = "_accentQuaternary_kb1oz_127";
|
|
17
|
+
const criticalPrimary = "_criticalPrimary_kb1oz_151";
|
|
18
|
+
const criticalSecondary = "_criticalSecondary_kb1oz_175";
|
|
19
|
+
const criticalTertiary = "_criticalTertiary_kb1oz_204";
|
|
20
|
+
const criticalQuaternary = "_criticalQuaternary_kb1oz_229";
|
|
21
|
+
const neutralPrimary = "_neutralPrimary_kb1oz_254";
|
|
22
|
+
const neutralSecondary = "_neutralSecondary_kb1oz_278";
|
|
23
|
+
const neutralTertiary = "_neutralTertiary_kb1oz_305";
|
|
24
|
+
const neutralQuaternary = "_neutralQuaternary_kb1oz_330";
|
|
25
|
+
const whitePrimary = "_whitePrimary_kb1oz_356";
|
|
26
|
+
const whiteSecondary = "_whiteSecondary_kb1oz_385";
|
|
27
|
+
const whiteTertiary = "_whiteTertiary_kb1oz_416";
|
|
28
|
+
const whiteQuaternary = "_whiteQuaternary_kb1oz_445";
|
|
28
29
|
const styles = {
|
|
29
30
|
iconButton: iconButton$1,
|
|
30
31
|
sm,
|
|
@@ -46,8 +47,8 @@ const styles = {
|
|
|
46
47
|
whiteSecondary,
|
|
47
48
|
whiteTertiary,
|
|
48
49
|
whiteQuaternary,
|
|
49
|
-
"fa-spinner-third": "_fa-spinner-
|
|
50
|
-
"icon-wrapper": "_icon-
|
|
50
|
+
"fa-spinner-third": "_fa-spinner-third_kb1oz_476",
|
|
51
|
+
"icon-wrapper": "_icon-wrapper_kb1oz_481"
|
|
51
52
|
};
|
|
52
53
|
const iconButton = cva(styles.iconButton, {
|
|
53
54
|
variants: {
|
|
@@ -85,9 +86,9 @@ const iconButton = cva(styles.iconButton, {
|
|
|
85
86
|
size: "md"
|
|
86
87
|
}
|
|
87
88
|
});
|
|
88
|
-
const IconButton = ({
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
const IconButton = forwardRef(({
|
|
90
|
+
styleType,
|
|
91
|
+
styleVariant,
|
|
91
92
|
emphasis = "primary",
|
|
92
93
|
size = "md",
|
|
93
94
|
isLoading = false,
|
|
@@ -108,8 +109,10 @@ const IconButton = ({
|
|
|
108
109
|
type,
|
|
109
110
|
focusStyle = "default",
|
|
110
111
|
slot,
|
|
112
|
+
tooltipLabel = "",
|
|
113
|
+
tooltipPlacement = "top",
|
|
111
114
|
...props
|
|
112
|
-
}) => {
|
|
115
|
+
}, ref) => {
|
|
113
116
|
const buttonRef = useRef(null);
|
|
114
117
|
const [buttonWidth, setButtonWidth] = useState(null);
|
|
115
118
|
useEffect(() => {
|
|
@@ -117,18 +120,24 @@ const IconButton = ({
|
|
|
117
120
|
setButtonWidth(buttonRef.current.offsetWidth);
|
|
118
121
|
}
|
|
119
122
|
}, [isLoading, size]);
|
|
120
|
-
|
|
123
|
+
const resolvedStyleVariant = styleVariant ?? styleType ?? "accent";
|
|
124
|
+
const buttonContent = /* @__PURE__ */ jsxs(Button, { className: `${iconButton({
|
|
121
125
|
size,
|
|
122
|
-
[
|
|
126
|
+
[resolvedStyleVariant]: emphasis
|
|
123
127
|
})} ${focusStyleVariants({
|
|
124
128
|
focusStyle
|
|
125
|
-
})}`, ref: buttonRef, onPress: onClick, form, formAction, formEncType, formMethod, formNoValidate, formTarget, name, value, isDisabled, autoFocus, type, "aria-label": isLoading ? "Loading Spinner" : "Icon", style: {
|
|
129
|
+
})}`, ref: ref || buttonRef, onPress: onClick, form, formAction, formEncType, formMethod, formNoValidate, formTarget, name, value, isDisabled, autoFocus, type, "aria-label": tooltipLabel ? void 0 : isLoading ? "Loading Spinner" : "Icon", style: {
|
|
126
130
|
width: isLoading && buttonWidth ? `${buttonWidth}px` : void 0
|
|
127
131
|
}, slot, ...props, children: [
|
|
128
132
|
isLoading && /* @__PURE__ */ jsx(LoadingSpinner, { size: "1x" }),
|
|
129
133
|
!isLoading && /* @__PURE__ */ jsx(Icon, { ...iconProps })
|
|
130
134
|
] });
|
|
131
|
-
|
|
135
|
+
if (tooltipLabel) {
|
|
136
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: tooltipLabel, placement: tooltipPlacement, isDisabled, children: buttonContent });
|
|
137
|
+
}
|
|
138
|
+
return buttonContent;
|
|
139
|
+
});
|
|
140
|
+
IconButton.displayName = "IconButton";
|
|
132
141
|
export {
|
|
133
142
|
IconButton,
|
|
134
143
|
IconButton as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { BorderVariants } from '../../utils/border/border';
|
|
4
|
+
import { BackgroundVariants } from '../../utils/backgroundColor/backgroundColor';
|
|
5
|
+
declare const imageVariants: (props?: ({
|
|
6
|
+
fit?: "fill" | "none" | "contain" | "cover" | "scale-down" | "scaleDown" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface ImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, 'className' | 'style'>, Pick<BorderVariants, 'borderRadius'>, BackgroundVariants, VariantProps<typeof imageVariants> {
|
|
9
|
+
/** Image url that will be used as a fallback in case `src` prop is not set or image cannot be loaded */
|
|
10
|
+
fallbackSrc?: string;
|
|
11
|
+
/** Called when image fails to load */
|
|
12
|
+
onError?: (event: React.SyntheticEvent<HTMLImageElement, Event>) => void;
|
|
13
|
+
/** Called when image is loaded */
|
|
14
|
+
onLoad?: React.ReactEventHandler<HTMLImageElement>;
|
|
15
|
+
/** Polymorphism with children, the component will render the children instead of the image */
|
|
16
|
+
asChild?: boolean;
|
|
17
|
+
/** To support polymorphism with children */
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/** Aspect ratio of the image */
|
|
20
|
+
aspectRatio?: number;
|
|
21
|
+
backgroundColour?: BackgroundVariants['backgroundColor'];
|
|
22
|
+
}
|
|
23
|
+
export declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
24
|
+
export default Image;
|