@alto-avios/alto-ui 2.4.0 → 3.0.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/DateField.css +1 -1
- package/dist/assets/Fieldset.css +1 -0
- package/dist/assets/FieldsetHeader.css +1 -0
- package/dist/assets/Form.css +1 -0
- package/dist/assets/Image.css +1 -0
- package/dist/assets/Link.css +1 -1
- package/dist/assets/NumberField.css +1 -1
- package/dist/assets/Section.css +1 -1
- package/dist/assets/TextAreaField.css +1 -1
- package/dist/assets/focusStyles.css +1 -1
- 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 +16 -1
- package/dist/components/Box/Box.js +9 -3
- 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/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/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 +2 -2
- package/dist/components/Heading/Heading.js +3 -1
- package/dist/components/Heading/Heading.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +13 -4
- package/dist/components/IconButton/IconButton.js +13 -4
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/Image/Image.d.ts +23 -0
- package/dist/components/Image/Image.js +130 -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 +1 -1
- package/dist/components/Section/Section.d.ts +2 -2
- package/dist/components/Section/Section.js +11 -11
- package/dist/components/SubHeading/SubHeading.d.ts +1 -1
- 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/ToggleIconButton/ToggleIconButton.d.ts +9 -1
- package/dist/components/ToggleIconButton/ToggleIconButton.js +9 -2
- package/dist/components/ToggleIconButton/ToggleIconButton.js.map +1 -1
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/_base/Field/Field.d.ts +16 -0
- package/dist/components/_base/Field/Field.js +32 -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 +5 -1
- package/dist/components/index.js +20 -12
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +20 -12
- package/dist/index.js.map +1 -1
- package/dist/utils/border/border.d.ts +3 -3
- package/dist/utils/fgColour/fgColor.d.ts +1 -1
- package/dist/utils/flex/flex.d.ts +2 -2
- package/dist/utils/flex/flex.js +3 -1
- 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/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.js +98 -98
- package/dist/utils/stories/iconPropsArgTypes.js +14 -13
- package/dist/utils/stories/iconPropsArgTypes.js.map +1 -1
- package/package.json +38 -19
- package/dist/assets/NewButton.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/components/{NewButton → AviosCurrencySymbol}/index.js.map +0 -0
|
@@ -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
|
+
labelExternal = "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": labelExternal
|
|
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import { fgColorVariants } from '../../utils/fgColour/fgColor';
|
|
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
9
|
type FgColorVariants = VariantProps<typeof fgColorVariants>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { BackgroundVariants } from '../../utils/backgroundColour/backgroundColour';
|
|
3
3
|
import { PaddingVariants } from '../../utils/padding/padding';
|
|
4
|
-
type SectionPaddingValue =
|
|
4
|
+
type SectionPaddingValue = 'default' | PaddingVariants['paddingX'];
|
|
5
5
|
type SectionPadding = {
|
|
6
6
|
paddingX?: SectionPaddingValue;
|
|
7
7
|
paddingY?: SectionPaddingValue;
|
|
@@ -21,7 +21,7 @@ interface ContainerProps {
|
|
|
21
21
|
className?: string;
|
|
22
22
|
containerMaxWidth?: 'full-width' | 'page';
|
|
23
23
|
}
|
|
24
|
-
declare const Container: ({ children, className, containerMaxWidth }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const Container: ({ children, className, containerMaxWidth, }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
interface SectionComponent extends React.ForwardRefExoticComponent<SectionProps & React.RefAttributes<HTMLElement>> {
|
|
26
26
|
Container: typeof Container;
|
|
27
27
|
}
|
|
@@ -3,21 +3,21 @@ import React, { forwardRef } from "react";
|
|
|
3
3
|
import { backgroundColorVariants } from "../../utils/backgroundColour/backgroundColour.js";
|
|
4
4
|
import { paddingVariants } from "../../utils/padding/padding.js";
|
|
5
5
|
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
6
|
-
import '../../assets/Section.css';const section = "
|
|
7
|
-
const container = "
|
|
8
|
-
const pageWidth = "
|
|
9
|
-
const fullWidth = "
|
|
10
|
-
const paddingTopDefault = "
|
|
11
|
-
const paddingRightDefault = "
|
|
12
|
-
const paddingBottomDefault = "
|
|
13
|
-
const paddingLeftDefault = "
|
|
6
|
+
import '../../assets/Section.css';const section = "_section_1lo00_1";
|
|
7
|
+
const container = "_container_1lo00_8";
|
|
8
|
+
const pageWidth = "_pageWidth_1lo00_16";
|
|
9
|
+
const fullWidth = "_fullWidth_1lo00_20";
|
|
10
|
+
const paddingTopDefault = "_paddingTopDefault_1lo00_34";
|
|
11
|
+
const paddingRightDefault = "_paddingRightDefault_1lo00_38";
|
|
12
|
+
const paddingBottomDefault = "_paddingBottomDefault_1lo00_42";
|
|
13
|
+
const paddingLeftDefault = "_paddingLeftDefault_1lo00_46";
|
|
14
14
|
const styles = {
|
|
15
15
|
section,
|
|
16
16
|
container,
|
|
17
17
|
pageWidth,
|
|
18
18
|
fullWidth,
|
|
19
|
-
"paddingX-default": "_paddingX-
|
|
20
|
-
"paddingY-default": "_paddingY-
|
|
19
|
+
"paddingX-default": "_paddingX-default_1lo00_24",
|
|
20
|
+
"paddingY-default": "_paddingY-default_1lo00_29",
|
|
21
21
|
paddingTopDefault,
|
|
22
22
|
paddingRightDefault,
|
|
23
23
|
paddingBottomDefault,
|
|
@@ -58,7 +58,7 @@ const Section = forwardRef(({
|
|
|
58
58
|
paddingBottom,
|
|
59
59
|
paddingLeft,
|
|
60
60
|
paddingRight,
|
|
61
|
-
paddingX
|
|
61
|
+
paddingX,
|
|
62
62
|
paddingY = "default",
|
|
63
63
|
style,
|
|
64
64
|
className
|
|
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import { fgColorVariants } from '../../utils/fgColour/fgColor';
|
|
4
4
|
declare const subHeading: (props?: ({
|
|
5
5
|
size?: "sm" | "xs" | null | undefined;
|
|
6
|
-
textAlign?: "
|
|
6
|
+
textAlign?: "end" | "start" | "center" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
type HeadingVariants = VariantProps<typeof subHeading>;
|
|
9
9
|
type FgColorVariants = VariantProps<typeof fgColorVariants>;
|
|
@@ -26,7 +26,7 @@ const TagGroup = ({
|
|
|
26
26
|
return /* @__PURE__ */ jsxs(TagGroup$1, { className: styles.tagGroup, selectionMode, ...props, children: [
|
|
27
27
|
/* @__PURE__ */ jsxs("span", { className: styles.spanContainer, children: [
|
|
28
28
|
/* @__PURE__ */ jsx(FieldLabel, { children: label }),
|
|
29
|
-
clearButton && /* @__PURE__ */ jsx(Button, {
|
|
29
|
+
clearButton && /* @__PURE__ */ jsx(Button, { styleVariant: "accent", emphasis: "quaternary", size: "sm", onPress: clearButtonOnClick, children: "Clear" })
|
|
30
30
|
] }),
|
|
31
31
|
description && /* @__PURE__ */ jsx(FieldDescription, { children: description }),
|
|
32
32
|
/* @__PURE__ */ jsx(TagList, { className: styles.tagGroupList, items, renderEmptyState, children })
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TextFieldProps } from '../TextField/TextField';
|
|
2
|
-
export declare const TextAreaField: (
|
|
2
|
+
export declare const TextAreaField: (props: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default TextAreaField;
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { TextField, TextArea } from "react-aria-components";
|
|
3
|
-
import {
|
|
4
|
-
import '../../assets/TextAreaField.css';const textAreaField = "
|
|
5
|
-
const validationError = "
|
|
3
|
+
import { Field } from "../_base/Field/Field.js";
|
|
4
|
+
import '../../assets/TextAreaField.css';const textAreaField = "_textAreaField_1hjyj_1";
|
|
5
|
+
const validationError = "_validationError_1hjyj_71";
|
|
6
6
|
const styles = {
|
|
7
7
|
textAreaField,
|
|
8
8
|
validationError
|
|
9
9
|
};
|
|
10
|
-
const TextAreaField = ({
|
|
11
|
-
|
|
12
|
-
description,
|
|
13
|
-
defaultValue,
|
|
14
|
-
errorMessage,
|
|
15
|
-
isDisabled,
|
|
16
|
-
isInvalid,
|
|
17
|
-
isRequired = false,
|
|
18
|
-
...props
|
|
19
|
-
}) => {
|
|
20
|
-
return /* @__PURE__ */ jsxs(TextField, { className: styles.textAreaField, defaultValue, isDisabled, isInvalid, ...props, children: [
|
|
21
|
-
/* @__PURE__ */ jsx(FieldHeader, { label, description, errorMessage, isRequired, isInvalid }),
|
|
22
|
-
/* @__PURE__ */ jsx(TextArea, {})
|
|
23
|
-
] });
|
|
10
|
+
const TextAreaField = (props) => {
|
|
11
|
+
return /* @__PURE__ */ jsx(Field, { as: TextField, className: styles.textAreaField, ...props, children: /* @__PURE__ */ jsx(TextArea, {}) });
|
|
24
12
|
};
|
|
25
13
|
export {
|
|
26
14
|
TextAreaField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAreaField.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextAreaField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
import { TextFieldProps as AriaTextFieldProps
|
|
1
|
+
import { TextFieldProps as AriaTextFieldProps } from 'react-aria-components';
|
|
2
2
|
import { IconProps } from '../Icon/Icon';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* The label for the TextField
|
|
6
|
-
*/
|
|
7
|
-
label?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The description for the TextField
|
|
10
|
-
*/
|
|
11
|
-
description?: string;
|
|
12
|
-
/**
|
|
13
|
-
* The error message for the TextField
|
|
14
|
-
*/
|
|
15
|
-
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
16
|
-
/**
|
|
17
|
-
* Whether the TextField is disabled
|
|
18
|
-
*/
|
|
19
|
-
isDisabled?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* The default value for the TextField
|
|
22
|
-
*/
|
|
23
|
-
defaultValue?: string;
|
|
24
|
-
/**
|
|
25
|
-
* Whether the TextField is invalid
|
|
26
|
-
*/
|
|
27
|
-
isInvalid?: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Whether the TextField is required
|
|
30
|
-
*/
|
|
31
|
-
isRequired?: boolean;
|
|
3
|
+
import { FieldProps } from '../_base/Field';
|
|
4
|
+
export interface TextFieldProps extends FieldProps<AriaTextFieldProps> {
|
|
32
5
|
/**
|
|
33
6
|
* Whether an icon should display at the start of the TextField
|
|
34
7
|
*/
|
|
@@ -38,5 +11,5 @@ export interface TextFieldProps extends AriaTextFieldProps {
|
|
|
38
11
|
*/
|
|
39
12
|
iconEndProps?: IconProps;
|
|
40
13
|
}
|
|
41
|
-
export declare const TextField: ({
|
|
14
|
+
export declare const TextField: ({ iconStartProps, iconEndProps, ...props }: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
15
|
export default TextField;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { TextField as TextField$1, Input } from "react-aria-components";
|
|
3
|
-
import { FieldHeader } from "../FieldHeader/FieldHeader.js";
|
|
4
3
|
import { Icon } from "../Icon/Icon.js";
|
|
4
|
+
import { Field } from "../_base/Field/Field.js";
|
|
5
5
|
import '../../assets/TextField.css';const textField = "_textField_1kom2_1";
|
|
6
6
|
const inputWrapper = "_inputWrapper_1kom2_45";
|
|
7
7
|
const iconStart = "_iconStart_1kom2_51";
|
|
@@ -13,25 +13,15 @@ const styles = {
|
|
|
13
13
|
iconEnd
|
|
14
14
|
};
|
|
15
15
|
const TextField = ({
|
|
16
|
-
label,
|
|
17
|
-
description,
|
|
18
|
-
defaultValue,
|
|
19
|
-
errorMessage,
|
|
20
|
-
isDisabled,
|
|
21
|
-
isInvalid,
|
|
22
|
-
isRequired = false,
|
|
23
16
|
iconStartProps,
|
|
24
17
|
iconEndProps,
|
|
25
18
|
...props
|
|
26
19
|
}) => {
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
/* @__PURE__ */ jsx(
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
iconEndProps && /* @__PURE__ */ jsx(Icon, { ...iconEndProps, className: styles.iconEnd })
|
|
33
|
-
] })
|
|
34
|
-
] });
|
|
20
|
+
return /* @__PURE__ */ jsx(Field, { as: TextField$1, className: styles.textField, ...props, children: /* @__PURE__ */ jsxs("div", { className: styles.inputWrapper, children: [
|
|
21
|
+
iconStartProps && /* @__PURE__ */ jsx(Icon, { ...iconStartProps, className: styles.iconStart }),
|
|
22
|
+
/* @__PURE__ */ jsx(Input, {}),
|
|
23
|
+
iconEndProps && /* @__PURE__ */ jsx(Icon, { ...iconEndProps, className: styles.iconEnd })
|
|
24
|
+
] }) });
|
|
35
25
|
};
|
|
36
26
|
export {
|
|
37
27
|
TextField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -14,6 +14,14 @@ export interface ToggleIconButtonProps extends Omit<ToggleButtonProps, 'children
|
|
|
14
14
|
* Handler that is called when the press is released over the target.
|
|
15
15
|
*/
|
|
16
16
|
onClick?: (e: PressEvent) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Tooltip text to display on hover and focus
|
|
19
|
+
*/
|
|
20
|
+
tooltipLabel?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Tooltip placement relative to the button
|
|
23
|
+
*/
|
|
24
|
+
tooltipPlacement?: 'top' | 'bottom' | 'left' | 'right';
|
|
17
25
|
}
|
|
18
|
-
declare const ToggleIconButton: ({ iconProps, isLoading, size, focusStyle, isSelected, defaultSelected, isDisabled, autoFocus, type, onClick, ...props }: ToggleIconButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare const ToggleIconButton: ({ iconProps, isLoading, size, focusStyle, tooltipLabel, tooltipPlacement, isSelected, defaultSelected, isDisabled, autoFocus, type, onClick, ...props }: ToggleIconButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
27
|
export default ToggleIconButton;
|
|
@@ -5,6 +5,7 @@ import { ToggleButton } from "react-aria-components";
|
|
|
5
5
|
import { Icon } from "../Icon/Icon.js";
|
|
6
6
|
import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
|
|
7
7
|
import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
|
|
8
|
+
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
8
9
|
import '../../assets/ToggleIconButton.css';const toggleIconButton$1 = "_toggleIconButton_1pk2t_1";
|
|
9
10
|
const sm = "_sm_1pk2t_26";
|
|
10
11
|
const md = "_md_1pk2t_32";
|
|
@@ -36,6 +37,8 @@ const ToggleIconButton = ({
|
|
|
36
37
|
isLoading = false,
|
|
37
38
|
size = "md",
|
|
38
39
|
focusStyle = "default",
|
|
40
|
+
tooltipLabel = "",
|
|
41
|
+
tooltipPlacement = "top",
|
|
39
42
|
// react-aria props
|
|
40
43
|
isSelected,
|
|
41
44
|
defaultSelected,
|
|
@@ -65,16 +68,20 @@ const ToggleIconButton = ({
|
|
|
65
68
|
onClick(e);
|
|
66
69
|
}
|
|
67
70
|
};
|
|
68
|
-
|
|
71
|
+
const buttonContent = /* @__PURE__ */ jsxs(ToggleButton, { className: `${toggleIconButton({
|
|
69
72
|
size
|
|
70
73
|
})} ${focusStyleVariants({
|
|
71
74
|
focusStyle
|
|
72
|
-
})}`, ref: buttonRef, isSelected: selectedState, defaultSelected, isDisabled, autoFocus, type, onPress: handlePress, "aria-label": isLoading ? "Loading Spinner" : "Icon", style: {
|
|
75
|
+
})}`, ref: buttonRef, isSelected: selectedState, defaultSelected, isDisabled, autoFocus, type, onPress: handlePress, "aria-label": tooltipLabel ? void 0 : isLoading ? "Loading Spinner" : "Icon", style: {
|
|
73
76
|
width: isLoading && buttonWidth ? `${buttonWidth}px` : void 0
|
|
74
77
|
}, ...props, children: [
|
|
75
78
|
isLoading && /* @__PURE__ */ jsx(LoadingSpinner, { size: "1x" }),
|
|
76
79
|
!isLoading && /* @__PURE__ */ jsx(Icon, { ...iconProps })
|
|
77
80
|
] });
|
|
81
|
+
if (tooltipLabel) {
|
|
82
|
+
return /* @__PURE__ */ jsx(Tooltip, { label: tooltipLabel, placement: tooltipPlacement, isDisabled, children: buttonContent });
|
|
83
|
+
}
|
|
84
|
+
return buttonContent;
|
|
78
85
|
};
|
|
79
86
|
export {
|
|
80
87
|
ToggleIconButton as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleIconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ToggleIconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -18,7 +18,7 @@ const Tooltip = ({
|
|
|
18
18
|
}) => {
|
|
19
19
|
return /* @__PURE__ */ jsxs(TooltipTrigger, { isDisabled, delay, closeDelay, trigger, children: [
|
|
20
20
|
children,
|
|
21
|
-
/* @__PURE__ */ jsx(Tooltip$1, { className: styles.tooltip, placement, ...props, children: label })
|
|
21
|
+
/* @__PURE__ */ jsx(Tooltip$1, { className: styles.tooltip, placement, ...props, children: /* @__PURE__ */ jsx("div", { "data-placement": placement, children: label }) })
|
|
22
22
|
] });
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FieldHeaderProps } from '../../FieldHeader';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
export interface FieldCommonProps extends FieldHeaderProps {
|
|
4
|
+
/**
|
|
5
|
+
* Whether the Field is disabled
|
|
6
|
+
*/
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type FieldProps<T extends object> = T & FieldCommonProps;
|
|
10
|
+
type FieldBaseProps<T extends object> = FieldProps<T> & {
|
|
11
|
+
as: React.ElementType;
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
className?: React.ComponentProps<React.ElementType>['className'];
|
|
14
|
+
};
|
|
15
|
+
export declare function Field<T extends object>({ as, children, className, isInvalid, isDisabled, isRequired, ...props }: FieldBaseProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default Field;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { FieldHeader } from "../../FieldHeader/FieldHeader.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
function PolymorphicField({
|
|
5
|
+
as,
|
|
6
|
+
children,
|
|
7
|
+
...props
|
|
8
|
+
}) {
|
|
9
|
+
if (!as) {
|
|
10
|
+
console.warn("@alto/ui: Field expects an as prop");
|
|
11
|
+
}
|
|
12
|
+
return as ? React.createElement(as, props, children) : /* @__PURE__ */ jsx("div", { children });
|
|
13
|
+
}
|
|
14
|
+
function Field({
|
|
15
|
+
as,
|
|
16
|
+
children,
|
|
17
|
+
className,
|
|
18
|
+
isInvalid = false,
|
|
19
|
+
isDisabled = false,
|
|
20
|
+
isRequired = false,
|
|
21
|
+
...props
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ jsxs(PolymorphicField, { as, isDisabled, isInvalid, className, isRequired, ...props, children: [
|
|
24
|
+
(props == null ? void 0 : props.label) ? /* @__PURE__ */ jsx(FieldHeader, { label: props == null ? void 0 : props.label, description: props == null ? void 0 : props.description, errorMessage: props == null ? void 0 : props.errorMessage, isInvalid, isRequired, labelFor: props == null ? void 0 : props.labelFor }) : null,
|
|
25
|
+
children
|
|
26
|
+
] });
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
Field,
|
|
30
|
+
Field as default
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=Field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as AviosCurrencySymbol } from './AviosCurrencySymbol';
|
|
1
2
|
export { default as Badge } from './Badge';
|
|
2
3
|
export { default as Box } from './Box';
|
|
3
4
|
export { default as Button } from './Button';
|
|
@@ -12,13 +13,16 @@ export { default as FieldDescription } from './FieldDescription';
|
|
|
12
13
|
export { default as FieldError } from './FieldError';
|
|
13
14
|
export { default as FieldHeader } from './FieldHeader';
|
|
14
15
|
export { default as FieldLabel } from './FieldLabel';
|
|
16
|
+
export { default as Fieldset } from './Fieldset';
|
|
17
|
+
export { default as FieldsetHeader } from './FieldsetHeader';
|
|
18
|
+
export { default as Form } from './Form';
|
|
15
19
|
export { default as Grid } from './Grid';
|
|
16
20
|
export { default as Heading } from './Heading';
|
|
17
21
|
export { default as Icon } from './Icon';
|
|
18
22
|
export { default as IconButton } from './IconButton';
|
|
23
|
+
export { default as Image } from './Image';
|
|
19
24
|
export { default as Link } from './Link';
|
|
20
25
|
export { default as LoadingSpinner } from './LoadingSpinner';
|
|
21
|
-
export { default as NewButton } from './NewButton';
|
|
22
26
|
export { default as NumberField } from './NumberField';
|
|
23
27
|
export { default as Paragraph } from './Paragraph';
|
|
24
28
|
export { default as Radio } from './Radio';
|