@alto-avios/alto-ui 4.0.0 → 4.2.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.
Files changed (90) hide show
  1. package/dist/TabPanel-DNAQ5FkE.js +49 -0
  2. package/dist/TabPanel-DNAQ5FkE.js.map +1 -0
  3. package/dist/assets/AviosCurrency.css +1 -1
  4. package/dist/assets/AviosCurrencyBadge.css +1 -1
  5. package/dist/assets/CalloutBanner.css +1 -1
  6. package/dist/assets/CarouselButton.css +1 -1
  7. package/dist/assets/Currency.css +1 -0
  8. package/dist/assets/ErrorSummary.css +1 -1
  9. package/dist/assets/PasswordField.css +1 -1
  10. package/dist/assets/SelectCard.css +1 -1
  11. package/dist/assets/SelectNative.css +1 -1
  12. package/dist/assets/TabPanel.css +1 -0
  13. package/dist/assets/ToggleButton.css +1 -1
  14. package/dist/assets/ToggleIconButton.css +1 -1
  15. package/dist/components/Accordion/Accordion.d.ts +1 -1
  16. package/dist/components/Accordion/Accordion.js +10 -5
  17. package/dist/components/Accordion/Accordion.js.map +1 -1
  18. package/dist/components/AviosCurrency/AviosCurrency.js +25 -69
  19. package/dist/components/AviosCurrency/AviosCurrency.js.map +1 -1
  20. package/dist/components/AviosCurrencyBadge/AviosCurrencyBadge.js +13 -13
  21. package/dist/components/Box/Box.d.ts +6 -1
  22. package/dist/components/Box/Box.js +1 -0
  23. package/dist/components/Box/Box.js.map +1 -1
  24. package/dist/components/CalloutBanner/CalloutBanner.d.ts +27 -3
  25. package/dist/components/CalloutBanner/CalloutBanner.js +72 -40
  26. package/dist/components/CalloutBanner/CalloutBanner.js.map +1 -1
  27. package/dist/components/Carousel/CarouselButton/CarouselButton.d.ts +12 -1
  28. package/dist/components/Carousel/CarouselButton/CarouselButton.js +112 -39
  29. package/dist/components/Carousel/CarouselButton/CarouselButton.js.map +1 -1
  30. package/dist/components/Currency/Currency.d.ts +51 -0
  31. package/dist/components/Currency/Currency.js +110 -0
  32. package/dist/components/Currency/Currency.js.map +1 -0
  33. package/dist/components/Currency/index.d.ts +2 -0
  34. package/dist/components/Currency/index.js +5 -0
  35. package/dist/components/Currency/index.js.map +1 -0
  36. package/dist/components/DetailsDisclosure/DetailsDisclosure.d.ts +11 -1
  37. package/dist/components/DetailsDisclosure/DetailsDisclosure.js +11 -4
  38. package/dist/components/DetailsDisclosure/DetailsDisclosure.js.map +1 -1
  39. package/dist/components/DetailsDisclosure/index.js +2 -2
  40. package/dist/components/ErrorSummary/ErrorSummary.d.ts +5 -2
  41. package/dist/components/ErrorSummary/ErrorSummary.js +9 -11
  42. package/dist/components/ErrorSummary/ErrorSummary.js.map +1 -1
  43. package/dist/components/FieldError/FieldError.js +2 -2
  44. package/dist/components/FieldHeader/FieldHeader.d.ts +3 -1
  45. package/dist/components/FieldHeader/FieldHeader.js +4 -2
  46. package/dist/components/FieldHeader/FieldHeader.js.map +1 -1
  47. package/dist/components/PasswordField/PasswordField.d.ts +14 -0
  48. package/dist/components/PasswordField/PasswordField.js +54 -39
  49. package/dist/components/PasswordField/PasswordField.js.map +1 -1
  50. package/dist/components/PhoneNumberField/PhoneNumberField.d.ts +1 -1
  51. package/dist/components/PhoneNumberField/PhoneNumberField.js +5 -4
  52. package/dist/components/PhoneNumberField/PhoneNumberField.js.map +1 -1
  53. package/dist/components/SelectCard/SelectCard.d.ts +16 -2
  54. package/dist/components/SelectCard/SelectCard.js +22 -17
  55. package/dist/components/SelectCard/SelectCard.js.map +1 -1
  56. package/dist/components/SelectNative/SelectNative.js +8 -3
  57. package/dist/components/SelectNative/SelectNative.js.map +1 -1
  58. package/dist/components/Slider/Slider.d.ts +75 -0
  59. package/dist/components/Spacer/Spacer.js +1 -1
  60. package/dist/components/Tabs/Tab.d.ts +19 -0
  61. package/dist/components/Tabs/Tab.js +12 -0
  62. package/dist/components/Tabs/Tab.js.map +1 -0
  63. package/dist/components/Tabs/TabList.d.ts +16 -0
  64. package/dist/components/Tabs/TabList.js +12 -0
  65. package/dist/components/Tabs/TabList.js.map +1 -0
  66. package/dist/components/Tabs/TabPanel.d.ts +14 -0
  67. package/dist/components/Tabs/TabPanel.js +8 -0
  68. package/dist/components/Tabs/TabPanel.js.map +1 -0
  69. package/dist/components/Tabs/Tabs.d.ts +48 -0
  70. package/dist/components/Tabs/Tabs.js +302 -0
  71. package/dist/components/Tabs/Tabs.js.map +1 -0
  72. package/dist/components/Tabs/index.d.ts +9 -0
  73. package/dist/components/Tabs/index.js +10 -0
  74. package/dist/components/Tabs/index.js.map +1 -0
  75. package/dist/components/ToggleButton/ToggleButton.d.ts +1 -0
  76. package/dist/components/ToggleButton/ToggleButton.js +8 -5
  77. package/dist/components/ToggleButton/ToggleButton.js.map +1 -1
  78. package/dist/components/ToggleIconButton/ToggleIconButton.js +8 -5
  79. package/dist/components/ToggleIconButton/ToggleIconButton.js.map +1 -1
  80. package/dist/components/_base/Field/Field.d.ts +9 -0
  81. package/dist/components/_base/Field/Field.js +1 -1
  82. package/dist/components/index.d.ts +4 -0
  83. package/dist/components/index.js +28 -19
  84. package/dist/components/index.js.map +1 -1
  85. package/dist/index.js +28 -19
  86. package/dist/index.js.map +1 -1
  87. package/dist/utils/phoneNumber/phoneNumber.d.ts +1 -0
  88. package/dist/utils/phoneNumber/phoneNumber.js +8 -1
  89. package/dist/utils/phoneNumber/phoneNumber.js.map +1 -1
  90. package/package.json +3 -3
@@ -0,0 +1,302 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import React__default, { useRef, useState, useCallback, useEffect, createContext, useContext } from "react";
3
+ import { TabList as TabList$1, Tab as Tab$1, Tabs as Tabs$1 } from "react-aria-components";
4
+ import { c as cva } from "../../index-DdUYounA.js";
5
+ import { s as styles, T as TabPanel } from "../../TabPanel-DNAQ5FkE.js";
6
+ import { CarouselButton } from "../Carousel/CarouselButton/CarouselButton.js";
7
+ import { Heading } from "../Heading/Heading.js";
8
+ import { Icon } from "../Icon/Icon.js";
9
+ import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
10
+ const tabList = cva(styles.tabList, {
11
+ variants: {
12
+ fillContainer: {
13
+ true: styles.fillContainer,
14
+ false: void 0
15
+ },
16
+ hasScrollButtons: {
17
+ true: styles.hasScrollButtons,
18
+ false: void 0
19
+ }
20
+ },
21
+ defaultVariants: {
22
+ fillContainer: false,
23
+ hasScrollButtons: false
24
+ }
25
+ });
26
+ const TabList = ({
27
+ children,
28
+ className
29
+ }) => {
30
+ const context = useTabsContext();
31
+ const {
32
+ styleVariant,
33
+ align,
34
+ fillContainer,
35
+ focusStyle
36
+ } = context;
37
+ const tabListRef = useRef(null);
38
+ const containerRef = useRef(null);
39
+ const prevButtonRef = useRef(null);
40
+ const nextButtonRef = useRef(null);
41
+ const [showScrollButtons, setShowScrollButtons] = useState(false);
42
+ const [canScrollLeft, setCanScrollLeft] = useState(false);
43
+ const [canScrollRight, setCanScrollRight] = useState(false);
44
+ const childrenArray = React__default.Children.toArray(children);
45
+ const itemsLength = childrenArray.length;
46
+ const hasOverflow = useCallback(() => {
47
+ if (!tabListRef.current || !containerRef.current || fillContainer) {
48
+ return false;
49
+ }
50
+ const tabList2 = tabListRef.current;
51
+ const container = containerRef.current;
52
+ const containerStyles = getComputedStyle(container);
53
+ const containerPadding = styleVariant === "contained" ? parseInt(containerStyles.paddingLeft) + parseInt(containerStyles.paddingRight) : 0;
54
+ const availableWidth = container.clientWidth - containerPadding;
55
+ const requiredWidth = tabList2.scrollWidth;
56
+ const threshold = 2;
57
+ return requiredWidth > availableWidth + threshold;
58
+ }, [fillContainer, styleVariant]);
59
+ const isTabFullyVisible = useCallback((tabIndex) => {
60
+ if (!tabListRef.current || !containerRef.current) return true;
61
+ const tabList2 = tabListRef.current;
62
+ const container = containerRef.current;
63
+ const tabElements = Array.from(tabList2.children);
64
+ if (!tabElements[tabIndex]) return true;
65
+ const tabElement = tabElements[tabIndex];
66
+ const containerRect = container.getBoundingClientRect();
67
+ const tabListRect = tabList2.getBoundingClientRect();
68
+ const tabRect = tabElement.getBoundingClientRect();
69
+ const visibleLeft = Math.max(containerRect.left, tabListRect.left);
70
+ const visibleRight = Math.min(containerRect.right, tabListRect.right);
71
+ const tolerance = 1;
72
+ const isFullyVisible = tabRect.left >= visibleLeft - tolerance && tabRect.right <= visibleRight + tolerance;
73
+ return isFullyVisible;
74
+ }, []);
75
+ const getScrollBoundaries = useCallback(() => {
76
+ if (!hasOverflow() || itemsLength === 0) {
77
+ return {
78
+ canScrollLeft: false,
79
+ canScrollRight: false
80
+ };
81
+ }
82
+ const firstTabVisible = isTabFullyVisible(0);
83
+ const lastTabVisible = isTabFullyVisible(itemsLength - 1);
84
+ return {
85
+ // Show left arrow if first tab is not visible
86
+ canScrollLeft: !firstTabVisible,
87
+ // Show right arrow if last tab is not visible
88
+ canScrollRight: !lastTabVisible
89
+ };
90
+ }, [hasOverflow, isTabFullyVisible, itemsLength]);
91
+ const updateButtonStates = useCallback(() => {
92
+ const overflow = hasOverflow();
93
+ if (!overflow || fillContainer) {
94
+ setShowScrollButtons(false);
95
+ setCanScrollLeft(false);
96
+ setCanScrollRight(false);
97
+ return;
98
+ }
99
+ const {
100
+ canScrollLeft: newCanScrollLeft,
101
+ canScrollRight: newCanScrollRight
102
+ } = getScrollBoundaries();
103
+ const shouldShowButtons = newCanScrollLeft || newCanScrollRight;
104
+ setShowScrollButtons(shouldShowButtons);
105
+ setCanScrollLeft(newCanScrollLeft);
106
+ setCanScrollRight(newCanScrollRight);
107
+ }, [hasOverflow, getScrollBoundaries, fillContainer]);
108
+ const throttledUpdateButtonStates = useCallback(() => {
109
+ requestAnimationFrame(() => {
110
+ updateButtonStates();
111
+ });
112
+ }, [updateButtonStates]);
113
+ const handleScroll = useCallback(() => {
114
+ throttledUpdateButtonStates();
115
+ }, [throttledUpdateButtonStates]);
116
+ const scrollToLeft = useCallback(() => {
117
+ if (!tabListRef.current || !canScrollLeft) return;
118
+ const tabList2 = tabListRef.current;
119
+ if (!isTabFullyVisible(0)) {
120
+ tabList2.scrollTo({
121
+ left: 0,
122
+ behavior: "smooth"
123
+ });
124
+ } else {
125
+ const scrollAmount = tabList2.clientWidth * 0.6;
126
+ tabList2.scrollBy({
127
+ left: -scrollAmount,
128
+ behavior: "smooth"
129
+ });
130
+ }
131
+ }, [canScrollLeft, isTabFullyVisible]);
132
+ const scrollToRight = useCallback(() => {
133
+ if (!tabListRef.current || !canScrollRight) return;
134
+ const tabList2 = tabListRef.current;
135
+ if (!isTabFullyVisible(itemsLength - 1)) {
136
+ const maxScrollLeft = tabList2.scrollWidth - tabList2.clientWidth;
137
+ tabList2.scrollTo({
138
+ left: maxScrollLeft,
139
+ behavior: "smooth"
140
+ });
141
+ } else {
142
+ const scrollAmount = tabList2.clientWidth * 0.6;
143
+ tabList2.scrollBy({
144
+ left: scrollAmount,
145
+ behavior: "smooth"
146
+ });
147
+ }
148
+ }, [canScrollRight, isTabFullyVisible, itemsLength]);
149
+ const getArrowVariant = () => {
150
+ return styleVariant === "contained" ? "shapeElevated" : "gradient";
151
+ };
152
+ useEffect(() => {
153
+ const tabList2 = tabListRef.current;
154
+ const container = containerRef.current;
155
+ if (!tabList2 || !container) return;
156
+ const initialTimer = setTimeout(() => {
157
+ updateButtonStates();
158
+ }, 100);
159
+ const resizeObserver = new ResizeObserver(() => {
160
+ throttledUpdateButtonStates();
161
+ });
162
+ resizeObserver.observe(container);
163
+ resizeObserver.observe(tabList2);
164
+ tabList2.addEventListener("scroll", handleScroll, {
165
+ passive: true
166
+ });
167
+ const mutationObserver = new MutationObserver(() => {
168
+ throttledUpdateButtonStates();
169
+ });
170
+ mutationObserver.observe(tabList2, {
171
+ childList: true,
172
+ subtree: true,
173
+ characterData: true
174
+ });
175
+ const handleWindowResize = () => {
176
+ throttledUpdateButtonStates();
177
+ };
178
+ window.addEventListener("resize", handleWindowResize, {
179
+ passive: true
180
+ });
181
+ return () => {
182
+ clearTimeout(initialTimer);
183
+ resizeObserver.disconnect();
184
+ mutationObserver.disconnect();
185
+ tabList2.removeEventListener("scroll", handleScroll);
186
+ window.removeEventListener("resize", handleWindowResize);
187
+ };
188
+ }, [updateButtonStates, throttledUpdateButtonStates, handleScroll]);
189
+ useEffect(() => {
190
+ const timer = setTimeout(() => {
191
+ updateButtonStates();
192
+ }, 50);
193
+ return () => clearTimeout(timer);
194
+ }, [children, updateButtonStates]);
195
+ const combinedClassName = className ? `${tabList({
196
+ fillContainer,
197
+ hasScrollButtons: showScrollButtons
198
+ })} ${className}` : tabList({
199
+ fillContainer,
200
+ hasScrollButtons: showScrollButtons
201
+ });
202
+ return /* @__PURE__ */ jsxs("div", { className: styles.tabListContainer, ref: containerRef, "data-has-scroll-buttons": showScrollButtons ? "true" : void 0, "data-style-variant": styleVariant, children: [
203
+ showScrollButtons && canScrollLeft && /* @__PURE__ */ jsx(CarouselButton, { ref: prevButtonRef, dir: "prev", variant: getArrowVariant(), size: "md", focusStyle, hideDisabledArrow: false, className: styles.scrollButtonPrev, onClick: scrollToLeft, standalone: true }),
204
+ /* @__PURE__ */ jsx(TabList$1, { ref: tabListRef, className: combinedClassName, "data-style-variant": styleVariant, "data-align": align, children }),
205
+ showScrollButtons && canScrollRight && /* @__PURE__ */ jsx(CarouselButton, { ref: nextButtonRef, dir: "next", variant: getArrowVariant(), size: "md", focusStyle, hideDisabledArrow: false, className: styles.scrollButtonNext, onClick: scrollToRight, standalone: true })
206
+ ] });
207
+ };
208
+ const Tab = ({
209
+ id,
210
+ children,
211
+ iconName,
212
+ href,
213
+ isDisabled,
214
+ className
215
+ }) => {
216
+ const context = useTabsContext();
217
+ const {
218
+ styleVariant,
219
+ focusStyle,
220
+ headingLevel
221
+ } = context;
222
+ const renderTabContent = () => {
223
+ const iconSize = styleVariant === "heading" ? "1.5x" : "1x";
224
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
225
+ iconName && /* @__PURE__ */ jsx(Icon, { iconName, iconSize, padding: "square", "aria-hidden": "true" }),
226
+ children
227
+ ] });
228
+ if (styleVariant === "heading") {
229
+ return /* @__PURE__ */ jsx(Heading, { as: headingLevel, size: "sm", children: content });
230
+ }
231
+ return content;
232
+ };
233
+ const combinedClassName = className ? `${styles.tab} ${focusStyleVariants({
234
+ focusStyle
235
+ })} ${className}` : `${styles.tab} ${focusStyleVariants({
236
+ focusStyle
237
+ })}`;
238
+ return /* @__PURE__ */ jsx(Tab$1, { id, href, className: combinedClassName, "data-has-icon": iconName ? "true" : void 0, "data-focus-style": focusStyle === "white" ? "white" : void 0, isDisabled, children: /* @__PURE__ */ jsx("span", { className: styles.tabText, children: renderTabContent() }) });
239
+ };
240
+ const tabs = cva(styles.tabs, {
241
+ variants: {
242
+ styleVariant: {
243
+ line: styles.line,
244
+ pill: styles.pill,
245
+ contained: styles.contained,
246
+ heading: styles.heading
247
+ },
248
+ align: {
249
+ start: styles.alignStart,
250
+ center: styles.alignCenter
251
+ }
252
+ },
253
+ defaultVariants: {
254
+ styleVariant: "line",
255
+ align: "start"
256
+ }
257
+ });
258
+ const TabsContext = createContext(null);
259
+ const useTabsContext = () => {
260
+ const context = useContext(TabsContext);
261
+ if (!context) {
262
+ throw new Error("Tab components must be used within a Tabs component");
263
+ }
264
+ return context;
265
+ };
266
+ const Tabs = ({
267
+ children,
268
+ styleVariant = "line",
269
+ align = "start",
270
+ fillContainer = false,
271
+ focusStyle = "default",
272
+ headingLevel = "h3",
273
+ selectedKey,
274
+ defaultSelectedKey,
275
+ disabledKeys,
276
+ onSelectionChange,
277
+ routes
278
+ }) => {
279
+ const contextValue = {
280
+ styleVariant,
281
+ align,
282
+ fillContainer,
283
+ focusStyle,
284
+ headingLevel
285
+ };
286
+ return /* @__PURE__ */ jsx(TabsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(Tabs$1, { className: tabs({
287
+ styleVariant,
288
+ align
289
+ }), selectedKey, defaultSelectedKey, disabledKeys, onSelectionChange, children: [
290
+ children,
291
+ routes && selectedKey && /* @__PURE__ */ jsx(TabPanel, { id: selectedKey, className: styles.tabPanel, children: routes })
292
+ ] }) });
293
+ };
294
+ export {
295
+ Tab,
296
+ TabList,
297
+ TabPanel,
298
+ Tabs,
299
+ Tabs as default,
300
+ useTabsContext
301
+ };
302
+ //# sourceMappingURL=Tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,9 @@
1
+ export { default } from './Tabs';
2
+ export type { TabsProps, TabsContextValue } from './Tabs';
3
+ export { TabList } from './TabList';
4
+ export type { TabListProps } from './TabList';
5
+ export { Tab } from './Tab';
6
+ export type { TabProps } from './Tab';
7
+ export { TabPanel } from './TabPanel';
8
+ export type { TabPanelProps } from './TabPanel';
9
+ export { useTabsContext } from './Tabs';
@@ -0,0 +1,10 @@
1
+ import { Tab, TabList, Tabs, useTabsContext } from "./Tabs.js";
2
+ import { T } from "../../TabPanel-DNAQ5FkE.js";
3
+ export {
4
+ Tab,
5
+ TabList,
6
+ T as TabPanel,
7
+ Tabs as default,
8
+ useTabsContext
9
+ };
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -33,6 +33,7 @@ export interface ToggleButtonProps {
33
33
  /**
34
34
  * The behavior of the button when used in an HTML form.
35
35
  * @default 'button'
36
+ * @deprecated This prop is not supported and will be removed in future versions.
36
37
  */
37
38
  type?: 'button' | 'submit' | 'reset';
38
39
  /**
@@ -4,10 +4,10 @@ import { useRef, useState, useEffect } from "react";
4
4
  import { ToggleButton as ToggleButton$1 } from "react-aria-components";
5
5
  import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
6
6
  import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
7
- import '../../assets/ToggleButton.css';const toggleButton$1 = "_toggleButton_1q059_1";
8
- const sm = "_sm_1q059_35";
9
- const md = "_md_1q059_42";
10
- const lg = "_lg_1q059_48";
7
+ import '../../assets/ToggleButton.css';const toggleButton$1 = "_toggleButton_1bwka_1";
8
+ const sm = "_sm_1bwka_35";
9
+ const md = "_md_1bwka_42";
10
+ const lg = "_lg_1bwka_48";
11
11
  const styles = {
12
12
  toggleButton: toggleButton$1,
13
13
  sm,
@@ -41,6 +41,9 @@ const ToggleButton = ({
41
41
  onClick,
42
42
  ...props
43
43
  }) => {
44
+ if (process.env.NODE_ENV !== "production" && type && type !== "button") {
45
+ console.warn("[ToggleButton] `type` is not supported by react-aria-components ToggleButton and will be ignored.");
46
+ }
44
47
  const buttonRef = useRef(null);
45
48
  const [buttonWidth, setButtonWidth] = useState(null);
46
49
  const [internalSelected, setInternalSelected] = useState(defaultSelected || false);
@@ -65,7 +68,7 @@ const ToggleButton = ({
65
68
  size
66
69
  })} ${focusStyleVariants({
67
70
  focusStyle
68
- })}`, ref: buttonRef, isSelected: selectedState, defaultSelected, isDisabled, autoFocus, type, onPress: handlePress, "aria-label": isLoading ? "Loading Spinner" : children ? children.toString() : "", style: {
71
+ })}`, ref: buttonRef, isSelected: selectedState, defaultSelected, isDisabled, autoFocus, onPress: handlePress, "aria-label": isLoading ? "Loading Spinner" : children ? children.toString() : "", style: {
69
72
  width: isLoading && buttonWidth ? `${buttonWidth}px` : "auto"
70
73
  }, ...props, children: [
71
74
  isLoading && /* @__PURE__ */ jsx(LoadingSpinner, { size: "1x" }),
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ToggleButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,10 +6,10 @@ import { Icon } from "../Icon/Icon.js";
6
6
  import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
7
7
  import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
8
8
  import { Tooltip } from "../Tooltip/Tooltip.js";
9
- import '../../assets/ToggleIconButton.css';const toggleIconButton$1 = "_toggleIconButton_1za7z_1";
10
- const sm = "_sm_1za7z_26";
11
- const md = "_md_1za7z_32";
12
- const lg = "_lg_1za7z_38";
9
+ import '../../assets/ToggleIconButton.css';const toggleIconButton$1 = "_toggleIconButton_ze2lp_1";
10
+ const sm = "_sm_ze2lp_26";
11
+ const md = "_md_ze2lp_32";
12
+ const lg = "_lg_ze2lp_38";
13
13
  const styles = {
14
14
  toggleIconButton: toggleIconButton$1,
15
15
  sm,
@@ -46,6 +46,9 @@ const ToggleIconButton = ({
46
46
  onClick,
47
47
  ...props
48
48
  }) => {
49
+ if (process.env.NODE_ENV !== "production" && type && type !== "button") {
50
+ console.warn("[ToggleButton] `type` is not supported by react-aria-components ToggleButton and will be ignored.");
51
+ }
49
52
  const buttonRef = useRef(null);
50
53
  const [buttonWidth, setButtonWidth] = useState(null);
51
54
  const [internalSelected, setInternalSelected] = useState(defaultSelected || false);
@@ -70,7 +73,7 @@ const ToggleIconButton = ({
70
73
  size
71
74
  })} ${focusStyleVariants({
72
75
  focusStyle
73
- })}`, ref: buttonRef, isSelected: selectedState, defaultSelected, isDisabled, autoFocus, type, onPress: handlePress, "aria-label": tooltipLabel ? void 0 : isLoading ? "Loading Spinner" : "Icon", style: {
76
+ })}`, ref: buttonRef, isSelected: selectedState, defaultSelected, isDisabled, autoFocus, onPress: handlePress, "aria-label": tooltipLabel ? void 0 : isLoading ? "Loading Spinner" : "Icon", style: {
74
77
  width: isLoading && buttonWidth ? `${buttonWidth}px` : void 0
75
78
  }, ...props, children: [
76
79
  isLoading && /* @__PURE__ */ jsx(LoadingSpinner, { size: "1x" }),
@@ -1 +1 @@
1
- {"version":3,"file":"ToggleIconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ToggleIconButton.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -31,8 +31,17 @@ export interface FieldCommonProps extends FieldHeaderProps {
31
31
  }
32
32
  export type FieldProps<T extends object = object> = T & FieldCommonProps;
33
33
  type FieldBaseProps<T extends object> = FieldProps<T> & Pick<FieldVariants, 'hasEndIcon' | 'hasStartIcon'> & {
34
+ /**
35
+ * The component or HTML element to render as the field container
36
+ */
34
37
  as: React.ElementType;
38
+ /**
39
+ * The content of the Field component
40
+ */
35
41
  children: React.ReactNode;
42
+ /**
43
+ * Optional className to be applied to the Field container
44
+ */
36
45
  className?: React.ComponentProps<React.ElementType>['className'];
37
46
  };
38
47
  export declare function Field<T extends object>({ as, children, className, columns, maxWidthByChars, hasStartIcon, hasEndIcon, errorPlacement, ...props }: FieldBaseProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -36,7 +36,7 @@ function Field({
36
36
  }
37
37
  }, [props == null ? void 0 : props.label]);
38
38
  return /* @__PURE__ */ jsxs(PolymorphicField, { as, isDisabled: props == null ? void 0 : props.isDisabled, className, ...props, children: [
39
- (props == null ? void 0 : props.label) ? /* @__PURE__ */ jsx(FieldHeader, { label: props == null ? void 0 : props.label, description: props == null ? void 0 : props.description, isInvalid: props == null ? void 0 : props.isInvalid, isRequired: props == null ? void 0 : props.isRequired, labelFor: props == null ? void 0 : props.labelFor, errorMessage: errorPlacement === "top" ? props == null ? void 0 : props.errorMessage : void 0, optionalTranslation: props == null ? void 0 : props.optionalTranslation }) : null,
39
+ (props == null ? void 0 : props.label) ? /* @__PURE__ */ jsx(FieldHeader, { label: props == null ? void 0 : props.label, description: props == null ? void 0 : props.description, isInvalid: props == null ? void 0 : props.isInvalid, isRequired: props == null ? void 0 : props.isRequired, labelFor: props == null ? void 0 : props.labelFor, descriptionId: props == null ? void 0 : props.descriptionId, errorId: props == null ? void 0 : props.errorId, errorMessage: errorPlacement === "top" ? props == null ? void 0 : props.errorMessage : void 0, optionalTranslation: props == null ? void 0 : props.optionalTranslation }) : null,
40
40
  /* @__PURE__ */ jsx("div", { className: styles.fieldGrid, children: /* @__PURE__ */ jsx("div", { className: fieldVariants({
41
41
  columns,
42
42
  maxWidthByChars,
@@ -34,6 +34,8 @@ export { default as CreditCardNumberField } from './CreditCardNumberField';
34
34
  export type * from './CreditCardNumberField';
35
35
  export { default as CreditCardSecurityCodeField } from './CreditCardSecurityCodeField';
36
36
  export type * from './CreditCardSecurityCodeField';
37
+ export { default as Currency } from './Currency';
38
+ export type * from './Currency';
37
39
  export { default as DateField } from './DateField';
38
40
  export type * from './DateField';
39
41
  export { default as DestinationHeading } from './DestinationHeading';
@@ -118,6 +120,8 @@ export { default as SubHeading } from './SubHeading';
118
120
  export type * from './SubHeading';
119
121
  export { default as Switch } from './Switch';
120
122
  export type * from './Switch';
123
+ export { default as Tabs, TabList, Tab, TabPanel, useTabsContext, } from './Tabs';
124
+ export type * from './Tabs';
121
125
  export { default as Tag } from './Tag';
122
126
  export type * from './Tag';
123
127
  export { default as TagGroup } from './TagGroup';
@@ -17,17 +17,18 @@ import { ClearFieldButton } from "./ClearFieldButton/ClearFieldButton.js";
17
17
  import { ComboBox } from "./ComboBox/ComboBox.js";
18
18
  import { CreditCardNumberField } from "./CreditCardNumberField/CreditCardNumberField.js";
19
19
  import { CreditCardSecurityCodeField } from "./CreditCardSecurityCodeField/CreditCardSecurityCodeField.js";
20
+ import { Currency } from "./Currency/Currency.js";
20
21
  import { DateField } from "./DateField/DateField.js";
21
22
  import { DestinationHeading } from "./DestinationHeading/DestinationHeading.js";
22
- import { default as default3 } from "./DetailsDisclosure/DetailsDisclosure.js";
23
+ import { DetailsDisclosure } from "./DetailsDisclosure/DetailsDisclosure.js";
23
24
  import { Dialog } from "./Dialog/Dialog.js";
24
25
  import { ErrorSummary } from "./ErrorSummary/ErrorSummary.js";
25
26
  import { Eyebrow } from "./Eyebrow/Eyebrow.js";
26
- import { default as default4 } from "./FieldDescription/FieldDescription.js";
27
+ import { default as default3 } from "./FieldDescription/FieldDescription.js";
27
28
  import { FieldError } from "./FieldError/FieldError.js";
28
29
  import { FieldHeader } from "./FieldHeader/FieldHeader.js";
29
30
  import { FieldLabel } from "./FieldLabel/FieldLabel.js";
30
- import { default as default5 } from "./Fieldset/Fieldset.js";
31
+ import { default as default4 } from "./Fieldset/Fieldset.js";
31
32
  import { FieldsetHeader } from "./FieldsetHeader/FieldsetHeader.js";
32
33
  import { Form } from "./Form/Form.js";
33
34
  import { Grid } from "./Grid/Grid.js";
@@ -37,10 +38,10 @@ import { IconBackdrop } from "./IconBackdrop/IconBackdrop.js";
37
38
  import { IconButton } from "./IconButton/IconButton.js";
38
39
  import { Image } from "./Image/Image.js";
39
40
  import { Label } from "./Label/Label.js";
40
- import { default as default6 } from "./Link/Link.js";
41
+ import { default as default5 } from "./Link/Link.js";
41
42
  import { ListBox } from "./ListBox/ListBox.js";
42
43
  import { ListBoxItem } from "./ListBoxItem/ListBoxItem.js";
43
- import { default as default7 } from "./LoadingSpinner/LoadingSpinner.js";
44
+ import { default as default6 } from "./LoadingSpinner/LoadingSpinner.js";
44
45
  import { Menu } from "./Menu/Menu.js";
45
46
  import { MonthYearField } from "./MonthYearField/MonthYearField.js";
46
47
  import { NumberField } from "./NumberField/NumberField.js";
@@ -51,20 +52,22 @@ import { PasswordField } from "./PasswordField/PasswordField.js";
51
52
  import { Radio } from "./Radio/Radio.js";
52
53
  import { RadioGroup } from "./RadioGroup/RadioGroup.js";
53
54
  import { SearchField } from "./SearchField/SearchField.js";
54
- import { default as default8 } from "./Section/Section.js";
55
- import { default as default9 } from "./SelectCard/SelectCard.js";
55
+ import { default as default7 } from "./Section/Section.js";
56
+ import { default as default8 } from "./SelectCard/SelectCard.js";
56
57
  import { SelectNative } from "./SelectNative/SelectNative.js";
57
58
  import { SkeletonLoader } from "./SkeletonLoader/SkeletonLoader.js";
58
59
  import { Slider } from "./Slider/Slider.js";
59
60
  import { Spacer } from "./Spacer/Spacer.js";
60
61
  import { SubHeading } from "./SubHeading/SubHeading.js";
61
62
  import { Switch } from "./Switch/Switch.js";
63
+ import { Tab, TabList, Tabs, useTabsContext } from "./Tabs/Tabs.js";
64
+ import { T } from "../TabPanel-DNAQ5FkE.js";
62
65
  import { Tag } from "./Tag/Tag.js";
63
66
  import { TagGroup } from "./TagGroup/TagGroup.js";
64
67
  import { TextField } from "./TextField/TextField.js";
65
68
  import { TextAreaField } from "./TextAreaField/TextAreaField.js";
66
- import { default as default10 } from "./ToggleButton/ToggleButton.js";
67
- import { default as default11 } from "./ToggleIconButton/ToggleIconButton.js";
69
+ import { default as default9 } from "./ToggleButton/ToggleButton.js";
70
+ import { default as default10 } from "./ToggleIconButton/ToggleIconButton.js";
68
71
  import { Tooltip } from "./Tooltip/Tooltip.js";
69
72
  export {
70
73
  Accordion,
@@ -86,17 +89,18 @@ export {
86
89
  ComboBox,
87
90
  CreditCardNumberField,
88
91
  CreditCardSecurityCodeField,
92
+ Currency,
89
93
  DateField,
90
94
  DestinationHeading,
91
- default3 as DetailsDisclosure,
95
+ DetailsDisclosure,
92
96
  Dialog,
93
97
  ErrorSummary,
94
98
  Eyebrow,
95
- default4 as FieldDescription,
99
+ default3 as FieldDescription,
96
100
  FieldError,
97
101
  FieldHeader,
98
102
  FieldLabel,
99
- default5 as Fieldset,
103
+ default4 as Fieldset,
100
104
  FieldsetHeader,
101
105
  Form,
102
106
  Grid,
@@ -106,10 +110,10 @@ export {
106
110
  IconButton,
107
111
  Image,
108
112
  Label,
109
- default6 as Link,
113
+ default5 as Link,
110
114
  ListBox,
111
115
  ListBoxItem,
112
- default7 as LoadingSpinner,
116
+ default6 as LoadingSpinner,
113
117
  Menu,
114
118
  MonthYearField,
115
119
  NumberField,
@@ -120,20 +124,25 @@ export {
120
124
  Radio,
121
125
  RadioGroup,
122
126
  SearchField,
123
- default8 as Section,
124
- default9 as SelectCard,
127
+ default7 as Section,
128
+ default8 as SelectCard,
125
129
  SelectNative,
126
130
  SkeletonLoader,
127
131
  Slider,
128
132
  Spacer,
129
133
  SubHeading,
130
134
  Switch,
135
+ Tab,
136
+ TabList,
137
+ T as TabPanel,
138
+ Tabs,
131
139
  Tag,
132
140
  TagGroup,
133
141
  TextAreaField,
134
142
  TextField,
135
- default10 as ToggleButton,
136
- default11 as ToggleIconButton,
137
- Tooltip
143
+ default9 as ToggleButton,
144
+ default10 as ToggleIconButton,
145
+ Tooltip,
146
+ useTabsContext
138
147
  };
139
148
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}