@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
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React, ComponentType, ElementType, ReactNode } from 'react';
|
|
2
|
+
import { AriaButtonOptions } from '@react-aria/button';
|
|
3
|
+
import { HoverProps } from '@react-aria/interactions';
|
|
4
|
+
import { IconProps } from '../Icon/Icon';
|
|
3
5
|
export type ButtonSize = 'lg' | 'md' | 'sm';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export interface ButtonProps {
|
|
6
|
+
export type ButtonTextAlignement = 'left' | 'center' | 'right';
|
|
7
|
+
export type DefaultButtonProps = ButtonProps<'button'>;
|
|
8
|
+
export type ButtonProps<T extends ElementType = 'button'> = AriaButtonOptions<T> & HoverProps & {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* The HTML element to be rendered as the button.
|
|
10
11
|
*/
|
|
12
|
+
as?: T;
|
|
13
|
+
elementType?: 'a' | 'button';
|
|
11
14
|
/**
|
|
12
15
|
* What the base style of button is
|
|
13
16
|
* @default 'accent'
|
|
17
|
+
* @deprecated use styleVariant instead
|
|
14
18
|
*/
|
|
15
19
|
styleType?: 'accent' | 'critical' | 'neutral' | 'white';
|
|
20
|
+
/**
|
|
21
|
+
* What the base style of button is
|
|
22
|
+
* @default 'accent'
|
|
23
|
+
*/
|
|
24
|
+
styleVariant?: 'accent' | 'critical' | 'neutral' | 'white';
|
|
16
25
|
/**
|
|
17
26
|
* What the purpose is for the button
|
|
18
27
|
* @default 'primary'
|
|
@@ -24,81 +33,164 @@ export interface ButtonProps {
|
|
|
24
33
|
*/
|
|
25
34
|
size?: ButtonSize;
|
|
26
35
|
/**
|
|
27
|
-
* Whether the
|
|
36
|
+
* Whether an icon should display at the end of Button and icon properties
|
|
37
|
+
* @default
|
|
28
38
|
*/
|
|
29
|
-
|
|
39
|
+
iconEndProps?: IconProps;
|
|
40
|
+
/**
|
|
41
|
+
* Whether an icon should display at the start of the Button and icon properties
|
|
42
|
+
*/
|
|
43
|
+
iconStartProps?: IconProps;
|
|
30
44
|
/**
|
|
31
45
|
* Whether the button leading has an icon
|
|
46
|
+
* @deprecated use iconStartProps instead
|
|
32
47
|
*/
|
|
33
48
|
hasLeadingIcon?: boolean;
|
|
34
49
|
/**
|
|
35
50
|
* Leading icon name
|
|
51
|
+
* @deprecated use iconStartProps instead
|
|
36
52
|
*/
|
|
37
53
|
leadingIconName?: string;
|
|
38
54
|
/**
|
|
39
55
|
* Whether the button trailing has an icon
|
|
56
|
+
* @deprecated use iconEndProps instead
|
|
40
57
|
*/
|
|
41
58
|
hasTrailingIcon?: boolean;
|
|
42
59
|
/**
|
|
43
60
|
* Trailing icon name
|
|
61
|
+
* @deprecated use iconEndProps instead
|
|
44
62
|
*/
|
|
45
63
|
trailingIconName?: string;
|
|
64
|
+
/**
|
|
65
|
+
* isLoading is a boolean that will show a spinner in the button
|
|
66
|
+
*/
|
|
67
|
+
isLoading?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The text alignment of the button
|
|
70
|
+
*/
|
|
71
|
+
textAlign?: ButtonTextAlignement;
|
|
72
|
+
/**
|
|
73
|
+
* The content for the button.
|
|
74
|
+
*/
|
|
75
|
+
children?: ReactNode;
|
|
46
76
|
/**
|
|
47
77
|
* Whether the element should receive focus on render.
|
|
48
78
|
*/
|
|
49
79
|
type?: 'button' | 'submit' | 'reset';
|
|
50
80
|
/**
|
|
51
|
-
*
|
|
81
|
+
* Whether the button should be full width.
|
|
52
82
|
*/
|
|
53
|
-
|
|
83
|
+
fullWidth?: boolean;
|
|
54
84
|
/**
|
|
55
|
-
*
|
|
85
|
+
* @deprecated onPress should be preferred
|
|
86
|
+
* Handler to be called when the button is clicked.
|
|
56
87
|
*/
|
|
57
|
-
|
|
88
|
+
onClick?: React.MouseEventHandler;
|
|
58
89
|
/**
|
|
59
|
-
* The
|
|
90
|
+
* The target of the link (if `as` is set to 'a').
|
|
60
91
|
*/
|
|
61
|
-
|
|
92
|
+
target?: '_blank' | '_self' | '_parent' | '_top';
|
|
62
93
|
/**
|
|
63
|
-
*
|
|
94
|
+
* What type of focus style to apply to the button.
|
|
64
95
|
*/
|
|
65
|
-
|
|
96
|
+
focusStyle?: 'default' | 'white';
|
|
66
97
|
/**
|
|
67
|
-
*
|
|
98
|
+
* Passthrough props for the button element.
|
|
68
99
|
*/
|
|
69
|
-
|
|
100
|
+
passthroughProps?: Partial<T extends ComponentType<infer P> ? P : T extends keyof JSX.IntrinsicElements ? JSX.IntrinsicElements[T] : never>;
|
|
101
|
+
};
|
|
102
|
+
export declare const Button: React.ForwardRefExoticComponent<AriaButtonOptions<React.ElementType> & HoverProps & {
|
|
70
103
|
/**
|
|
71
|
-
*
|
|
104
|
+
* The HTML element to be rendered as the button.
|
|
72
105
|
*/
|
|
73
|
-
|
|
106
|
+
as?: React.ElementType | undefined;
|
|
107
|
+
elementType?: "a" | "button";
|
|
74
108
|
/**
|
|
75
|
-
*
|
|
109
|
+
* What the base style of button is
|
|
110
|
+
* @default 'accent'
|
|
111
|
+
* @deprecated use styleVariant instead
|
|
76
112
|
*/
|
|
77
|
-
|
|
113
|
+
styleType?: "accent" | "critical" | "neutral" | "white";
|
|
78
114
|
/**
|
|
79
|
-
*
|
|
115
|
+
* What the base style of button is
|
|
116
|
+
* @default 'accent'
|
|
80
117
|
*/
|
|
81
|
-
|
|
118
|
+
styleVariant?: "accent" | "critical" | "neutral" | "white";
|
|
82
119
|
/**
|
|
83
|
-
*
|
|
120
|
+
* What the purpose is for the button
|
|
121
|
+
* @default 'primary'
|
|
84
122
|
*/
|
|
85
|
-
|
|
123
|
+
emphasis?: "primary" | "secondary" | "tertiary" | "quaternary";
|
|
86
124
|
/**
|
|
87
|
-
*
|
|
125
|
+
* How large should the button be?
|
|
126
|
+
* @default 'md'
|
|
127
|
+
*/
|
|
128
|
+
size?: ButtonSize;
|
|
129
|
+
/**
|
|
130
|
+
* Whether an icon should display at the end of Button and icon properties
|
|
131
|
+
* @default
|
|
88
132
|
*/
|
|
89
|
-
|
|
133
|
+
iconEndProps?: IconProps;
|
|
134
|
+
/**
|
|
135
|
+
* Whether an icon should display at the start of the Button and icon properties
|
|
136
|
+
*/
|
|
137
|
+
iconStartProps?: IconProps;
|
|
138
|
+
/**
|
|
139
|
+
* Whether the button leading has an icon
|
|
140
|
+
* @deprecated use iconStartProps instead
|
|
141
|
+
*/
|
|
142
|
+
hasLeadingIcon?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Leading icon name
|
|
145
|
+
* @deprecated use iconStartProps instead
|
|
146
|
+
*/
|
|
147
|
+
leadingIconName?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Whether the button trailing has an icon
|
|
150
|
+
* @deprecated use iconEndProps instead
|
|
151
|
+
*/
|
|
152
|
+
hasTrailingIcon?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Trailing icon name
|
|
155
|
+
* @deprecated use iconEndProps instead
|
|
156
|
+
*/
|
|
157
|
+
trailingIconName?: string;
|
|
158
|
+
/**
|
|
159
|
+
* isLoading is a boolean that will show a spinner in the button
|
|
160
|
+
*/
|
|
161
|
+
isLoading?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* The text alignment of the button
|
|
164
|
+
*/
|
|
165
|
+
textAlign?: ButtonTextAlignement;
|
|
166
|
+
/**
|
|
167
|
+
* The content for the button.
|
|
168
|
+
*/
|
|
169
|
+
children?: ReactNode;
|
|
90
170
|
/**
|
|
91
171
|
* Whether the element should receive focus on render.
|
|
92
172
|
*/
|
|
93
|
-
|
|
173
|
+
type?: "button" | "submit" | "reset";
|
|
94
174
|
/**
|
|
95
|
-
*
|
|
175
|
+
* Whether the button should be full width.
|
|
96
176
|
*/
|
|
97
|
-
|
|
177
|
+
fullWidth?: boolean;
|
|
98
178
|
/**
|
|
99
|
-
*
|
|
179
|
+
* @deprecated onPress should be preferred
|
|
180
|
+
* Handler to be called when the button is clicked.
|
|
100
181
|
*/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
182
|
+
onClick?: React.MouseEventHandler;
|
|
183
|
+
/**
|
|
184
|
+
* The target of the link (if `as` is set to 'a').
|
|
185
|
+
*/
|
|
186
|
+
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
187
|
+
/**
|
|
188
|
+
* What type of focus style to apply to the button.
|
|
189
|
+
*/
|
|
190
|
+
focusStyle?: "default" | "white";
|
|
191
|
+
/**
|
|
192
|
+
* Passthrough props for the button element.
|
|
193
|
+
*/
|
|
194
|
+
passthroughProps?: Partial<any> | undefined;
|
|
195
|
+
} & React.RefAttributes<any>>;
|
|
104
196
|
export default Button;
|
|
@@ -1,37 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { forwardRef } from "react";
|
|
4
|
+
import { useButton } from "@react-aria/button";
|
|
5
|
+
import { useObjectRef, mergeProps } from "@react-aria/utils";
|
|
6
|
+
import { useHover } from "@react-aria/interactions";
|
|
7
|
+
import { useFocusRing } from "@react-aria/focus";
|
|
5
8
|
import { Icon } from "../Icon/Icon.js";
|
|
6
9
|
import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
|
|
7
10
|
import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
|
|
8
|
-
import '../../assets/Button.css';const button$1 = "
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
11
|
+
import '../../assets/Button.css';const button$1 = "_button_1pjm3_1";
|
|
12
|
+
const content = "_content_1pjm3_22";
|
|
13
|
+
const isNotLoading = "_isNotLoading_1pjm3_31";
|
|
14
|
+
const loadingSpinner = "_loadingSpinner_1pjm3_31";
|
|
15
|
+
const isLoading = "_isLoading_1pjm3_40";
|
|
16
|
+
const focusWhite = "_focusWhite_1pjm3_52";
|
|
17
|
+
const sm = "_sm_1pjm3_59";
|
|
18
|
+
const md = "_md_1pjm3_64";
|
|
19
|
+
const lg = "_lg_1pjm3_69";
|
|
20
|
+
const fullWidth = "_fullWidth_1pjm3_74";
|
|
21
|
+
const textAlignLeft = "_textAlignLeft_1pjm3_81";
|
|
22
|
+
const textAlignCenter = "_textAlignCenter_1pjm3_85";
|
|
23
|
+
const textAlignRight = "_textAlignRight_1pjm3_89";
|
|
24
|
+
const accentPrimary = "_accentPrimary_1pjm3_97";
|
|
25
|
+
const accentSecondary = "_accentSecondary_1pjm3_117";
|
|
26
|
+
const accentTertiary = "_accentTertiary_1pjm3_147";
|
|
27
|
+
const accentQuaternary = "_accentQuaternary_1pjm3_173";
|
|
28
|
+
const criticalPrimary = "_criticalPrimary_1pjm3_199";
|
|
29
|
+
const criticalSecondary = "_criticalSecondary_1pjm3_224";
|
|
30
|
+
const criticalTertiary = "_criticalTertiary_1pjm3_254";
|
|
31
|
+
const criticalQuaternary = "_criticalQuaternary_1pjm3_280";
|
|
32
|
+
const neutralPrimary = "_neutralPrimary_1pjm3_307";
|
|
33
|
+
const neutralSecondary = "_neutralSecondary_1pjm3_332";
|
|
34
|
+
const neutralTertiary = "_neutralTertiary_1pjm3_361";
|
|
35
|
+
const neutralQuaternary = "_neutralQuaternary_1pjm3_387";
|
|
36
|
+
const whitePrimary = "_whitePrimary_1pjm3_414";
|
|
37
|
+
const whiteSecondary = "_whiteSecondary_1pjm3_440";
|
|
38
|
+
const whiteTertiary = "_whiteTertiary_1pjm3_473";
|
|
39
|
+
const whiteQuaternary = "_whiteQuaternary_1pjm3_503";
|
|
28
40
|
const styles = {
|
|
29
41
|
button: button$1,
|
|
42
|
+
content,
|
|
43
|
+
isNotLoading,
|
|
44
|
+
loadingSpinner,
|
|
45
|
+
isLoading,
|
|
46
|
+
focusWhite,
|
|
30
47
|
sm,
|
|
31
48
|
md,
|
|
32
49
|
lg,
|
|
50
|
+
fullWidth,
|
|
51
|
+
textAlignLeft,
|
|
52
|
+
textAlignCenter,
|
|
53
|
+
textAlignRight,
|
|
33
54
|
accentPrimary,
|
|
34
|
-
"local-class": "_local-class_fkkc6_61",
|
|
35
55
|
accentSecondary,
|
|
36
56
|
accentTertiary,
|
|
37
57
|
accentQuaternary,
|
|
@@ -47,8 +67,8 @@ const styles = {
|
|
|
47
67
|
whiteSecondary,
|
|
48
68
|
whiteTertiary,
|
|
49
69
|
whiteQuaternary,
|
|
50
|
-
"fa-spinner-third": "_fa-spinner-
|
|
51
|
-
"icon-wrapper": "_icon-
|
|
70
|
+
"fa-spinner-third": "_fa-spinner-third_1pjm3_535",
|
|
71
|
+
"icon-wrapper": "_icon-wrapper_1pjm3_540"
|
|
52
72
|
};
|
|
53
73
|
const button = cva(styles.button, {
|
|
54
74
|
variants: {
|
|
@@ -80,62 +100,105 @@ const button = cva(styles.button, {
|
|
|
80
100
|
secondary: styles.whiteSecondary,
|
|
81
101
|
tertiary: styles.whiteTertiary,
|
|
82
102
|
quaternary: styles.whiteQuaternary
|
|
103
|
+
},
|
|
104
|
+
fullWidth: {
|
|
105
|
+
true: styles.fullWidth
|
|
106
|
+
},
|
|
107
|
+
focusStyle: {
|
|
108
|
+
default: void 0,
|
|
109
|
+
white: styles.focusWhite
|
|
110
|
+
},
|
|
111
|
+
isLoading: {
|
|
112
|
+
false: styles.isNotLoading,
|
|
113
|
+
true: styles.isLoading
|
|
114
|
+
},
|
|
115
|
+
textAlign: {
|
|
116
|
+
left: styles.textAlignLeft,
|
|
117
|
+
center: styles.textAlignCenter,
|
|
118
|
+
right: styles.textAlignRight
|
|
83
119
|
}
|
|
84
120
|
},
|
|
121
|
+
compoundVariants: [{
|
|
122
|
+
size: "md",
|
|
123
|
+
accent: "primary",
|
|
124
|
+
className: styles.accentPrimary
|
|
125
|
+
}],
|
|
85
126
|
defaultVariants: {
|
|
86
127
|
size: "md"
|
|
87
128
|
}
|
|
88
129
|
});
|
|
89
|
-
const Button = ({
|
|
90
|
-
|
|
91
|
-
|
|
130
|
+
const Button = forwardRef(function Button2({
|
|
131
|
+
as,
|
|
132
|
+
elementType,
|
|
133
|
+
styleType,
|
|
134
|
+
styleVariant,
|
|
92
135
|
emphasis = "primary",
|
|
93
136
|
size = "md",
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
children,
|
|
97
|
-
// react-aria props
|
|
98
|
-
form,
|
|
99
|
-
formAction,
|
|
100
|
-
formEncType,
|
|
101
|
-
formMethod,
|
|
102
|
-
formNoValidate,
|
|
103
|
-
formTarget,
|
|
104
|
-
name,
|
|
105
|
-
value,
|
|
106
|
-
isDisabled,
|
|
107
|
-
autoFocus,
|
|
108
|
-
type,
|
|
109
|
-
onClick,
|
|
110
|
-
hasLeadingIcon,
|
|
137
|
+
iconStartProps,
|
|
138
|
+
iconEndProps,
|
|
111
139
|
leadingIconName,
|
|
112
|
-
hasTrailingIcon,
|
|
113
140
|
trailingIconName,
|
|
141
|
+
children,
|
|
142
|
+
fullWidth: fullWidth2,
|
|
143
|
+
textAlign = "center",
|
|
144
|
+
focusStyle = "default",
|
|
145
|
+
passthroughProps,
|
|
146
|
+
isLoading: isLoading2 = false,
|
|
114
147
|
...props
|
|
115
|
-
})
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
148
|
+
}, forwardedRef) {
|
|
149
|
+
const ref = useObjectRef(forwardedRef);
|
|
150
|
+
const {
|
|
151
|
+
buttonProps,
|
|
152
|
+
isPressed
|
|
153
|
+
} = useButton({
|
|
154
|
+
...props,
|
|
155
|
+
elementType: elementType ?? as
|
|
156
|
+
}, ref);
|
|
157
|
+
const {
|
|
158
|
+
hoverProps,
|
|
159
|
+
isHovered
|
|
160
|
+
} = useHover(props);
|
|
161
|
+
const {
|
|
162
|
+
isFocusVisible,
|
|
163
|
+
focusProps
|
|
164
|
+
} = useFocusRing(props);
|
|
165
|
+
const getAriaLabel = () => {
|
|
166
|
+
if (isLoading2) {
|
|
167
|
+
return "Loading Spinner";
|
|
168
|
+
}
|
|
169
|
+
const label = buttonProps["aria-label"] || (typeof children === "string" ? children : void 0);
|
|
170
|
+
if (props.isDisabled && label) {
|
|
171
|
+
return `${label}, unavailable`;
|
|
121
172
|
}
|
|
122
|
-
|
|
123
|
-
|
|
173
|
+
return label;
|
|
174
|
+
};
|
|
175
|
+
const resolvedStyleVariant = styleVariant ?? styleType ?? "accent";
|
|
176
|
+
const className = button({
|
|
124
177
|
size,
|
|
125
|
-
|
|
126
|
-
|
|
178
|
+
fullWidth: fullWidth2,
|
|
179
|
+
focusStyle,
|
|
180
|
+
isLoading: isLoading2,
|
|
181
|
+
textAlign,
|
|
182
|
+
[resolvedStyleVariant]: emphasis
|
|
183
|
+
});
|
|
184
|
+
const Component = elementType ?? as ?? "button";
|
|
185
|
+
const resolvedIconStartProps = leadingIconName ? {
|
|
186
|
+
iconName: leadingIconName
|
|
187
|
+
} : iconStartProps;
|
|
188
|
+
const resolvedIconEndProps = trailingIconName ? {
|
|
189
|
+
iconName: trailingIconName
|
|
190
|
+
} : iconEndProps;
|
|
191
|
+
return /* @__PURE__ */ jsx(Component, { className: `${className} ${focusStyleVariants({
|
|
127
192
|
focusStyle
|
|
128
|
-
})}`, ref:
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
!isLoading && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
133
|
-
hasLeadingIcon && leadingIconName ? /* @__PURE__ */ jsx(Icon, { iconName: leadingIconName || "" }) : null,
|
|
193
|
+
})}`, ref, "data-focused": isFocusVisible ? true : void 0, "data-hovered": isHovered ? true : void 0, "data-pressed": isPressed ? true : void 0, "aria-label": getAriaLabel(), "aria-disabled": props.isDisabled ? true : void 0, ...mergeProps(buttonProps, hoverProps, focusProps), ...passthroughProps, children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
194
|
+
isLoading2 && /* @__PURE__ */ jsx(LoadingSpinner, { className: styles.loadingSpinner, size: size === "lg" ? "lg" : "1x", "aria-hidden": "true" }),
|
|
195
|
+
/* @__PURE__ */ jsxs("span", { className: styles.content, children: [
|
|
196
|
+
resolvedIconStartProps && /* @__PURE__ */ jsx(Icon, { ...resolvedIconStartProps, "aria-hidden": "true" }),
|
|
134
197
|
children,
|
|
135
|
-
|
|
198
|
+
resolvedIconEndProps && /* @__PURE__ */ jsx(Icon, { ...resolvedIconEndProps, "aria-hidden": "true" })
|
|
136
199
|
] })
|
|
137
|
-
] });
|
|
138
|
-
};
|
|
200
|
+
] }) });
|
|
201
|
+
});
|
|
139
202
|
export {
|
|
140
203
|
Button,
|
|
141
204
|
Button as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Button.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -14,10 +14,16 @@ interface CardSectionComponent extends React.ForwardRefExoticComponent<CardSecti
|
|
|
14
14
|
Media: typeof Media;
|
|
15
15
|
}
|
|
16
16
|
declare const CardSection: CardSectionComponent;
|
|
17
|
-
declare const Content:
|
|
18
|
-
children:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
17
|
+
declare const Content: {
|
|
18
|
+
({ children }: {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
declare const Media: {
|
|
24
|
+
({ children }: {
|
|
25
|
+
children: React.ReactNode;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
23
29
|
export default CardSection;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { c as cva } from "../../index-Bi3v_EjJ.js";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import '../../assets/CardSection.css';const cardSection$1 = "
|
|
5
|
-
const cardContainer = "
|
|
6
|
-
const cardGrid = "
|
|
7
|
-
const contentCell = "
|
|
8
|
-
const contentBox = "
|
|
9
|
-
const mediaCell = "
|
|
10
|
-
const isReversed = "
|
|
4
|
+
import '../../assets/CardSection.css';const cardSection$1 = "_cardSection_1uwwa_1";
|
|
5
|
+
const cardContainer = "_cardContainer_1uwwa_12";
|
|
6
|
+
const cardGrid = "_cardGrid_1uwwa_24";
|
|
7
|
+
const contentCell = "_contentCell_1uwwa_33";
|
|
8
|
+
const contentBox = "_contentBox_1uwwa_40";
|
|
9
|
+
const mediaCell = "_mediaCell_1uwwa_51";
|
|
10
|
+
const isReversed = "_isReversed_1uwwa_65";
|
|
11
11
|
const styles = {
|
|
12
12
|
cardSection: cardSection$1,
|
|
13
13
|
cardContainer,
|
|
@@ -35,9 +35,11 @@ CardSection.displayName = "CardSection";
|
|
|
35
35
|
const Content = ({
|
|
36
36
|
children
|
|
37
37
|
}) => /* @__PURE__ */ jsx("div", { className: styles.contentCell, children: /* @__PURE__ */ jsx("article", { className: styles.contentBox, children }) });
|
|
38
|
+
Content.displayName = "CardSection.Content";
|
|
38
39
|
const Media = ({
|
|
39
40
|
children
|
|
40
41
|
}) => /* @__PURE__ */ jsx("figure", { className: styles.mediaCell, children });
|
|
42
|
+
Media.displayName = "CardSection.Media";
|
|
41
43
|
CardSection.Content = Content;
|
|
42
44
|
CardSection.Media = Media;
|
|
43
45
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardSection.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CardSection.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { ValidationError } from '@react-types/shared';
|
|
2
3
|
import { CheckboxProps as AriaCheckboxProps } from 'react-aria-components';
|
|
3
4
|
export interface CheckboxProps extends AriaCheckboxProps {
|
|
4
|
-
label
|
|
5
|
+
/** The label of the checkbox, can be a string or a React node. */
|
|
6
|
+
label?: string | React.ReactNode;
|
|
5
7
|
/** Indeterminism is presentational only. The indeterminate visual representation remains regardless of user interaction. */
|
|
6
8
|
isIndeterminate?: boolean;
|
|
7
9
|
/** Whether the element should be selected (uncontrolled). */
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { ButtonProps } from '../Button/Button';
|
|
2
|
-
import {
|
|
2
|
+
import { FormProps } from '../../utils/forms/formProps';
|
|
3
3
|
export type ClearFieldButtonButtonSize = 'lg' | 'md' | 'sm';
|
|
4
|
-
export interface ClearFieldButtonProps extends Omit<ButtonProps, '$styleText'
|
|
4
|
+
export interface ClearFieldButtonProps extends Omit<ButtonProps, '$styleText'>, FormProps {
|
|
5
5
|
slot?: string;
|
|
6
|
-
iconSize?: IconSize;
|
|
7
6
|
className?: string;
|
|
8
|
-
/**
|
|
9
|
-
* The focus style of the button
|
|
10
|
-
*/
|
|
11
7
|
focusStyle?: 'default' | 'white';
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
type?: 'button' | 'submit' | 'reset';
|
|
12
10
|
}
|
|
13
11
|
export declare const ClearFieldButton: ({ size, form, formAction, formEncType, formMethod, formNoValidate, formTarget, name, value, isDisabled, autoFocus, type, slot, onClick, className, focusStyle, ...props }: ClearFieldButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
12
|
export default ClearFieldButton;
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
import { DateFieldProps as AriaDateFieldProps, DateValue
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/
|
|
6
|
-
label?: string;
|
|
7
|
-
/**
|
|
8
|
-
* The description for the TextField
|
|
9
|
-
*/
|
|
10
|
-
description?: string;
|
|
11
|
-
/**
|
|
12
|
-
* The error message for the TextField
|
|
13
|
-
*/
|
|
14
|
-
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
15
|
-
/**
|
|
16
|
-
* Whether the TextField is disabled
|
|
17
|
-
*/
|
|
18
|
-
isDisabled?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the TextField is invalid
|
|
21
|
-
*/
|
|
22
|
-
isInvalid?: boolean;
|
|
23
|
-
}
|
|
24
|
-
export declare const DateField: ({ label, description, errorMessage, isRequired, isInvalid, isDisabled, value, ...props }: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { DateFieldProps as AriaDateFieldProps, DateValue } from 'react-aria-components';
|
|
2
|
+
import { FieldProps } from '../_base/Field/Field';
|
|
3
|
+
export type DateFieldProps = FieldProps<AriaDateFieldProps<DateValue>>;
|
|
4
|
+
export declare const DateField: (props: DateFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
5
|
export default DateField;
|
|
@@ -1,28 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { DateField as DateField$1, DateInput, DateSegment } from "react-aria-components";
|
|
3
|
-
import {
|
|
4
|
-
import '../../assets/DateField.css';const dateField = "
|
|
5
|
-
const dateInput = "
|
|
6
|
-
const dateSegment = "
|
|
3
|
+
import { Field } from "../_base/Field/Field.js";
|
|
4
|
+
import '../../assets/DateField.css';const dateField = "_dateField_1bpet_1";
|
|
5
|
+
const dateInput = "_dateInput_1bpet_5";
|
|
6
|
+
const dateSegment = "_dateSegment_1bpet_50";
|
|
7
7
|
const styles = {
|
|
8
8
|
dateField,
|
|
9
9
|
dateInput,
|
|
10
10
|
dateSegment
|
|
11
11
|
};
|
|
12
|
-
const DateField = ({
|
|
13
|
-
|
|
14
|
-
description,
|
|
15
|
-
errorMessage,
|
|
16
|
-
isRequired = false,
|
|
17
|
-
isInvalid = false,
|
|
18
|
-
isDisabled = false,
|
|
19
|
-
value,
|
|
20
|
-
...props
|
|
21
|
-
}) => {
|
|
22
|
-
return /* @__PURE__ */ jsxs(DateField$1, { className: styles.dateField, isInvalid, isDisabled, value, ...props, children: [
|
|
23
|
-
/* @__PURE__ */ jsx(FieldHeader, { label, description, errorMessage, isRequired, isInvalid }),
|
|
24
|
-
/* @__PURE__ */ jsx(DateInput, { className: styles.dateInput, children: (segment) => /* @__PURE__ */ jsx(DateSegment, { className: styles.dateSegment, segment }) })
|
|
25
|
-
] });
|
|
12
|
+
const DateField = (props) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(Field, { as: DateField$1, className: styles.dateField, ...props, children: /* @__PURE__ */ jsx(DateInput, { className: styles.dateInput, children: (segment) => /* @__PURE__ */ jsx(DateSegment, { className: styles.dateSegment, segment }) }) });
|
|
26
14
|
};
|
|
27
15
|
export {
|
|
28
16
|
DateField,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateField.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DateField.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -2,5 +2,5 @@ import { FieldErrorProps as AriaFieldErrorProps } from 'react-aria-components';
|
|
|
2
2
|
export interface FieldErrorProps extends AriaFieldErrorProps {
|
|
3
3
|
children?: React.ReactNode | any;
|
|
4
4
|
}
|
|
5
|
-
export declare const FieldError: ({ children, ...props }: FieldErrorProps) => import("react/jsx-runtime").JSX.Element
|
|
5
|
+
export declare const FieldError: ({ children, ...props }: FieldErrorProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default FieldError;
|