@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,135 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useRef, useEffect } from "react";
|
|
3
|
+
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
4
|
+
import { borderVariants } from "../../utils/border/border.js";
|
|
5
|
+
import { backgroundColorVariants } from "../../utils/backgroundColor/backgroundColor.js";
|
|
6
|
+
import '../../assets/Image.css';const image = "_image_z82es_1";
|
|
7
|
+
const fill = "_fill_z82es_10";
|
|
8
|
+
const contain = "_contain_z82es_14";
|
|
9
|
+
const cover = "_cover_z82es_18";
|
|
10
|
+
const none = "_none_z82es_22";
|
|
11
|
+
const scaleDown = "_scaleDown_z82es_26";
|
|
12
|
+
const styles = {
|
|
13
|
+
image,
|
|
14
|
+
fill,
|
|
15
|
+
contain,
|
|
16
|
+
cover,
|
|
17
|
+
none,
|
|
18
|
+
scaleDown
|
|
19
|
+
};
|
|
20
|
+
const imageVariants = cva(styles.image, {
|
|
21
|
+
variants: {
|
|
22
|
+
fit: {
|
|
23
|
+
contain: styles.contain,
|
|
24
|
+
cover: styles.cover,
|
|
25
|
+
fill: styles.fill,
|
|
26
|
+
none: styles.none,
|
|
27
|
+
scaleDown: styles.scaleDown,
|
|
28
|
+
"scale-down": styles.scaleDown
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const useImageLoaded = (onLoadProp) => {
|
|
33
|
+
const [loaded, setLoaded] = useState(false);
|
|
34
|
+
const ref = useRef(null);
|
|
35
|
+
const handleLoad = React.useCallback((event) => {
|
|
36
|
+
if (typeof onLoadProp === "function") {
|
|
37
|
+
onLoadProp(event);
|
|
38
|
+
}
|
|
39
|
+
setLoaded(true);
|
|
40
|
+
}, [onLoadProp]);
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (ref.current && ref.current.complete) {
|
|
43
|
+
setLoaded(true);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return {
|
|
47
|
+
ref,
|
|
48
|
+
loaded,
|
|
49
|
+
handleLoad
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const useMergedRef = (internalRef, forwardedRef) => {
|
|
53
|
+
return React.useMemo(() => {
|
|
54
|
+
if (!forwardedRef) return internalRef;
|
|
55
|
+
return (node) => {
|
|
56
|
+
if (typeof forwardedRef === "function") {
|
|
57
|
+
forwardedRef(node);
|
|
58
|
+
} else if (forwardedRef && "current" in forwardedRef) {
|
|
59
|
+
forwardedRef.current = node;
|
|
60
|
+
}
|
|
61
|
+
internalRef.current = node;
|
|
62
|
+
};
|
|
63
|
+
}, [internalRef, forwardedRef]);
|
|
64
|
+
};
|
|
65
|
+
const Image = React.forwardRef(({
|
|
66
|
+
src,
|
|
67
|
+
fallbackSrc,
|
|
68
|
+
onError: onErrorProp,
|
|
69
|
+
onLoad: onLoadProp,
|
|
70
|
+
asChild,
|
|
71
|
+
children,
|
|
72
|
+
borderRadius,
|
|
73
|
+
backgroundColor,
|
|
74
|
+
backgroundColour,
|
|
75
|
+
fit,
|
|
76
|
+
aspectRatio,
|
|
77
|
+
...props
|
|
78
|
+
}, forwardedRef) => {
|
|
79
|
+
if (backgroundColour && !backgroundColor) {
|
|
80
|
+
console.warn("Warning: `backgroundColour` is deprecated and will be removed in a future release. Please use `backgroundColor` instead.");
|
|
81
|
+
}
|
|
82
|
+
const resolvedBackgroundColor = backgroundColor ?? backgroundColour;
|
|
83
|
+
const {
|
|
84
|
+
ref: internalRef,
|
|
85
|
+
loaded,
|
|
86
|
+
handleLoad
|
|
87
|
+
} = useImageLoaded(onLoadProp);
|
|
88
|
+
const ref = useMergedRef(internalRef, forwardedRef);
|
|
89
|
+
const [isError, setError] = useState(!src);
|
|
90
|
+
if (asChild && !children) {
|
|
91
|
+
console.error("Image component: Children required when asChild is true");
|
|
92
|
+
}
|
|
93
|
+
const handleError = React.useCallback((e) => {
|
|
94
|
+
if (fallbackSrc) {
|
|
95
|
+
setError(true);
|
|
96
|
+
}
|
|
97
|
+
if (typeof onErrorProp === "function") {
|
|
98
|
+
onErrorProp(e);
|
|
99
|
+
}
|
|
100
|
+
}, [fallbackSrc, onErrorProp]);
|
|
101
|
+
const imgProps = {
|
|
102
|
+
src: isError ? fallbackSrc : src,
|
|
103
|
+
className: `
|
|
104
|
+
${borderVariants({
|
|
105
|
+
borderRadius
|
|
106
|
+
})}
|
|
107
|
+
${backgroundColorVariants({
|
|
108
|
+
backgroundColor: resolvedBackgroundColor
|
|
109
|
+
})}
|
|
110
|
+
${imageVariants({
|
|
111
|
+
fit
|
|
112
|
+
})}`,
|
|
113
|
+
onError: handleError,
|
|
114
|
+
onLoad: handleLoad,
|
|
115
|
+
ref,
|
|
116
|
+
"data-loaded": loaded,
|
|
117
|
+
style: {
|
|
118
|
+
aspectRatio
|
|
119
|
+
},
|
|
120
|
+
...props
|
|
121
|
+
};
|
|
122
|
+
if (asChild && React.isValidElement(children)) {
|
|
123
|
+
return React.cloneElement(children, {
|
|
124
|
+
...imgProps,
|
|
125
|
+
...children.props
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return /* @__PURE__ */ jsx("img", { ...imgProps });
|
|
129
|
+
});
|
|
130
|
+
Image.displayName = "Image";
|
|
131
|
+
export {
|
|
132
|
+
Image,
|
|
133
|
+
Image as default
|
|
134
|
+
};
|
|
135
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Image';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,69 +1,67 @@
|
|
|
1
1
|
import { LinkProps as AriaLinkProps } from 'react-aria-components';
|
|
2
2
|
import { IconProps } from '../Icon/Icon';
|
|
3
3
|
export interface LinkProps extends AriaLinkProps {
|
|
4
|
+
/**
|
|
5
|
+
* The children of the component. A function may be provided to alter the children based on component state.
|
|
6
|
+
*/
|
|
7
|
+
children?: React.ReactNode | string;
|
|
4
8
|
/**
|
|
5
9
|
* What the size of the Link is
|
|
6
10
|
* @default 'md'
|
|
7
11
|
*/
|
|
8
12
|
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
9
|
-
/**
|
|
10
|
-
* Whether the icon should be at the end of the Link
|
|
11
|
-
* @default true
|
|
12
|
-
*/
|
|
13
|
-
iconEnd?: boolean;
|
|
14
|
-
/**
|
|
15
|
-
* The text to display in the Link
|
|
16
|
-
*/
|
|
17
|
-
linkText?: string;
|
|
18
13
|
/**
|
|
19
14
|
* Whether the Link should be underlined
|
|
20
15
|
* @default false
|
|
21
16
|
*/
|
|
22
17
|
underline?: boolean;
|
|
23
18
|
/**
|
|
24
|
-
*
|
|
19
|
+
* Whether the link is disabled.
|
|
20
|
+
* @default false
|
|
25
21
|
*/
|
|
26
|
-
|
|
22
|
+
isDisabled?: boolean;
|
|
27
23
|
/**
|
|
28
|
-
*
|
|
29
|
-
* @default '
|
|
24
|
+
* Whether an icon should display at the end of Link and icon properties
|
|
25
|
+
* @default { iconName: 'arrow-right' }
|
|
30
26
|
*/
|
|
31
|
-
|
|
27
|
+
iconEndProps?: IconProps | false;
|
|
32
28
|
/**
|
|
33
|
-
*
|
|
29
|
+
* Whether an icon should display at the start of the Link and icon properties
|
|
34
30
|
*/
|
|
35
|
-
|
|
31
|
+
iconStartProps?: IconProps;
|
|
36
32
|
/**
|
|
37
|
-
*
|
|
38
|
-
* @default false
|
|
33
|
+
* The URL the Link will navigate to
|
|
39
34
|
*/
|
|
40
|
-
|
|
35
|
+
href?: string;
|
|
41
36
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @default
|
|
37
|
+
* The target attribute for the Link
|
|
38
|
+
* @default '_self'
|
|
44
39
|
*/
|
|
45
|
-
|
|
40
|
+
target?: string;
|
|
46
41
|
/**
|
|
47
|
-
*
|
|
48
|
-
* @default
|
|
42
|
+
* Aria label applied when target="_blank"
|
|
43
|
+
* @default "open in new tab"
|
|
49
44
|
*/
|
|
50
|
-
|
|
45
|
+
ariaLabelExternal?: string;
|
|
51
46
|
/**
|
|
52
|
-
*
|
|
47
|
+
* The focus style of the button
|
|
53
48
|
*/
|
|
54
|
-
|
|
49
|
+
focusStyle?: 'default' | 'white';
|
|
55
50
|
/**
|
|
56
|
-
*
|
|
51
|
+
* Whether an icon should display at the End of the Link
|
|
52
|
+
* @deprecated Use iconEndProps instead
|
|
57
53
|
*/
|
|
58
|
-
|
|
54
|
+
iconEnd?: boolean;
|
|
59
55
|
/**
|
|
60
|
-
*
|
|
56
|
+
* Whether an icon should display at the End of the Link
|
|
57
|
+
* @deprecated Use iconEndProps instead
|
|
61
58
|
*/
|
|
62
|
-
|
|
59
|
+
iconProps?: IconProps;
|
|
63
60
|
/**
|
|
64
|
-
*
|
|
61
|
+
* The text to display in the Link
|
|
62
|
+
* @deprecated Use children instead
|
|
65
63
|
*/
|
|
66
|
-
|
|
64
|
+
linkText?: string;
|
|
67
65
|
}
|
|
68
|
-
declare const Link: ({ size,
|
|
66
|
+
declare const Link: ({ size, underline, iconStartProps, iconEndProps, iconProps, linkText, href, target, focusStyle, children, ariaLabelExternal, ...props }: LinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
69
67
|
export default Link;
|
|
@@ -3,21 +3,19 @@ import { Icon } from "../Icon/Icon.js";
|
|
|
3
3
|
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
4
4
|
import { Link as Link$1 } from "react-aria-components";
|
|
5
5
|
import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
|
|
6
|
-
import '../../assets/Link.css';const link$1 = "
|
|
7
|
-
const xs = "
|
|
8
|
-
const sm = "
|
|
9
|
-
const md = "
|
|
10
|
-
const lg = "
|
|
11
|
-
const underline = "
|
|
12
|
-
const iconEnd = "_iconEnd_4ndec_75";
|
|
6
|
+
import '../../assets/Link.css';const link$1 = "_link_jskyb_1";
|
|
7
|
+
const xs = "_xs_jskyb_12";
|
|
8
|
+
const sm = "_sm_jskyb_18";
|
|
9
|
+
const md = "_md_jskyb_24";
|
|
10
|
+
const lg = "_lg_jskyb_30";
|
|
11
|
+
const underline = "_underline_jskyb_61";
|
|
13
12
|
const styles = {
|
|
14
13
|
link: link$1,
|
|
15
14
|
xs,
|
|
16
15
|
sm,
|
|
17
16
|
md,
|
|
18
17
|
lg,
|
|
19
|
-
underline
|
|
20
|
-
iconEnd
|
|
18
|
+
underline
|
|
21
19
|
};
|
|
22
20
|
const link = cva(styles.link, {
|
|
23
21
|
variants: {
|
|
@@ -34,41 +32,55 @@ const link = cva(styles.link, {
|
|
|
34
32
|
iconEnd: {
|
|
35
33
|
true: styles.iconEnd,
|
|
36
34
|
false: ""
|
|
35
|
+
},
|
|
36
|
+
iconStart: {
|
|
37
|
+
true: styles.iconStart,
|
|
38
|
+
false: ""
|
|
37
39
|
}
|
|
38
40
|
},
|
|
39
41
|
defaultVariants: {
|
|
40
42
|
size: "md",
|
|
41
|
-
underline: false
|
|
42
|
-
iconEnd: true
|
|
43
|
+
underline: false
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
const Link = ({
|
|
46
47
|
size = "md",
|
|
47
|
-
iconEnd: iconEnd2 = true,
|
|
48
48
|
underline: underline2 = true,
|
|
49
|
-
|
|
49
|
+
iconStartProps,
|
|
50
|
+
iconEndProps = {
|
|
50
51
|
iconName: "arrow-right"
|
|
51
52
|
},
|
|
53
|
+
iconProps,
|
|
54
|
+
// deprecated
|
|
52
55
|
linkText,
|
|
53
56
|
href,
|
|
54
57
|
target = "_self",
|
|
55
|
-
rel,
|
|
56
|
-
download = false,
|
|
57
|
-
isDisabled = false,
|
|
58
|
-
autoFocus = false,
|
|
59
|
-
ping,
|
|
60
58
|
focusStyle = "default",
|
|
59
|
+
children,
|
|
60
|
+
ariaLabelExternal = "open in new tab",
|
|
61
61
|
...props
|
|
62
62
|
}) => {
|
|
63
|
+
const finalIconEndProps = iconProps ?? // Use deprecated iconProps if provided
|
|
64
|
+
(iconEndProps === false ? void 0 : iconEndProps ?? {
|
|
65
|
+
iconName: "arrow-right"
|
|
66
|
+
});
|
|
67
|
+
const externalLinkProps = target === "_blank" ? {
|
|
68
|
+
rel: "noopener noreferrer",
|
|
69
|
+
"aria-label": ariaLabelExternal
|
|
70
|
+
} : {};
|
|
63
71
|
return /* @__PURE__ */ jsxs(Link$1, { className: `${link({
|
|
64
72
|
size,
|
|
65
|
-
iconEnd: iconEnd2,
|
|
66
73
|
underline: underline2
|
|
67
74
|
})} ${focusStyleVariants({
|
|
68
75
|
focusStyle
|
|
69
|
-
})}`, href, target,
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
})}`, href, target, ...externalLinkProps, ...props, children: [
|
|
77
|
+
iconStartProps && /* @__PURE__ */ jsx(Icon, { className: link({
|
|
78
|
+
iconStart: !!iconStartProps
|
|
79
|
+
}), ...iconStartProps }),
|
|
80
|
+
children || linkText,
|
|
81
|
+
finalIconEndProps && /* @__PURE__ */ jsx(Icon, { className: link({
|
|
82
|
+
iconEnd: !!finalIconEndProps
|
|
83
|
+
}), ...finalIconEndProps })
|
|
72
84
|
] });
|
|
73
85
|
};
|
|
74
86
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Link.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* The label for the NumberField
|
|
5
|
-
*/
|
|
6
|
-
label?: string;
|
|
1
|
+
import { NumberFieldProps as AriaNumberFieldProps } from 'react-aria-components';
|
|
2
|
+
import { FieldProps } from '../_base/Field';
|
|
3
|
+
export interface NumberFieldProps extends FieldProps<AriaNumberFieldProps> {
|
|
7
4
|
/**
|
|
8
5
|
* The label for the increment button
|
|
9
6
|
* @default "Increase"
|
|
@@ -14,10 +11,6 @@ export interface NumberFieldProps extends AriaNumberFieldProps {
|
|
|
14
11
|
* @default "Decrease"
|
|
15
12
|
*/
|
|
16
13
|
labelDecrement?: string;
|
|
17
|
-
/**
|
|
18
|
-
* The description for the NumberField
|
|
19
|
-
*/
|
|
20
|
-
description?: string;
|
|
21
14
|
/**
|
|
22
15
|
* The minimum value for the NumberField
|
|
23
16
|
*
|
|
@@ -27,29 +20,6 @@ export interface NumberFieldProps extends AriaNumberFieldProps {
|
|
|
27
20
|
* The maximum value for the NumberField
|
|
28
21
|
*/
|
|
29
22
|
maxValue?: number;
|
|
30
|
-
/**
|
|
31
|
-
* Whether the NumberField is disabled
|
|
32
|
-
* @default false
|
|
33
|
-
*/
|
|
34
|
-
isDisabled?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* The error message for the NumberField
|
|
37
|
-
*/
|
|
38
|
-
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
39
|
-
/**
|
|
40
|
-
* The default value for the NumberField
|
|
41
|
-
*/
|
|
42
|
-
defaultValue?: number;
|
|
43
|
-
/**
|
|
44
|
-
* Whether the NumberField is invalid
|
|
45
|
-
* @default false
|
|
46
|
-
*/
|
|
47
|
-
isInvalid?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Whether the NumberField is required
|
|
50
|
-
* @default false
|
|
51
|
-
*/
|
|
52
|
-
isRequired?: boolean;
|
|
53
23
|
}
|
|
54
|
-
export declare const NumberField: ({
|
|
24
|
+
export declare const NumberField: ({ labelIncrement, labelDecrement, minValue, maxValue, isInvalid, isDisabled, ...props }: NumberFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
25
|
export default NumberField;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { NumberField as NumberField$1, Group, Button, Input } from "react-aria-components";
|
|
3
|
-
import { FieldHeader } from "../FieldHeader/FieldHeader.js";
|
|
4
3
|
import { Icon } from "../Icon/Icon.js";
|
|
5
4
|
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
5
|
+
import { Field } from "../_base/Field/Field.js";
|
|
6
|
+
import '../../assets/NumberField.css';const numberField = "_numberField_1knmk_1";
|
|
7
|
+
const numberFieldGroup = "_numberFieldGroup_1knmk_6";
|
|
8
|
+
const numberFieldInput = "_numberFieldInput_1knmk_59";
|
|
9
|
+
const numberFieldButton = "_numberFieldButton_1knmk_60";
|
|
10
10
|
const styles = {
|
|
11
11
|
numberField,
|
|
12
12
|
numberFieldGroup,
|
|
@@ -14,27 +14,19 @@ const styles = {
|
|
|
14
14
|
numberFieldButton
|
|
15
15
|
};
|
|
16
16
|
const NumberField = ({
|
|
17
|
-
label,
|
|
18
17
|
labelIncrement = "Increase",
|
|
19
18
|
labelDecrement = "Decrease",
|
|
20
|
-
description,
|
|
21
|
-
defaultValue,
|
|
22
19
|
minValue,
|
|
23
20
|
maxValue,
|
|
24
21
|
isInvalid = false,
|
|
25
22
|
isDisabled = false,
|
|
26
|
-
isRequired = false,
|
|
27
|
-
errorMessage,
|
|
28
23
|
...props
|
|
29
24
|
}) => {
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
label
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/* @__PURE__ */ jsx(Tooltip, { placement: "bottom", label: labelIncrement, children: /* @__PURE__ */ jsx(Button, { className: styles.numberFieldButton, slot: "increment", children: /* @__PURE__ */ jsx(Icon, { iconName: "plus" }) }) })
|
|
36
|
-
] })
|
|
37
|
-
] });
|
|
25
|
+
return /* @__PURE__ */ jsx(Field, { as: NumberField$1, className: styles.numberField, minValue, maxValue, isInvalid, isDisabled, ...props, children: /* @__PURE__ */ jsxs(Group, { className: styles.numberFieldGroup, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "bottom", label: labelDecrement, children: /* @__PURE__ */ jsx(Button, { className: styles.numberFieldButton, slot: "decrement", children: /* @__PURE__ */ jsx(Icon, { iconName: "minus" }) }) }),
|
|
27
|
+
/* @__PURE__ */ jsx(Input, { className: styles.numberFieldInput }),
|
|
28
|
+
/* @__PURE__ */ jsx(Tooltip, { placement: "bottom", label: labelIncrement, children: /* @__PURE__ */ jsx(Button, { className: styles.numberFieldButton, slot: "increment", children: /* @__PURE__ */ jsx(Icon, { iconName: "plus" }) }) })
|
|
29
|
+
] }) });
|
|
38
30
|
};
|
|
39
31
|
export {
|
|
40
32
|
NumberField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberField.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NumberField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,11 @@
|
|
|
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 paragraph: (props?: ({
|
|
5
5
|
size?: "lg" | "sm" | "xs" | "md" | null | undefined;
|
|
6
|
-
textAlign?: "
|
|
6
|
+
textAlign?: "end" | "start" | "center" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
type ParagraphVariants = VariantProps<typeof paragraph>;
|
|
9
|
-
type FgColorVariants = VariantProps<typeof fgColorVariants>;
|
|
10
9
|
type ParagraphSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
11
10
|
export interface ParagraphProps extends ParagraphVariants {
|
|
12
11
|
children: React.ReactNode;
|
|
@@ -19,12 +18,17 @@ export interface ParagraphProps extends ParagraphVariants {
|
|
|
19
18
|
* The foreground color of the paragraph
|
|
20
19
|
* @default "secondary"
|
|
21
20
|
*/
|
|
22
|
-
|
|
21
|
+
foregroundColor?: ForegroundVariants['foregroundColor'];
|
|
22
|
+
/**
|
|
23
|
+
* The foreground color of the paragraph
|
|
24
|
+
* @deprecated Use `foregroundColor` instead
|
|
25
|
+
*/
|
|
26
|
+
fgColor?: ForegroundVariants['foregroundColor'];
|
|
23
27
|
/**
|
|
24
28
|
* The text alignment of the paragraph
|
|
25
29
|
* @default "start"
|
|
26
30
|
*/
|
|
27
31
|
textAlign?: 'start' | 'center' | 'end';
|
|
28
32
|
}
|
|
29
|
-
export declare const Paragraph: ({ children, size, fgColor, textAlign, ...props }: ParagraphProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare const Paragraph: ({ children, size, foregroundColor, fgColor, textAlign, ...props }: ParagraphProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
34
|
export default Paragraph;
|
|
@@ -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/Paragraph.css';const paragraph$1 = "_paragraph_odu3c_1";
|
|
5
5
|
const xs = "_xs_odu3c_9";
|
|
6
6
|
const sm = "_sm_odu3c_15";
|
|
@@ -41,15 +41,20 @@ const paragraph = cva(styles.paragraph, {
|
|
|
41
41
|
const Paragraph = ({
|
|
42
42
|
children,
|
|
43
43
|
size = "md",
|
|
44
|
-
|
|
44
|
+
foregroundColor = "secondary",
|
|
45
|
+
fgColor,
|
|
45
46
|
textAlign = "start",
|
|
46
47
|
...props
|
|
47
48
|
}) => {
|
|
49
|
+
if (fgColor) {
|
|
50
|
+
console.warn("The `fgColor` prop has been deprecated. Please use `foregroundColor` instead.");
|
|
51
|
+
}
|
|
52
|
+
const resolvedFontColor = fgColor ?? foregroundColor ?? "secondary";
|
|
48
53
|
return /* @__PURE__ */ jsx("p", { className: `${paragraph({
|
|
49
54
|
size,
|
|
50
55
|
textAlign
|
|
51
|
-
})} ${
|
|
52
|
-
|
|
56
|
+
})} ${foregroundColorVariants({
|
|
57
|
+
foregroundColor: resolvedFontColor
|
|
53
58
|
})}`, ...props, children });
|
|
54
59
|
};
|
|
55
60
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paragraph.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Paragraph.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FieldProps } from '../_base/Field';
|
|
2
|
+
import { TextFieldProps as AriaTextFieldProps } from 'react-aria-components';
|
|
3
|
+
type PasswordStrengthValidation = {
|
|
4
|
+
message: string;
|
|
5
|
+
validation: (value?: string) => boolean;
|
|
6
|
+
};
|
|
7
|
+
export interface PasswordFieldProps extends FieldProps<AriaTextFieldProps> {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the password input value revealed or not.
|
|
10
|
+
*/
|
|
11
|
+
isVisible?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The strength validations to be applied to the password input value.
|
|
14
|
+
*/
|
|
15
|
+
strengthValidations?: PasswordStrengthValidation[];
|
|
16
|
+
/**
|
|
17
|
+
* Tooltip label to show password
|
|
18
|
+
*/
|
|
19
|
+
tooltipLabelShowPassword?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Tooltip label to hide password
|
|
22
|
+
*/
|
|
23
|
+
tooltipLabelHidePassword?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Label for the password requirements.
|
|
26
|
+
*/
|
|
27
|
+
requirementsLabel?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const PasswordField: ({ tooltipLabelShowPassword, tooltipLabelHidePassword, requirementsLabel, ...props }: PasswordFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export default PasswordField;
|