@alto-avios/alto-ui 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Accordion.css +1 -1
- package/dist/assets/Button.css +1 -1
- package/dist/assets/CalloutBanner.css +1 -1
- package/dist/assets/CreditCardNumberField.css +1 -1
- package/dist/assets/CreditCardSecurityCodeField.css +1 -0
- package/dist/assets/Image.css +1 -1
- package/dist/assets/Label.css +1 -0
- package/dist/assets/ListBoxItem.css +1 -0
- package/dist/assets/Paragraph.css +1 -1
- package/dist/assets/PhoneNumberField.css +1 -1
- package/dist/assets/SearchField.css +1 -0
- package/dist/assets/Section.css +1 -1
- package/dist/components/Accordion/Accordion.js +15 -15
- package/dist/components/Box/Box.d.ts +2 -2
- package/dist/components/Box/Box.js +1 -1
- package/dist/components/Button/Button.js +31 -31
- package/dist/components/CalloutBanner/CalloutBanner.d.ts +1 -1
- package/dist/components/CalloutBanner/CalloutBanner.js +16 -16
- package/dist/components/CreditCardNumberField/CreditCardNumberField.js +3 -3
- package/dist/components/CreditCardSecurityCodeField/CreditCardSecurityCodeField.d.ts +35 -0
- package/dist/components/CreditCardSecurityCodeField/CreditCardSecurityCodeField.js +65 -0
- package/dist/components/CreditCardSecurityCodeField/CreditCardSecurityCodeField.js.map +1 -0
- package/dist/components/CreditCardSecurityCodeField/index.d.ts +1 -0
- package/dist/components/CreditCardSecurityCodeField/index.js +5 -0
- package/dist/components/CreditCardSecurityCodeField/index.js.map +1 -0
- package/dist/components/Image/Image.js +6 -6
- package/dist/components/Label/Label.d.ts +23 -0
- package/dist/components/Label/Label.js +50 -0
- package/dist/components/Label/Label.js.map +1 -0
- package/dist/components/Label/index.d.ts +1 -0
- package/dist/components/Label/index.js +5 -0
- package/dist/components/Label/index.js.map +1 -0
- package/dist/components/ListBoxItem/ListBoxItem.d.ts +15 -0
- package/dist/components/ListBoxItem/ListBoxItem.js +32 -0
- package/dist/components/ListBoxItem/ListBoxItem.js.map +1 -0
- package/dist/components/ListBoxItem/index.d.ts +1 -0
- package/dist/components/ListBoxItem/index.js +5 -0
- package/dist/components/ListBoxItem/index.js.map +1 -0
- package/dist/components/NumberField/NumberField.d.ts +1 -1
- package/dist/components/NumberField/NumberField.js +6 -4
- package/dist/components/NumberField/NumberField.js.map +1 -1
- package/dist/components/Paragraph/Paragraph.js +8 -8
- package/dist/components/PasswordField/PasswordField.d.ts +2 -1
- package/dist/components/PasswordField/PasswordField.js +6 -5
- package/dist/components/PasswordField/PasswordField.js.map +1 -1
- package/dist/components/PhoneNumberField/PhoneNumberField.js +4 -4
- package/dist/components/SearchField/SearchField.d.ts +14 -0
- package/dist/components/SearchField/SearchField.js +48 -0
- package/dist/components/SearchField/SearchField.js.map +1 -0
- package/dist/components/SearchField/index.d.ts +1 -0
- package/dist/components/SearchField/index.js +5 -0
- package/dist/components/SearchField/index.js.map +1 -0
- package/dist/components/Section/Section.d.ts +6 -2
- package/dist/components/Section/Section.js +42 -14
- package/dist/components/Section/Section.js.map +1 -1
- package/dist/components/SelectNative/SelectNative.d.ts +6 -1
- package/dist/components/SelectNative/SelectNative.js +7 -1
- package/dist/components/SelectNative/SelectNative.js.map +1 -1
- package/dist/components/TagGroup/TagGroup.d.ts +21 -1
- package/dist/components/TagGroup/TagGroup.js +6 -2
- package/dist/components/TagGroup/TagGroup.js.map +1 -1
- package/dist/components/TextAreaField/TextAreaField.d.ts +1 -1
- package/dist/components/TextAreaField/TextAreaField.js +5 -3
- package/dist/components/TextAreaField/TextAreaField.js.map +1 -1
- package/dist/components/TextField/TextField.d.ts +1 -1
- package/dist/components/TextField/TextField.js +6 -4
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.js +8 -0
- package/dist/components/index.js.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/foregroundColour/foregroundColor.d.ts +1 -1
- package/dist/utils/foregroundColour/foregroundColor.js +3 -0
- package/dist/utils/foregroundColour/foregroundColor.js.map +1 -1
- package/dist/utils/stories/iconPropsArgTypes.js +1 -1
- package/package.json +2 -3
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
3
|
+
import { foregroundColorVariants } from "../../utils/foregroundColour/foregroundColor.js";
|
|
4
|
+
import '../../assets/Label.css';const label$1 = "_label_1w8ui_1";
|
|
5
|
+
const xxs = "_xxs_1w8ui_7";
|
|
6
|
+
const xs = "_xs_1w8ui_13";
|
|
7
|
+
const sm = "_sm_1w8ui_19";
|
|
8
|
+
const md = "_md_1w8ui_25";
|
|
9
|
+
const lg = "_lg_1w8ui_31";
|
|
10
|
+
const styles = {
|
|
11
|
+
label: label$1,
|
|
12
|
+
xxs,
|
|
13
|
+
xs,
|
|
14
|
+
sm,
|
|
15
|
+
md,
|
|
16
|
+
lg
|
|
17
|
+
};
|
|
18
|
+
const label = cva(styles.label, {
|
|
19
|
+
variants: {
|
|
20
|
+
size: {
|
|
21
|
+
"2xs": styles.xxs,
|
|
22
|
+
xs: styles.xs,
|
|
23
|
+
sm: styles.sm,
|
|
24
|
+
md: styles.md,
|
|
25
|
+
lg: styles.lg
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
defaultVariants: {
|
|
29
|
+
size: "md"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const Label = ({
|
|
33
|
+
children,
|
|
34
|
+
as: Component = "span",
|
|
35
|
+
size = "md",
|
|
36
|
+
foregroundColor,
|
|
37
|
+
...props
|
|
38
|
+
}) => {
|
|
39
|
+
const classNames = `${label({
|
|
40
|
+
size
|
|
41
|
+
})} ${foregroundColorVariants({
|
|
42
|
+
foregroundColor
|
|
43
|
+
})}`;
|
|
44
|
+
return /* @__PURE__ */ jsx(Component, { className: classNames, ...props, children });
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
Label,
|
|
48
|
+
Label as default
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=Label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Label.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Label';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ListBoxItemProps as AriaListBoxItemProps } from 'react-aria-components';
|
|
3
|
+
export interface ListBoxItemProps extends AriaListBoxItemProps {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
/**
|
|
6
|
+
* Enables loading state
|
|
7
|
+
*/
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Enables disabled state
|
|
11
|
+
*/
|
|
12
|
+
labelLoading?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const ListBoxItem: ({ children, isLoading, labelLoading, ...props }: ListBoxItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default ListBoxItem;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ListBoxItem as ListBoxItem$1, Text } from "react-aria-components";
|
|
3
|
+
import { Icon } from "../Icon/Icon.js";
|
|
4
|
+
import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
|
|
5
|
+
import '../../assets/ListBoxItem.css';const listBoxItem = "_listBoxItem_1d71p_1";
|
|
6
|
+
const listBoxItemLabel = "_listBoxItemLabel_1d71p_17";
|
|
7
|
+
const listBoxItemIcon = "_listBoxItemIcon_1d71p_65";
|
|
8
|
+
const listBoxItemSelected = "_listBoxItemSelected_1d71p_71";
|
|
9
|
+
const styles = {
|
|
10
|
+
listBoxItem,
|
|
11
|
+
listBoxItemLabel,
|
|
12
|
+
listBoxItemIcon,
|
|
13
|
+
listBoxItemSelected
|
|
14
|
+
};
|
|
15
|
+
const ListBoxItem = ({
|
|
16
|
+
children,
|
|
17
|
+
isLoading,
|
|
18
|
+
labelLoading = "Loading",
|
|
19
|
+
...props
|
|
20
|
+
}) => {
|
|
21
|
+
return /* @__PURE__ */ jsxs(ListBoxItem$1, { className: styles["listBoxItem"], ...isLoading && {
|
|
22
|
+
"data-loading": true
|
|
23
|
+
}, ...props, children: [
|
|
24
|
+
/* @__PURE__ */ jsx(Text, { slot: "label", className: styles["listBoxItemLabel"], children: isLoading ? labelLoading : children }),
|
|
25
|
+
isLoading ? /* @__PURE__ */ jsx(LoadingSpinner, { size: "1x", className: styles["listBoxItemIcon"] }) : /* @__PURE__ */ jsx("span", { className: styles["listBoxItemSelected"], children: /* @__PURE__ */ jsx(Icon, { iconName: "check", scale: "1x", padding: "square" }) })
|
|
26
|
+
] });
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
ListBoxItem,
|
|
30
|
+
ListBoxItem as default
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=ListBoxItem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListBoxItem.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ListBoxItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -21,5 +21,5 @@ export interface NumberFieldProps extends FieldProps<AriaNumberFieldProps> {
|
|
|
21
21
|
*/
|
|
22
22
|
maxValue?: number;
|
|
23
23
|
}
|
|
24
|
-
export declare const NumberField: (
|
|
24
|
+
export declare const NumberField: import('react').ForwardRefExoticComponent<NumberFieldProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
25
25
|
export default NumberField;
|
|
@@ -3,6 +3,7 @@ import { NumberField as NumberField$1, Group, Button, Input } from "react-aria-c
|
|
|
3
3
|
import { Icon } from "../Icon/Icon.js";
|
|
4
4
|
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
5
5
|
import { Field } from "../_base/Field/Field.js";
|
|
6
|
+
import { forwardRef } from "react";
|
|
6
7
|
import '../../assets/NumberField.css';const numberField = "_numberField_1knmk_1";
|
|
7
8
|
const numberFieldGroup = "_numberFieldGroup_1knmk_6";
|
|
8
9
|
const numberFieldInput = "_numberFieldInput_1knmk_59";
|
|
@@ -13,7 +14,7 @@ const styles = {
|
|
|
13
14
|
numberFieldInput,
|
|
14
15
|
numberFieldButton
|
|
15
16
|
};
|
|
16
|
-
const NumberField = ({
|
|
17
|
+
const NumberField = forwardRef(({
|
|
17
18
|
labelIncrement = "Increase",
|
|
18
19
|
labelDecrement = "Decrease",
|
|
19
20
|
minValue,
|
|
@@ -21,13 +22,14 @@ const NumberField = ({
|
|
|
21
22
|
isInvalid = false,
|
|
22
23
|
isDisabled = false,
|
|
23
24
|
...props
|
|
24
|
-
}) => {
|
|
25
|
+
}, ref) => {
|
|
25
26
|
return /* @__PURE__ */ jsx(Field, { as: NumberField$1, className: styles.numberField, minValue, maxValue, isInvalid, isDisabled, ...props, children: /* @__PURE__ */ jsxs(Group, { className: styles.numberFieldGroup, children: [
|
|
26
27
|
/* @__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(Input, { className: styles.numberFieldInput, ref }),
|
|
28
29
|
/* @__PURE__ */ jsx(Tooltip, { placement: "bottom", label: labelIncrement, children: /* @__PURE__ */ jsx(Button, { className: styles.numberFieldButton, slot: "increment", children: /* @__PURE__ */ jsx(Icon, { iconName: "plus" }) }) })
|
|
29
30
|
] }) });
|
|
30
|
-
};
|
|
31
|
+
});
|
|
32
|
+
NumberField.displayName = "NumberField";
|
|
31
33
|
export {
|
|
32
34
|
NumberField,
|
|
33
35
|
NumberField as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberField.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NumberField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
3
3
|
import { foregroundColorVariants } from "../../utils/foregroundColour/foregroundColor.js";
|
|
4
|
-
import '../../assets/Paragraph.css';const paragraph$1 = "
|
|
5
|
-
const xs = "
|
|
6
|
-
const sm = "
|
|
7
|
-
const md = "
|
|
8
|
-
const lg = "
|
|
9
|
-
const start = "
|
|
10
|
-
const center = "
|
|
11
|
-
const end = "
|
|
4
|
+
import '../../assets/Paragraph.css';const paragraph$1 = "_paragraph_rcir1_1";
|
|
5
|
+
const xs = "_xs_rcir1_13";
|
|
6
|
+
const sm = "_sm_rcir1_19";
|
|
7
|
+
const md = "_md_rcir1_25";
|
|
8
|
+
const lg = "_lg_rcir1_31";
|
|
9
|
+
const start = "_start_rcir1_37";
|
|
10
|
+
const center = "_center_rcir1_41";
|
|
11
|
+
const end = "_end_rcir1_45";
|
|
12
12
|
const styles = {
|
|
13
13
|
paragraph: paragraph$1,
|
|
14
14
|
xs,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { FieldProps } from '../_base/Field';
|
|
2
3
|
import { TextFieldProps as AriaTextFieldProps } from 'react-aria-components';
|
|
3
4
|
type PasswordStrengthValidation = {
|
|
@@ -26,5 +27,5 @@ export interface PasswordFieldProps extends FieldProps<AriaTextFieldProps> {
|
|
|
26
27
|
*/
|
|
27
28
|
requirementsLabel?: string;
|
|
28
29
|
}
|
|
29
|
-
export declare const PasswordField:
|
|
30
|
+
export declare const PasswordField: React.ForwardRefExoticComponent<PasswordFieldProps & React.RefAttributes<HTMLInputElement>>;
|
|
30
31
|
export default PasswordField;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useState } from "react";
|
|
2
|
+
import React, { forwardRef, useState } from "react";
|
|
3
3
|
import { Field } from "../_base/Field/Field.js";
|
|
4
4
|
import { TextField, Group, Input } from "react-aria-components";
|
|
5
5
|
import { IconButton } from "../IconButton/IconButton.js";
|
|
@@ -19,12 +19,12 @@ const styles = {
|
|
|
19
19
|
passwordStrengthItemNeutral,
|
|
20
20
|
passwordStrengthItemInvalid
|
|
21
21
|
};
|
|
22
|
-
const PasswordField = ({
|
|
22
|
+
const PasswordField = forwardRef(({
|
|
23
23
|
tooltipLabelShowPassword = "Show Password",
|
|
24
24
|
tooltipLabelHidePassword = "Hide Password",
|
|
25
25
|
requirementsLabel = "Password requirements",
|
|
26
26
|
...props
|
|
27
|
-
}) => {
|
|
27
|
+
}, ref) => {
|
|
28
28
|
var _a;
|
|
29
29
|
const [internalVisible, setInternalVisible] = useState(props.isVisible || false);
|
|
30
30
|
const [internalValue, setInternalValue] = useState(props == null ? void 0 : props.defaultValue);
|
|
@@ -38,7 +38,7 @@ const PasswordField = ({
|
|
|
38
38
|
const tooltipLabel = isVisibleState ? tooltipLabelHidePassword : tooltipLabelShowPassword;
|
|
39
39
|
return /* @__PURE__ */ jsx("div", { className: styles["passwordField"], children: /* @__PURE__ */ jsxs(Field, { as: TextField, className: styles.passwordField, label: "Password", ...props, children: [
|
|
40
40
|
/* @__PURE__ */ jsxs(Group, { children: [
|
|
41
|
-
/* @__PURE__ */ jsx(Input, { type: isVisibleState ? "text" : "password", value, onChange: handleChange }),
|
|
41
|
+
/* @__PURE__ */ jsx(Input, { type: isVisibleState ? "text" : "password", value, onChange: handleChange, ref }),
|
|
42
42
|
/* @__PURE__ */ jsx(IconButton, { size: "sm", iconProps: isVisibleState ? {
|
|
43
43
|
iconName: "eye",
|
|
44
44
|
iconPrefix: "fas"
|
|
@@ -49,7 +49,7 @@ const PasswordField = ({
|
|
|
49
49
|
] }),
|
|
50
50
|
/* @__PURE__ */ jsx("ul", { className: styles["passwordField__strength"], "aria-label": requirementsLabel, "aria-live": "polite", children: (_a = props.strengthValidations) == null ? void 0 : _a.map((validation) => /* @__PURE__ */ jsx(PasswordStrengthItem, { status: value ? validation.validation(value) ? "valid" : "invalid" : "neutral", message: validation.message }, `${validation.message}-${value}`)) })
|
|
51
51
|
] }) });
|
|
52
|
-
};
|
|
52
|
+
});
|
|
53
53
|
const passwordStrengthItem = cva(styles.passwordStrengthItem, {
|
|
54
54
|
variants: {
|
|
55
55
|
status: {
|
|
@@ -97,6 +97,7 @@ const PasswordStrengthItem = ({
|
|
|
97
97
|
/* @__PURE__ */ jsx("span", { children: message })
|
|
98
98
|
] });
|
|
99
99
|
};
|
|
100
|
+
PasswordField.displayName = "PasswordField";
|
|
100
101
|
export {
|
|
101
102
|
PasswordField,
|
|
102
103
|
PasswordField as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordField.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PasswordField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,10 +4,10 @@ import { TextField, Input } from "react-aria-components";
|
|
|
4
4
|
import { u as usePatternFormat, N as NumberFormatBase } from "../../react-number-format.es-DMLgWFZX.js";
|
|
5
5
|
import { DEFAULT_PATTERN, getCountryOptions, getCountryFlagEmoji, countryPhoneMap, getPhoneNumberValue } from "../../utils/phoneNumber/phoneNumber.js";
|
|
6
6
|
import { Field } from "../_base/Field/Field.js";
|
|
7
|
-
import '../../assets/PhoneNumberField.css';const phoneNumberField = "
|
|
8
|
-
const selectHandlerValue = "
|
|
9
|
-
const selectHandlerIcon = "
|
|
10
|
-
const selectWrapper = "
|
|
7
|
+
import '../../assets/PhoneNumberField.css';const phoneNumberField = "_phoneNumberField_trpoz_1";
|
|
8
|
+
const selectHandlerValue = "_selectHandlerValue_trpoz_34";
|
|
9
|
+
const selectHandlerIcon = "_selectHandlerIcon_trpoz_65";
|
|
10
|
+
const selectWrapper = "_selectWrapper_trpoz_77";
|
|
11
11
|
const styles = {
|
|
12
12
|
phoneNumberField,
|
|
13
13
|
selectHandlerValue,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FieldProps } from '../_base/Field';
|
|
2
|
+
import { TextFieldProps as AriaTextFieldProps } from 'react-aria-components';
|
|
3
|
+
export interface SearchFieldProps extends FieldProps<AriaTextFieldProps> {
|
|
4
|
+
/**
|
|
5
|
+
* Label for clear button
|
|
6
|
+
*/
|
|
7
|
+
clearLabel?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Placeholder for the search field
|
|
10
|
+
*/
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const SearchField: ({ clearLabel, placeholder, ...props }: SearchFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default SearchField;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useRef, useState } from "react";
|
|
3
|
+
import { Field } from "../_base/Field/Field.js";
|
|
4
|
+
import { TextField, Group, Input } from "react-aria-components";
|
|
5
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
6
|
+
import { Icon } from "../Icon/Icon.js";
|
|
7
|
+
import '../../assets/SearchField.css';const searchField = "_searchField_acl05_1";
|
|
8
|
+
const iconStart = "_iconStart_acl05_80";
|
|
9
|
+
const styles = {
|
|
10
|
+
searchField,
|
|
11
|
+
iconStart
|
|
12
|
+
};
|
|
13
|
+
const SearchField = ({
|
|
14
|
+
clearLabel = "Delete search",
|
|
15
|
+
placeholder,
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
const inputRef = useRef(null);
|
|
19
|
+
const [internalValue, setInternalValue] = useState(props == null ? void 0 : props.defaultValue);
|
|
20
|
+
const value = (props == null ? void 0 : props.value) ?? internalValue;
|
|
21
|
+
const setValue = React.useCallback((nextValue) => {
|
|
22
|
+
var _a;
|
|
23
|
+
setInternalValue(nextValue);
|
|
24
|
+
(_a = props == null ? void 0 : props.onChange) == null ? void 0 : _a.call(props, nextValue);
|
|
25
|
+
}, [props == null ? void 0 : props.onChange]);
|
|
26
|
+
const handleClear = React.useCallback(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
setValue("");
|
|
29
|
+
(_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.focus();
|
|
30
|
+
}, [setValue]);
|
|
31
|
+
const tooltipLabel = clearLabel;
|
|
32
|
+
return /* @__PURE__ */ jsx("div", { className: styles["searchField"], children: /* @__PURE__ */ jsx(Field, { as: TextField, className: styles.searchField, ...props, children: /* @__PURE__ */ jsxs(Group, { onClick: () => {
|
|
33
|
+
var _a;
|
|
34
|
+
return (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.focus();
|
|
35
|
+
}, children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Icon, { iconSize: "1x", padding: "roomy", iconName: "search", className: styles.iconStart }),
|
|
37
|
+
/* @__PURE__ */ jsx(Input, { type: "text", value, onChange: (e) => setValue(e.target.value), ref: inputRef, placeholder }),
|
|
38
|
+
!!value && /* @__PURE__ */ jsx(IconButton, { size: "sm", iconProps: {
|
|
39
|
+
iconName: "xmark",
|
|
40
|
+
iconPrefix: "fas"
|
|
41
|
+
}, onClick: (props == null ? void 0 : props.isDisabled) ? void 0 : handleClear, isDisabled: props == null ? void 0 : props.isDisabled, styleVariant: "neutral", emphasis: "tertiary", "aria-label": tooltipLabel, tooltipLabel })
|
|
42
|
+
] }) }) });
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
SearchField,
|
|
46
|
+
SearchField as default
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=SearchField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './SearchField';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { BackgroundVariants } from '../../utils/backgroundColor/backgroundColor';
|
|
3
3
|
import { PaddingVariants } from '../../utils/padding/padding';
|
|
4
|
+
import { FlexVariants } from '../../utils/flex/flex';
|
|
4
5
|
type SectionPaddingValue = 'default' | PaddingVariants['paddingX'];
|
|
5
6
|
type SectionPadding = {
|
|
6
7
|
paddingX?: SectionPaddingValue;
|
|
@@ -10,7 +11,7 @@ type SectionPadding = {
|
|
|
10
11
|
paddingBottom?: SectionPaddingValue;
|
|
11
12
|
paddingLeft?: SectionPaddingValue;
|
|
12
13
|
};
|
|
13
|
-
export interface SectionProps extends BackgroundVariants, SectionPadding {
|
|
14
|
+
export interface SectionProps extends BackgroundVariants, SectionPadding, Pick<FlexVariants, 'flexDirection' | 'justifyContent' | 'alignItems'> {
|
|
14
15
|
children: React.ReactNode;
|
|
15
16
|
containerMaxWidth?: 'full-width' | 'page';
|
|
16
17
|
style?: React.CSSProperties;
|
|
@@ -21,8 +22,11 @@ interface ContainerProps {
|
|
|
21
22
|
children: React.ReactNode;
|
|
22
23
|
className?: string;
|
|
23
24
|
containerMaxWidth?: 'full-width' | 'page';
|
|
25
|
+
flexDirection?: FlexVariants['flexDirection'];
|
|
26
|
+
justifyContent?: FlexVariants['justifyContent'];
|
|
27
|
+
alignItems?: FlexVariants['alignItems'];
|
|
24
28
|
}
|
|
25
|
-
declare const Container: ({ children, className, containerMaxWidth, }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
declare const Container: ({ children, className, containerMaxWidth, flexDirection, justifyContent, alignItems, }: ContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
30
|
interface SectionComponent extends React.ForwardRefExoticComponent<SectionProps & React.RefAttributes<HTMLElement>> {
|
|
27
31
|
Container: typeof Container;
|
|
28
32
|
}
|
|
@@ -3,21 +3,22 @@ import React, { forwardRef } from "react";
|
|
|
3
3
|
import { backgroundColorVariants } from "../../utils/backgroundColor/backgroundColor.js";
|
|
4
4
|
import { paddingVariants } from "../../utils/padding/padding.js";
|
|
5
5
|
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
6
|
+
import { flexVariants } from "../../utils/flex/flex.js";
|
|
7
|
+
import '../../assets/Section.css';const section = "_section_1w3or_1";
|
|
8
|
+
const container = "_container_1w3or_7";
|
|
9
|
+
const pageWidth = "_pageWidth_1w3or_15";
|
|
10
|
+
const fullWidth = "_fullWidth_1w3or_19";
|
|
11
|
+
const paddingTopDefault = "_paddingTopDefault_1w3or_33";
|
|
12
|
+
const paddingRightDefault = "_paddingRightDefault_1w3or_37";
|
|
13
|
+
const paddingBottomDefault = "_paddingBottomDefault_1w3or_41";
|
|
14
|
+
const paddingLeftDefault = "_paddingLeftDefault_1w3or_45";
|
|
14
15
|
const styles = {
|
|
15
16
|
section,
|
|
16
17
|
container,
|
|
17
18
|
pageWidth,
|
|
18
19
|
fullWidth,
|
|
19
|
-
"paddingX-default": "_paddingX-
|
|
20
|
-
"paddingY-default": "_paddingY-
|
|
20
|
+
"paddingX-default": "_paddingX-default_1w3or_23",
|
|
21
|
+
"paddingY-default": "_paddingY-default_1w3or_28",
|
|
21
22
|
paddingTopDefault,
|
|
22
23
|
paddingRightDefault,
|
|
23
24
|
paddingBottomDefault,
|
|
@@ -48,8 +49,23 @@ const sectionPaddingVariants = cva("", {
|
|
|
48
49
|
const Container = ({
|
|
49
50
|
children,
|
|
50
51
|
className,
|
|
51
|
-
containerMaxWidth = "page"
|
|
52
|
-
|
|
52
|
+
containerMaxWidth = "page",
|
|
53
|
+
flexDirection,
|
|
54
|
+
justifyContent,
|
|
55
|
+
alignItems
|
|
56
|
+
}) => {
|
|
57
|
+
const widthClassName = containerMaxWidth === "full-width" ? "fullWidth" : "pageWidth";
|
|
58
|
+
return /* @__PURE__ */ jsx("div", { className: `
|
|
59
|
+
${styles.container}
|
|
60
|
+
${styles[widthClassName]}
|
|
61
|
+
${flexVariants({
|
|
62
|
+
flexDirection,
|
|
63
|
+
justifyContent,
|
|
64
|
+
alignItems
|
|
65
|
+
})}
|
|
66
|
+
${className || ""}
|
|
67
|
+
`.trim(), children });
|
|
68
|
+
};
|
|
53
69
|
const Section = forwardRef(({
|
|
54
70
|
children,
|
|
55
71
|
containerMaxWidth = "page",
|
|
@@ -62,7 +78,10 @@ const Section = forwardRef(({
|
|
|
62
78
|
paddingX,
|
|
63
79
|
paddingY = "default",
|
|
64
80
|
style,
|
|
65
|
-
className
|
|
81
|
+
className,
|
|
82
|
+
flexDirection,
|
|
83
|
+
justifyContent,
|
|
84
|
+
alignItems
|
|
66
85
|
}, ref) => {
|
|
67
86
|
if (backgroundColour && !backgroundColor) {
|
|
68
87
|
console.warn("Warning: `backgroundColour` is deprecated and will be removed in a future release. Please use `backgroundColor` instead.");
|
|
@@ -89,12 +108,21 @@ const Section = forwardRef(({
|
|
|
89
108
|
${backgroundColorVariants({
|
|
90
109
|
backgroundColor: resolvedBackgroundColor
|
|
91
110
|
})}
|
|
111
|
+
${flexVariants({
|
|
112
|
+
display: flexDirection || justifyContent ? "flex" : void 0,
|
|
113
|
+
flexDirection,
|
|
114
|
+
justifyContent,
|
|
115
|
+
alignItems
|
|
116
|
+
})}
|
|
92
117
|
${className || ""}
|
|
93
118
|
`.trim(), style, children: React.Children.map(children, (child) => {
|
|
94
119
|
if (React.isValidElement(child) && child.type === Container) {
|
|
95
120
|
return React.cloneElement(child, {
|
|
96
121
|
...child.props,
|
|
97
|
-
containerMaxWidth
|
|
122
|
+
containerMaxWidth,
|
|
123
|
+
flexDirection,
|
|
124
|
+
justifyContent,
|
|
125
|
+
alignItems
|
|
98
126
|
});
|
|
99
127
|
}
|
|
100
128
|
return child;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Section.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ValidationResult } from 'react-aria-components';
|
|
2
|
+
import { ChangeEvent } from 'react';
|
|
2
3
|
export interface SelectNativeOption {
|
|
3
4
|
label: string;
|
|
4
5
|
value: string;
|
|
@@ -51,6 +52,10 @@ export interface SelectNativeProps {
|
|
|
51
52
|
* Optional ID for the select element. If not provided, one will be generated.
|
|
52
53
|
*/
|
|
53
54
|
id?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Callback function when the selection changes
|
|
57
|
+
*/
|
|
58
|
+
onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;
|
|
54
59
|
}
|
|
55
|
-
export declare const SelectNative: ({ label, description, errorMessage, isInvalid, isDisabled, isRequired, placeholder, options, defaultValue, value, id: providedId, ...props }: SelectNativeProps) => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
export declare const SelectNative: ({ label, description, errorMessage, isInvalid, isDisabled, isRequired, placeholder, options, defaultValue, value, id: providedId, onChange, ...props }: SelectNativeProps) => import("react/jsx-runtime").JSX.Element;
|
|
56
61
|
export default SelectNative;
|
|
@@ -20,14 +20,20 @@ const SelectNative = ({
|
|
|
20
20
|
defaultValue,
|
|
21
21
|
value,
|
|
22
22
|
id: providedId,
|
|
23
|
+
onChange,
|
|
23
24
|
...props
|
|
24
25
|
}) => {
|
|
25
26
|
const uniqueId = useId();
|
|
26
27
|
const id = providedId || `select-${uniqueId}`;
|
|
27
28
|
const showPlaceholder = !defaultValue && !value;
|
|
29
|
+
const handleChange = (event) => {
|
|
30
|
+
if (onChange) {
|
|
31
|
+
onChange(event);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
28
34
|
return /* @__PURE__ */ jsxs(TextField, { className: styles.select, defaultValue, value, isDisabled, isInvalid, ...props, children: [
|
|
29
35
|
label && /* @__PURE__ */ jsx(FieldHeader, { label, description, isInvalid, isRequired, errorMessage, labelFor: id }),
|
|
30
|
-
/* @__PURE__ */ jsxs("select", { id, className: styles.selectInput, defaultValue, value, disabled: isDisabled, required: isRequired, "aria-invalid": isInvalid, children: [
|
|
36
|
+
/* @__PURE__ */ jsxs("select", { id, className: styles.selectInput, defaultValue, value, disabled: isDisabled, required: isRequired, "aria-invalid": isInvalid, onChange: handleChange, children: [
|
|
31
37
|
showPlaceholder && placeholder && /* @__PURE__ */ jsx("option", { value: "", disabled: true, hidden: true, children: placeholder }),
|
|
32
38
|
options.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.label }, option.value))
|
|
33
39
|
] })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectNative.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SelectNative.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,10 +1,30 @@
|
|
|
1
1
|
import { TagGroupProps as AriaTagGroupProps, PressEvent, TagListProps } from 'react-aria-components';
|
|
2
2
|
export interface TagGroupProps<T> extends Omit<AriaTagGroupProps, 'children'>, Pick<TagListProps<T>, 'items' | 'children' | 'renderEmptyState'> {
|
|
3
|
+
/**
|
|
4
|
+
* Optional label text
|
|
5
|
+
*/
|
|
3
6
|
label?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Optional description text
|
|
9
|
+
*/
|
|
4
10
|
description?: string;
|
|
11
|
+
/**
|
|
12
|
+
* AriaLabel for the tag group. Required for accessibility if no label is provided
|
|
13
|
+
*/
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Selection mode for the tag group
|
|
17
|
+
* @default 'single'
|
|
18
|
+
*/
|
|
5
19
|
selectionMode?: 'single' | 'multiple';
|
|
20
|
+
/**
|
|
21
|
+
* Whether to show a clear button
|
|
22
|
+
*/
|
|
6
23
|
clearButton?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Function to call when the clear button is clicked
|
|
26
|
+
*/
|
|
7
27
|
clearButtonOnClick?: (e: PressEvent) => void;
|
|
8
28
|
}
|
|
9
|
-
export declare const TagGroup: <T extends object>({ label, description, items, children, renderEmptyState, clearButton, clearButtonOnClick, selectionMode, ...props }: TagGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const TagGroup: <T extends object>({ label, description, ariaLabel, items, children, renderEmptyState, clearButton, clearButtonOnClick, selectionMode, ...props }: TagGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
30
|
export default TagGroup;
|
|
@@ -15,6 +15,7 @@ const styles = {
|
|
|
15
15
|
const TagGroup = ({
|
|
16
16
|
label,
|
|
17
17
|
description,
|
|
18
|
+
ariaLabel,
|
|
18
19
|
items,
|
|
19
20
|
children,
|
|
20
21
|
renderEmptyState,
|
|
@@ -23,8 +24,11 @@ const TagGroup = ({
|
|
|
23
24
|
selectionMode = "single",
|
|
24
25
|
...props
|
|
25
26
|
}) => {
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
if (!label && !ariaLabel) {
|
|
28
|
+
console.warn("⚠️ [TagGroup] Accessibility Warning: You must provide either a 'label' or 'ariaLabel' for screen reader support.");
|
|
29
|
+
}
|
|
30
|
+
return /* @__PURE__ */ jsxs(TagGroup$1, { className: styles.tagGroup, selectionMode, "aria-label": label ? void 0 : ariaLabel, ...props, children: [
|
|
31
|
+
(label || clearButton) && /* @__PURE__ */ jsxs("span", { className: styles.spanContainer, children: [
|
|
28
32
|
/* @__PURE__ */ jsx(FieldLabel, { children: label }),
|
|
29
33
|
clearButton && /* @__PURE__ */ jsx(Button, { styleVariant: "accent", emphasis: "quaternary", size: "sm", onPress: clearButtonOnClick, children: "Clear" })
|
|
30
34
|
] }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TagGroup.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { TextFieldProps } from '../TextField/TextField';
|
|
2
|
-
export declare const TextAreaField: (
|
|
2
|
+
export declare const TextAreaField: import('react').ForwardRefExoticComponent<TextFieldProps & import('react').RefAttributes<HTMLTextAreaElement>>;
|
|
3
3
|
export default TextAreaField;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { TextField, TextArea } from "react-aria-components";
|
|
3
3
|
import { Field } from "../_base/Field/Field.js";
|
|
4
|
+
import { forwardRef } from "react";
|
|
4
5
|
import '../../assets/TextAreaField.css';const textAreaField = "_textAreaField_1hjyj_1";
|
|
5
6
|
const validationError = "_validationError_1hjyj_71";
|
|
6
7
|
const styles = {
|
|
7
8
|
textAreaField,
|
|
8
9
|
validationError
|
|
9
10
|
};
|
|
10
|
-
const TextAreaField = (props) => {
|
|
11
|
-
return /* @__PURE__ */ jsx(Field, { as: TextField, className: styles.textAreaField, ...props, children: /* @__PURE__ */ jsx(TextArea, {}) });
|
|
12
|
-
};
|
|
11
|
+
const TextAreaField = forwardRef((props, ref) => {
|
|
12
|
+
return /* @__PURE__ */ jsx(Field, { as: TextField, className: styles.textAreaField, ...props, children: /* @__PURE__ */ jsx(TextArea, { ref }) });
|
|
13
|
+
});
|
|
14
|
+
TextAreaField.displayName = "TextAreaField";
|
|
13
15
|
export {
|
|
14
16
|
TextAreaField,
|
|
15
17
|
TextAreaField as default
|