@arc-ui/components 11.15.0 → 11.17.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/Breadcrumbs/Breadcrumbs.cjs.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +1 -1
- package/dist/Calendar/Calendar.cjs.js +21 -0
- package/dist/Calendar/Calendar.esm.js +13 -0
- package/dist/Calendar/package.json +7 -0
- package/dist/Checkbox/Checkbox.cjs.js +3 -2
- package/dist/Checkbox/Checkbox.esm.js +3 -2
- package/dist/DatePicker/DatePicker.cjs.js +565 -0
- package/dist/DatePicker/DatePicker.esm.js +552 -0
- package/dist/DatePicker/package.json +7 -0
- package/dist/FormControl/FormControl.cjs.js +2 -1
- package/dist/FormControl/FormControl.esm.js +2 -1
- package/dist/InformationCard/InformationCard.cjs.js +31 -48
- package/dist/InformationCard/InformationCard.esm.js +29 -46
- package/dist/MediaCard/MediaCard.cjs.js +56 -0
- package/dist/MediaCard/MediaCard.esm.js +48 -0
- package/dist/MediaCard/package.json +7 -0
- package/dist/Modal/Modal.cjs.js +16 -313
- package/dist/Modal/Modal.esm.js +6 -303
- package/dist/PaginationSimple/PaginationSimple.cjs.js +19 -16
- package/dist/PaginationSimple/PaginationSimple.esm.js +19 -16
- package/dist/RadioGroup/RadioGroup.cjs.js +3 -2
- package/dist/RadioGroup/RadioGroup.esm.js +3 -2
- package/dist/Select/Select.cjs.js +352 -909
- package/dist/Select/Select.esm.js +303 -841
- package/dist/SiteFooter/SiteFooter.cjs.js +2 -2
- package/dist/SiteFooter/SiteFooter.esm.js +3 -3
- package/dist/SiteHeader/SiteHeader.cjs.js +2 -2
- package/dist/SiteHeader/SiteHeader.esm.js +2 -2
- package/dist/SiteHeaderV2/SiteHeaderV2.cjs.js +23 -0
- package/dist/SiteHeaderV2/SiteHeaderV2.esm.js +15 -0
- package/dist/SiteHeaderV2/package.json +7 -0
- package/dist/Switch/Switch.cjs.js +338 -13
- package/dist/Switch/Switch.esm.js +331 -6
- package/dist/Tabs/Tabs.cjs.js +7 -4
- package/dist/Tabs/Tabs.esm.js +7 -4
- package/dist/TextArea/TextArea.cjs.js +23 -18
- package/dist/TextArea/TextArea.esm.js +23 -18
- package/dist/TextInput/TextInput.cjs.js +3 -2
- package/dist/TextInput/TextInput.esm.js +3 -2
- package/dist/Toast/Toast.cjs.js +6 -4
- package/dist/Toast/Toast.esm.js +6 -4
- package/dist/TypographyCard/TypographyCard.cjs.js +36 -0
- package/dist/TypographyCard/TypographyCard.esm.js +28 -0
- package/dist/TypographyCard/package.json +7 -0
- package/dist/_shared/cjs/{Breadcrumbs-ed70e75a.js → Breadcrumbs-ef659d2b.js} +5 -5
- package/dist/_shared/cjs/BtIconArrowRightFill.esm-435cf4bd.js +26 -0
- package/dist/_shared/cjs/Calendar-18e255f8.js +4106 -0
- package/dist/_shared/cjs/CardFooter-43c32239.js +80 -0
- package/dist/_shared/cjs/CardLabel-768abf20.js +54 -0
- package/dist/_shared/cjs/{Checkbox-b126194e.js → Checkbox-4d4b432f.js} +1 -1
- package/dist/_shared/cjs/{index-43458549.js → Combination-9974f2e2.js} +687 -143
- package/dist/_shared/cjs/{FormControl-7daf8110.js → FormControl-b26ad353.js} +13 -6
- package/dist/_shared/cjs/{RadioGroup-56e3b0e5.js → RadioGroup-23c964ae.js} +1 -1
- package/dist/_shared/cjs/{SiteFooter-97c27b29.js → SiteFooter-65b6360c.js} +2 -2
- package/dist/_shared/cjs/{SiteHeader.rehydrator-af3dddef.js → SiteHeader.rehydrator-df053a52.js} +8 -8
- package/dist/_shared/cjs/SiteHeaderV2-8ce6d4fc.js +610 -0
- package/dist/_shared/cjs/{Tabs-2d2a517d.js → Tabs-34db6bc1.js} +17 -37
- package/dist/_shared/cjs/TextInput-d0370fa8.js +100 -0
- package/dist/_shared/cjs/{Toast-69108261.js → Toast-392b1d60.js} +266 -26
- package/dist/_shared/cjs/{index-adbb63da.js → index-6eb396a3.js} +1 -1
- package/dist/_shared/cjs/index-74004a9c.js +23 -0
- package/dist/_shared/cjs/index-77ab5c6a.js +2180 -0
- package/dist/_shared/cjs/{index-b2fd6338.js → index-9f99d686.js} +1 -1
- package/dist/_shared/cjs/index-a31e64a9.js +27 -0
- package/dist/_shared/cjs/index-d38f1bd0.js +131 -0
- package/dist/_shared/cjs/index-dcfdd5da.js +11 -0
- package/dist/_shared/cjs/{index.module-dd1d7d0b.js → index-dd1d18ea.js} +26 -43
- package/dist/_shared/esm/{Breadcrumbs-87e2bd46.js → Breadcrumbs-36edfb3d.js} +5 -5
- package/dist/_shared/esm/BtIconArrowRightFill.esm-99019d1a.js +20 -0
- package/dist/_shared/esm/Calendar-4033fa48.js +4093 -0
- package/dist/_shared/esm/CardFooter-dd8d4000.js +74 -0
- package/dist/_shared/esm/CardLabel-d6d71407.js +46 -0
- package/dist/_shared/esm/{Checkbox-d6ec5024.js → Checkbox-720b074d.js} +1 -1
- package/dist/_shared/esm/{index-41d7af2b.js → Combination-e9f7e64e.js} +670 -133
- package/dist/_shared/esm/{FormControl-351e5f1b.js → FormControl-f0b8fe91.js} +13 -6
- package/dist/_shared/esm/{RadioGroup-c838764c.js → RadioGroup-37fdb06b.js} +1 -1
- package/dist/_shared/esm/{SiteFooter-94316b8b.js → SiteFooter-38ee1536.js} +1 -1
- package/dist/_shared/esm/{SiteHeader.rehydrator-1b507253.js → SiteHeader.rehydrator-32bdcd88.js} +2 -2
- package/dist/_shared/esm/SiteHeaderV2-f8377627.js +604 -0
- package/dist/_shared/esm/{Tabs-f903187a.js → Tabs-df9965dd.js} +7 -27
- package/dist/_shared/esm/TextInput-abbab56b.js +94 -0
- package/dist/_shared/esm/{Toast-37549e68.js → Toast-5d66e13f.js} +258 -19
- package/dist/_shared/esm/{index-a1d2d9b3.js → index-044da8d0.js} +1 -1
- package/dist/_shared/esm/index-25a5b393.js +25 -0
- package/dist/_shared/esm/index-2cfab9f2.js +21 -0
- package/dist/_shared/esm/{index.module-44714d3f.js → index-7b531fa7.js} +28 -44
- package/dist/_shared/esm/index-a624de47.js +9 -0
- package/dist/_shared/esm/index-b84a20c6.js +2155 -0
- package/dist/_shared/esm/index-ca72c9d5.js +129 -0
- package/dist/_shared/esm/{index-efd9ef1c.js → index-efa9be1a.js} +1 -1
- package/dist/_shared/esm/{index.es-c552c0ea.js → use-media-query-4c807227.js} +9 -9
- package/dist/index.es.js +4072 -1533
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4074 -1533
- package/dist/index.js.map +1 -1
- package/dist/styles.css +5 -5
- package/dist/types/components/Calendar/Calendar.d.ts +49 -0
- package/dist/types/components/Calendar/Calendar.provider.d.ts +21 -0
- package/dist/types/components/Calendar/components/CalendarDateSelect/CalendarDateSelect.d.ts +15 -0
- package/dist/types/components/Calendar/components/CalendarDateSelect/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDayGrid/CalendarDayGrid.d.ts +6 -0
- package/dist/types/components/Calendar/components/CalendarDayGrid/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDayNumber/CalendarDayNumber.d.ts +8 -0
- package/dist/types/components/Calendar/components/CalendarDayNumber/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarDoubleMonthView/CalendarDoubleMonthView.d.ts +9 -0
- package/dist/types/components/Calendar/components/CalendarDoubleMonthView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarFooter/CalendarFooter.d.ts +6 -0
- package/dist/types/components/Calendar/components/CalendarFooter/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarMonthView/CalendarMonthView.d.ts +9 -0
- package/dist/types/components/Calendar/components/CalendarMonthView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarMonthYearView/CalendarMonthYearView.d.ts +11 -0
- package/dist/types/components/Calendar/components/CalendarMonthYearView/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarNavButton/CalendarNavButton.d.ts +10 -0
- package/dist/types/components/Calendar/components/CalendarNavButton/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/CalendarWrapper/CalendarWrapper.d.ts +5 -0
- package/dist/types/components/Calendar/components/CalendarWrapper/index.d.ts +1 -0
- package/dist/types/components/Calendar/components/index.d.ts +6 -0
- package/dist/types/components/Calendar/constants/day-names.d.ts +5 -0
- package/dist/types/components/Calendar/constants/index.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/contains-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/contains-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/date-without-time.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/date-without-time.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-calendar-type.d.ts +2 -0
- package/dist/types/components/Calendar/helpers/get-calendar-type.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-dates-in-month.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-dates-in-month.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-double-month-display-range.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-double-month-display-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-focus-date.d.ts +5 -0
- package/dist/types/components/Calendar/helpers/get-focus-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-highlighted-range.d.ts +6 -0
- package/dist/types/components/Calendar/helpers/get-highlighted-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/get-keydown-date.d.ts +6 -0
- package/dist/types/components/Calendar/helpers/get-keydown-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/index.d.ts +13 -0
- package/dist/types/components/Calendar/helpers/is-day.d.ts +2 -0
- package/dist/types/components/Calendar/helpers/is-day.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-disabled-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-disabled-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-after-max-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-after-max-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-before-min-date.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/is-month-before-min-date.test.d.ts +1 -0
- package/dist/types/components/Calendar/helpers/process-selected-range.d.ts +9 -0
- package/dist/types/components/Calendar/helpers/process-selected-range.test.d.ts +1 -0
- package/dist/types/components/Calendar/index.d.ts +2 -0
- package/dist/types/components/Calendar/state/handlers/calendar-keydown-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/day-grid-leave-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/day-number-select-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/default-handler.d.ts +2 -0
- package/dist/types/components/Calendar/state/handlers/dropdown-change-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/dropdown-change-year-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/highlight-range-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/index.d.ts +12 -0
- package/dist/types/components/Calendar/state/handlers/range-select-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-next-double-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-next-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-previous-double-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/handlers/show-previous-month-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/index.d.ts +2 -0
- package/dist/types/components/Calendar/state/reducer.d.ts +3 -0
- package/dist/types/components/Calendar/state/reducer.test.d.ts +1 -0
- package/dist/types/components/Calendar/state/types/actions.d.ts +81 -0
- package/dist/types/components/Calendar/state/types/state-handler.d.ts +3 -0
- package/dist/types/components/Calendar/state/types/state.d.ts +5 -0
- package/dist/types/components/Calendar/types/calendar-type.d.ts +1 -0
- package/dist/types/components/Calendar/types/date-select-value.d.ts +2 -0
- package/dist/types/components/Calendar/types/index.d.ts +6 -0
- package/dist/types/components/Calendar/types/key-names.d.ts +13 -0
- package/dist/types/components/Calendar/types/range-selection.d.ts +10 -0
- package/dist/types/components/Calendar/types/selection-type.d.ts +1 -0
- package/dist/types/components/Calendar/types/week-days.d.ts +18 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +17 -0
- package/dist/types/components/DatePicker/constants/date-format.d.ts +1 -0
- package/dist/types/components/DatePicker/constants/index.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-date-string-to-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/convert-range-string-to-dates.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/format-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/format-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/index.d.ts +8 -0
- package/dist/types/components/DatePicker/helpers/is-date-valid.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-date-valid.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-disabled-date.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-disabled-date.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-range-valid.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/is-range-valid.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/parse-date-string.d.ts +5 -0
- package/dist/types/components/DatePicker/helpers/parse-date-string.test.d.ts +1 -0
- package/dist/types/components/DatePicker/helpers/parse-range-string.d.ts +14 -0
- package/dist/types/components/DatePicker/helpers/parse-range-string.test.d.ts +1 -0
- package/dist/types/components/DatePicker/index.d.ts +6 -0
- package/dist/types/components/FormControl/FormControl.d.ts +4 -0
- package/dist/types/components/MediaCard/MediaCard.d.ts +24 -30
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/types/components/Select/Select.d.ts +49 -0
- package/dist/types/components/SiteHeaderV2/SiteHeaderV2.d.ts +77 -0
- package/dist/types/components/SiteHeaderV2/components/BackButton/BackButton.d.ts +5 -0
- package/dist/types/components/SiteHeaderV2/components/BackButton/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/Column/Column.d.ts +8 -0
- package/dist/types/components/SiteHeaderV2/components/Column/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/HorizontalPanel.d.ts +13 -0
- package/dist/types/components/SiteHeaderV2/components/HorizontalPanel/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/Item/Item.d.ts +20 -0
- package/dist/types/components/SiteHeaderV2/components/Item/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/ItemGroup/ItemGroup.d.ts +27 -0
- package/dist/types/components/SiteHeaderV2/components/ItemGroup/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/MenuButton/MenuButton.d.ts +6 -0
- package/dist/types/components/SiteHeaderV2/components/MenuButton/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/NavItem/NavItem.d.ts +40 -0
- package/dist/types/components/SiteHeaderV2/components/NavItem/NavItemWithSubNav.d.ts +55 -0
- package/dist/types/components/SiteHeaderV2/components/NavItem/index.d.ts +2 -0
- package/dist/types/components/SiteHeaderV2/components/NodeItem/NodeItem.d.ts +8 -0
- package/dist/types/components/SiteHeaderV2/components/Panel/Panel.d.ts +26 -0
- package/dist/types/components/SiteHeaderV2/components/Panel/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/SubNavItem/SubNavItem.d.ts +45 -0
- package/dist/types/components/SiteHeaderV2/components/SubNavItem/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/VerticalDivider/VerticalDivider.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/components/VerticalDivider/index.d.ts +1 -0
- package/dist/types/components/SiteHeaderV2/index.d.ts +1 -0
- package/dist/types/components/TextArea/TextArea.d.ts +4 -0
- package/dist/types/components/TextInput/TextInput.d.ts +34 -4
- package/dist/types/components/TypographyCard/TypographyCard.d.ts +48 -0
- package/dist/types/components/TypographyCard/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/private-components/CardFooter/CardFooter.d.ts +11 -0
- package/dist/types/private-components/CardFooter/index.d.ts +1 -0
- package/dist/types/private-components/CardHeading/CardHeading.d.ts +19 -0
- package/dist/types/private-components/CardHeading/index.d.ts +1 -0
- package/dist/types/private-components/CardLabel/CardLabel.d.ts +10 -0
- package/dist/types/private-components/CardLabel/index.d.ts +1 -0
- package/dist/types/private-components/ConditionalWrapper/ConditionalWrapper.d.ts +6 -0
- package/dist/types/private-components/ConditionalWrapper/index.d.ts +1 -0
- package/dist/types/private-components/index.d.ts +4 -0
- package/dist/types/styles.d.ts +8 -1
- package/package.json +5 -3
- package/dist/_shared/cjs/TextInput-bf1fe052.js +0 -81
- package/dist/_shared/cjs/index-6b2a9ac3.js +0 -289
- package/dist/_shared/cjs/index-c575a255.js +0 -490
- package/dist/_shared/esm/TextInput-991804b6.js +0 -75
- package/dist/_shared/esm/index-13d575cc.js +0 -479
- package/dist/_shared/esm/index-3797d77e.js +0 -280
- package/dist/types/components/MediaCard/MediaCard.stories-wip.d.ts +0 -15
- package/dist/_shared/cjs/{index.es-26dd8c5d.js → use-media-query-e61881d8.js} +8 -8
|
@@ -59,5 +59,9 @@ export interface TextAreaProps extends Omit<FormControlProps, "children" | "elem
|
|
|
59
59
|
* `onChange` callback function. Otherwise, use `defaultValue` (or `isReadOnly`).
|
|
60
60
|
*/
|
|
61
61
|
value?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Sets the width of the TextArea.
|
|
64
|
+
*/
|
|
65
|
+
width?: string;
|
|
62
66
|
}
|
|
63
67
|
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { FormControlProps } from "../FormControl/FormControl";
|
|
3
|
+
import { ArcIcon } from "../../types/arc-icon";
|
|
3
4
|
type EventType = React.ChangeEvent<HTMLInputElement>;
|
|
4
5
|
/**
|
|
5
6
|
* Use `TextInput` to allow custom user text entry with a keyboard.
|
|
6
7
|
*/
|
|
7
|
-
export declare const TextInput:
|
|
8
|
+
export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
8
9
|
export interface TextInputProps extends Omit<FormControlProps, "children" | "elementType" | "htmlFor" | "requirementStatus" | "helperUnderLabel" | "supplementaryInfo"> {
|
|
9
10
|
/**
|
|
10
11
|
* Uncontrolled default value of the TextInput. If the TextInput is controlled
|
|
@@ -48,7 +49,7 @@ export interface TextInputProps extends Omit<FormControlProps, "children" | "ele
|
|
|
48
49
|
/**
|
|
49
50
|
* Function to call when the TextInput loses focus.
|
|
50
51
|
*/
|
|
51
|
-
onBlur?: (e:
|
|
52
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement, Element>) => void;
|
|
52
53
|
/**
|
|
53
54
|
* Callback function commonly used to update the TextInput's controlled
|
|
54
55
|
* `value`, for example `e => setValue(e.target.value)`.
|
|
@@ -63,9 +64,20 @@ export interface TextInputProps extends Omit<FormControlProps, "children" | "ele
|
|
|
63
64
|
*/
|
|
64
65
|
inputSize?: "s" | "m" | "l";
|
|
65
66
|
/**
|
|
66
|
-
*
|
|
67
|
+
* Determine the alignment of the text within the input
|
|
68
|
+
*/
|
|
69
|
+
inputAlignment?: "left" | "right";
|
|
70
|
+
/**
|
|
71
|
+
* Enable button to toggle TextInput type from `Selected Type` to `Text`. This will override any `suffix` elements
|
|
67
72
|
*/
|
|
68
73
|
showPassword?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Add a prefixed value within `TextInput`
|
|
76
|
+
*/
|
|
77
|
+
prefix?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Add a suffixed value within `TextInput`. If `showPassword` is true, suffix will not be displayed */
|
|
80
|
+
suffix?: string;
|
|
69
81
|
/**
|
|
70
82
|
* Type for the input. `number` will be changed to `text` and set the `numeric` inputMode.
|
|
71
83
|
*/
|
|
@@ -75,5 +87,23 @@ export interface TextInputProps extends Omit<FormControlProps, "children" | "ele
|
|
|
75
87
|
* `onChange` callback function. Otherwise, use `defaultValue` (or `isReadOnly`).
|
|
76
88
|
*/
|
|
77
89
|
value?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Placeholder for the input
|
|
92
|
+
*/
|
|
93
|
+
placeholder?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Icon button to show at the end of the input
|
|
96
|
+
*/
|
|
97
|
+
iconButton?: {
|
|
98
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
99
|
+
onFocus?: React.FocusEventHandler<HTMLButtonElement>;
|
|
100
|
+
onClick: () => void;
|
|
101
|
+
label: string;
|
|
102
|
+
icon: ArcIcon;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Sets the width of the TextInput.
|
|
106
|
+
*/
|
|
107
|
+
width?: string;
|
|
78
108
|
}
|
|
79
109
|
export {};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { FC } from "react";
|
|
2
|
+
import { HeadingLevel } from "../Heading/Heading";
|
|
3
|
+
export declare const TypographyCard: FC<TypographyCardProps>;
|
|
4
|
+
type TypographyCardIcon = "play" | "arrow";
|
|
5
|
+
type TypographyCardPathway = "light" | "dark";
|
|
6
|
+
export interface TypographyCardProps {
|
|
7
|
+
/**
|
|
8
|
+
* Heading for the TypographyCard.
|
|
9
|
+
*/
|
|
10
|
+
heading: string;
|
|
11
|
+
/**
|
|
12
|
+
* Url for the TypographyCard.
|
|
13
|
+
*/
|
|
14
|
+
url: string;
|
|
15
|
+
/**
|
|
16
|
+
* Sets a dark or light background for the TypographyCard.
|
|
17
|
+
*/
|
|
18
|
+
pathway?: TypographyCardPathway;
|
|
19
|
+
/**
|
|
20
|
+
* Icon for the TypographyCard Cta button.
|
|
21
|
+
*/
|
|
22
|
+
buttonIcon?: TypographyCardIcon;
|
|
23
|
+
/**
|
|
24
|
+
* Heading level for the TypographyCard heading.
|
|
25
|
+
*/
|
|
26
|
+
headingLevel?: HeadingLevel;
|
|
27
|
+
/**
|
|
28
|
+
* Uppercase label for the TypographyCard.
|
|
29
|
+
*/
|
|
30
|
+
label?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Click handler for the TypographyCard.
|
|
33
|
+
*/
|
|
34
|
+
onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
* Text to show adjacent to the cta
|
|
38
|
+
*/
|
|
39
|
+
metaText?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Object of `data-` attributes to render on internal anchor element, e.g.
|
|
42
|
+
* `{ data-analytics-link: "My link"}` => `<a data-analytics-link="My link">`.
|
|
43
|
+
*/
|
|
44
|
+
linkData?: {
|
|
45
|
+
[key: string]: string;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TypographyCard } from "./TypographyCard";
|
|
@@ -36,6 +36,7 @@ export { Section } from "./Section";
|
|
|
36
36
|
export { Select } from "./Select";
|
|
37
37
|
export { SiteFooter, SiteFooterRehydrator } from "./SiteFooter";
|
|
38
38
|
export { SiteHeader, SiteHeaderRehydrator } from "./SiteHeader";
|
|
39
|
+
export { SiteHeaderV2 } from "./SiteHeaderV2";
|
|
39
40
|
export { Surface, SurfaceContext } from "./Surface";
|
|
40
41
|
export { Switch } from "./Switch";
|
|
41
42
|
export { Tabs } from "./Tabs";
|
|
@@ -45,6 +46,7 @@ export { TextArea } from "./TextArea";
|
|
|
45
46
|
export { TextInput } from "./TextInput";
|
|
46
47
|
export { Toast } from "./Toast";
|
|
47
48
|
export { Truncate } from "./Truncate";
|
|
49
|
+
export { TypographyCard } from "./TypographyCard";
|
|
48
50
|
export { UniversalHeader } from "./UniversalHeader";
|
|
49
51
|
export { VerticalSpace } from "./VerticalSpace";
|
|
50
52
|
export { VisuallyHidden } from "./VisuallyHidden";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
export declare const CardFooter: FC<CardFooterProps>;
|
|
3
|
+
type CardFooterIcon = "play" | "arrow";
|
|
4
|
+
export interface CardFooterProps {
|
|
5
|
+
metaText?: string;
|
|
6
|
+
isDarkPathway?: boolean;
|
|
7
|
+
buttonIcon?: CardFooterIcon;
|
|
8
|
+
showFilledIcon?: boolean;
|
|
9
|
+
showButton?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CardFooter } from "./CardFooter";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HeadingLevel } from "../../components/Heading/Heading";
|
|
3
|
+
export declare const CardHeading: React.FC<CardHeadingProps>;
|
|
4
|
+
interface CardHeadingProps {
|
|
5
|
+
heading: string;
|
|
6
|
+
size?: "s" | "m";
|
|
7
|
+
isDarkPathway?: boolean;
|
|
8
|
+
href?: string;
|
|
9
|
+
headingLevel?: HeadingLevel;
|
|
10
|
+
onClick?: (e: React.MouseEvent<HTMLAnchorElement>) => void;
|
|
11
|
+
onMouseEnter?: () => void;
|
|
12
|
+
onMouseLeave?: () => void;
|
|
13
|
+
onFocus?: () => void;
|
|
14
|
+
onBlur?: () => void;
|
|
15
|
+
linkData?: {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CardHeading } from "./CardHeading";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CardLabel } from "./CardLabel";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ConditionalWrapper } from "./ConditionalWrapper";
|
package/dist/types/styles.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import "./components/Alert/Alert.css";
|
|
|
2
2
|
import "./components/Align/Align.css";
|
|
3
3
|
import "./components/Badge/Badge.css";
|
|
4
4
|
import "./components/Base/Base.css";
|
|
5
|
+
import "./components/Box/Box.css";
|
|
5
6
|
import "./components/BrandLogo/BrandLogo.css";
|
|
6
7
|
import "./components/Breadcrumbs/Breadcrumbs.css";
|
|
7
8
|
import "./components/Card/Card.css";
|
|
8
|
-
import "./components/Box/Box.css";
|
|
9
9
|
import "./components/Button/Button.css";
|
|
10
10
|
import "./components/Checkbox/Checkbox.css";
|
|
11
11
|
import "./components/Clock/Clock.css";
|
|
@@ -34,6 +34,7 @@ import "./components/Section/Section.css";
|
|
|
34
34
|
import "./components/Select/Select.css";
|
|
35
35
|
import "./components/SiteFooter/SiteFooter.css";
|
|
36
36
|
import "./components/SiteHeader/SiteHeader.css";
|
|
37
|
+
import "./components/SiteHeaderV2/SiteHeaderV2.css";
|
|
37
38
|
import "./components/Surface/Surface.css";
|
|
38
39
|
import "./components/Tabs/Tabs.css";
|
|
39
40
|
import "./components/Tag/Tag.css";
|
|
@@ -73,4 +74,10 @@ import "./components/UniversalHeader/UniversalHeader.bt.css";
|
|
|
73
74
|
import "./components/Switch/Switch.bt.css";
|
|
74
75
|
import "./components/Toast/Toast.css";
|
|
75
76
|
import "./components/ProgressStepper/ProgressStepper.css";
|
|
77
|
+
import "./components/Calendar/Calendar.css";
|
|
78
|
+
import "./components/DatePicker/DatePicker.css";
|
|
76
79
|
import "./components/InformationCard/InformationCard.css";
|
|
80
|
+
import "./components/TypographyCard/TypographyCard.css";
|
|
81
|
+
import "./private-components/CardHeading/CardHeading.css";
|
|
82
|
+
import "./private-components/CardLabel/CardLabel.css";
|
|
83
|
+
import "./private-components/CardFooter/CardFooter.css";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arc-ui/components",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.17.0",
|
|
4
4
|
"homepage": "https://ui.digital-ent-int.bt.com",
|
|
5
5
|
"author": "BT Enterprise Digital UI Team <ui-digital-ent-int@bt.com>",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,12 +26,14 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@geometricpanda/storybook-addon-badges": "^2.0.0",
|
|
29
|
-
"@radix-ui/react-dialog": "1.0.
|
|
29
|
+
"@radix-ui/react-dialog": "1.0.5",
|
|
30
30
|
"@radix-ui/react-label": "2.0.0",
|
|
31
|
-
"@radix-ui/react-
|
|
31
|
+
"@radix-ui/react-popover": "^1.0.7",
|
|
32
|
+
"@radix-ui/react-select": "2.0.0",
|
|
32
33
|
"@radix-ui/react-switch": "1.0.1",
|
|
33
34
|
"@radix-ui/react-tabs": "1.0.4",
|
|
34
35
|
"@radix-ui/react-toast": "1.1.4",
|
|
36
|
+
"date-fns": "^2.30.0",
|
|
35
37
|
"storybook": "^7.4.5"
|
|
36
38
|
},
|
|
37
39
|
"devDependencies": {
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var filterDataAttrs = require('./filter-data-attrs-1c9a530c.js');
|
|
4
|
-
var index = require('./index-9947ac13.js');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var FormControl = require('./FormControl-7daf8110.js');
|
|
7
|
-
var Surface = require('./Surface-038db6e1.js');
|
|
8
|
-
var VisuallyHidden = require('./VisuallyHidden-e2c8b291.js');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Infer the correct inputMode, pattern and type if specifying a `number` type.
|
|
16
|
-
*/
|
|
17
|
-
var useNumericInput = function (props) {
|
|
18
|
-
var type = props.type === "number" ? "text" : props.type;
|
|
19
|
-
var inputMode = props.inputMode;
|
|
20
|
-
if (!props.inputMode) {
|
|
21
|
-
if (props.type === "email") {
|
|
22
|
-
inputMode = "email";
|
|
23
|
-
}
|
|
24
|
-
else if (props.type === "number") {
|
|
25
|
-
inputMode = "numeric";
|
|
26
|
-
}
|
|
27
|
-
else if (props.type === "tel") {
|
|
28
|
-
inputMode = "tel";
|
|
29
|
-
}
|
|
30
|
-
else if (props.type === "url") {
|
|
31
|
-
inputMode = "url";
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
var pattern = props.pattern;
|
|
35
|
-
if (!props.pattern && props.type === "number") {
|
|
36
|
-
pattern = "[0-9]*";
|
|
37
|
-
}
|
|
38
|
-
return { inputMode: inputMode, pattern: pattern, type: type };
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Use `TextInput` to allow custom user text entry with a keyboard.
|
|
43
|
-
*/
|
|
44
|
-
var TextInput = React.forwardRef(function (_a, ref) {
|
|
45
|
-
var _b;
|
|
46
|
-
var _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, errorMessage = _a.errorMessage, helper = _a.helper, id = _a.id, inputMode = _a.inputMode, _d = _a.isDisabled, isDisabled = _d === void 0 ? false : _d, _e = _a.isReadOnly, isReadOnly = _e === void 0 ? false : _e, _f = _a.isRequired, isRequired = _f === void 0 ? false : _f, label = _a.label, _g = _a.labelSize, labelSize = _g === void 0 ? "l" : _g, maxLength = _a.maxLength, minLength = _a.minLength, name = _a.name, onBlur = _a.onBlur, onChange = _a.onChange, onClickDisclosure = _a.onClickDisclosure, pattern = _a.pattern, _h = _a.type, type = _h === void 0 ? "text" : _h, _j = _a.showPassword, showPassword = _j === void 0 ? false : _j, value = _a.value, disclosureTitle = _a.disclosureTitle, disclosureText = _a.disclosureText, _k = _a.inputSize, inputSize = _k === void 0 ? "m" : _k, props = filterDataAttrs.__rest(_a, ["defaultValue", "errorMessage", "helper", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText", "inputSize"]);
|
|
47
|
-
var surface = React.useContext(Surface.Context).surface;
|
|
48
|
-
var _l = React.useState(false), showPasswordToggle = _l[0], setShowPasswordToggle = _l[1];
|
|
49
|
-
var inferredInputProps = useNumericInput({
|
|
50
|
-
inputMode: inputMode,
|
|
51
|
-
pattern: pattern,
|
|
52
|
-
type: showPasswordToggle ? "text" : type
|
|
53
|
-
});
|
|
54
|
-
// Although this is used within FormControlWrapper, it's deterministic so we can call it here too
|
|
55
|
-
var ariaDescribedby = FormControl.useAriaDescribedby({
|
|
56
|
-
errorMessage: errorMessage,
|
|
57
|
-
id: id,
|
|
58
|
-
helper: helper,
|
|
59
|
-
disclosureText: disclosureText
|
|
60
|
-
}).ariaDescribedby;
|
|
61
|
-
return (React__default["default"].createElement("div", filterDataAttrs.__assign({ className: index.classNames((_b = {
|
|
62
|
-
"arc-TextInput": true,
|
|
63
|
-
"arc-TextInput--withPasswordToggle": showPassword,
|
|
64
|
-
"arc-TextInput--invalid": errorMessage,
|
|
65
|
-
"arc-TextInput--onDarkSurface": surface === "dark"
|
|
66
|
-
},
|
|
67
|
-
_b["arc-TextInput--size".concat(inputSize && inputSize.toUpperCase())] = inputSize && inputSize !== "m",
|
|
68
|
-
_b)) }, filterDataAttrs.filterDataAttrs(props)),
|
|
69
|
-
React__default["default"].createElement(FormControl.FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
|
|
70
|
-
React__default["default"].createElement("div", { className: "arc-TextInput-inputWrapper" },
|
|
71
|
-
React__default["default"].createElement("input", filterDataAttrs.__assign({ "aria-describedby": ariaDescribedby, "aria-invalid": errorMessage ? "true" : "false", className: "arc-TextInput-input", defaultValue: typeof value !== "undefined" ? undefined : defaultValue, disabled: isDisabled, id: id, maxLength: maxLength, minLength: minLength, name: name, onChange: onChange, onBlur: onBlur, readOnly: isReadOnly, ref: ref, required: isRequired, value: typeof value !== "undefined" ? value : undefined }, inferredInputProps)),
|
|
72
|
-
showPassword && (React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
73
|
-
React__default["default"].createElement("button", { className: "arc-TextInput-passwordToggle", onClick: function () { return setShowPasswordToggle(function (p) { return !p; }); }, type: "button" }, showPasswordToggle ? "Hide" : "Show"),
|
|
74
|
-
React__default["default"].createElement(VisuallyHidden.VisuallyHidden, null,
|
|
75
|
-
React__default["default"].createElement("div", { "aria-live": "polite" },
|
|
76
|
-
React__default["default"].createElement("p", null, showPasswordToggle
|
|
77
|
-
? "Your password is shown"
|
|
78
|
-
: "Your password is hidden")))))))));
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
exports.TextInput = TextInput;
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _extends = require('./extends-8c5e4b48.js');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var index = require('./index-c575a255.js');
|
|
6
|
-
var $7SXl2$reactdom = require('react-dom');
|
|
7
|
-
|
|
8
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
9
|
-
|
|
10
|
-
var $7SXl2$reactdom__default = /*#__PURE__*/_interopDefaultLegacy($7SXl2$reactdom);
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Listens for when the escape key is down
|
|
14
|
-
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
15
|
-
const onEscapeKeyDown = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
16
|
-
React.useEffect(()=>{
|
|
17
|
-
const handleKeyDown = (event)=>{
|
|
18
|
-
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
19
|
-
};
|
|
20
|
-
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
21
|
-
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
22
|
-
;
|
|
23
|
-
}, [
|
|
24
|
-
onEscapeKeyDown,
|
|
25
|
-
ownerDocument
|
|
26
|
-
]);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
30
|
-
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
31
|
-
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
32
|
-
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
33
|
-
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ React.createContext({
|
|
34
|
-
layers: new Set(),
|
|
35
|
-
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
36
|
-
branches: new Set()
|
|
37
|
-
});
|
|
38
|
-
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
39
|
-
var _node$ownerDocument;
|
|
40
|
-
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
41
|
-
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
42
|
-
const [node1, setNode] = React.useState(null);
|
|
43
|
-
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
44
|
-
const [, force] = React.useState({});
|
|
45
|
-
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
46
|
-
);
|
|
47
|
-
const layers = Array.from(context.layers);
|
|
48
|
-
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
49
|
-
...context.layersWithOutsidePointerEventsDisabled
|
|
50
|
-
].slice(-1); // prettier-ignore
|
|
51
|
-
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
52
|
-
const index$1 = node1 ? layers.indexOf(node1) : -1;
|
|
53
|
-
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
54
|
-
const isPointerEventsEnabled = index$1 >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
55
|
-
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
56
|
-
const target = event.target;
|
|
57
|
-
const isPointerDownOnBranch = [
|
|
58
|
-
...context.branches
|
|
59
|
-
].some((branch)=>branch.contains(target)
|
|
60
|
-
);
|
|
61
|
-
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
62
|
-
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
63
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
64
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
65
|
-
}, ownerDocument);
|
|
66
|
-
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
67
|
-
const target = event.target;
|
|
68
|
-
const isFocusInBranch = [
|
|
69
|
-
...context.branches
|
|
70
|
-
].some((branch)=>branch.contains(target)
|
|
71
|
-
);
|
|
72
|
-
if (isFocusInBranch) return;
|
|
73
|
-
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
74
|
-
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
75
|
-
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
76
|
-
}, ownerDocument);
|
|
77
|
-
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
78
|
-
const isHighestLayer = index$1 === context.layers.size - 1;
|
|
79
|
-
if (!isHighestLayer) return;
|
|
80
|
-
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
81
|
-
if (!event.defaultPrevented && onDismiss) {
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
onDismiss();
|
|
84
|
-
}
|
|
85
|
-
}, ownerDocument);
|
|
86
|
-
React.useEffect(()=>{
|
|
87
|
-
if (!node1) return;
|
|
88
|
-
if (disableOutsidePointerEvents) {
|
|
89
|
-
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
90
|
-
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
91
|
-
ownerDocument.body.style.pointerEvents = 'none';
|
|
92
|
-
}
|
|
93
|
-
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
94
|
-
}
|
|
95
|
-
context.layers.add(node1);
|
|
96
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
97
|
-
return ()=>{
|
|
98
|
-
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
99
|
-
};
|
|
100
|
-
}, [
|
|
101
|
-
node1,
|
|
102
|
-
ownerDocument,
|
|
103
|
-
disableOutsidePointerEvents,
|
|
104
|
-
context
|
|
105
|
-
]);
|
|
106
|
-
/**
|
|
107
|
-
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
108
|
-
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
109
|
-
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
110
|
-
* We only want them to be removed from context stacks when unmounted.
|
|
111
|
-
*/ React.useEffect(()=>{
|
|
112
|
-
return ()=>{
|
|
113
|
-
if (!node1) return;
|
|
114
|
-
context.layers.delete(node1);
|
|
115
|
-
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
116
|
-
$5cb92bef7577960e$var$dispatchUpdate();
|
|
117
|
-
};
|
|
118
|
-
}, [
|
|
119
|
-
node1,
|
|
120
|
-
context
|
|
121
|
-
]);
|
|
122
|
-
React.useEffect(()=>{
|
|
123
|
-
const handleUpdate = ()=>force({})
|
|
124
|
-
;
|
|
125
|
-
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
126
|
-
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
127
|
-
;
|
|
128
|
-
}, []);
|
|
129
|
-
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({}, layerProps, {
|
|
130
|
-
ref: composedRefs,
|
|
131
|
-
style: {
|
|
132
|
-
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
133
|
-
...props.style
|
|
134
|
-
},
|
|
135
|
-
onFocusCapture: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
136
|
-
onBlurCapture: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
137
|
-
onPointerDownCapture: index.$e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
138
|
-
}));
|
|
139
|
-
});
|
|
140
|
-
const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
141
|
-
const context = React.useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
142
|
-
const ref = React.useRef(null);
|
|
143
|
-
const composedRefs = index.$6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
144
|
-
React.useEffect(()=>{
|
|
145
|
-
const node = ref.current;
|
|
146
|
-
if (node) {
|
|
147
|
-
context.branches.add(node);
|
|
148
|
-
return ()=>{
|
|
149
|
-
context.branches.delete(node);
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
}, [
|
|
153
|
-
context.branches
|
|
154
|
-
]);
|
|
155
|
-
return /*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({}, props, {
|
|
156
|
-
ref: composedRefs
|
|
157
|
-
}));
|
|
158
|
-
});
|
|
159
|
-
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
160
|
-
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
161
|
-
* to mimic layer dismissing behaviour present in OS.
|
|
162
|
-
* Returns props to pass to the node we want to check for outside events.
|
|
163
|
-
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
164
|
-
const handlePointerDownOutside = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
165
|
-
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
166
|
-
const handleClickRef = React.useRef(()=>{});
|
|
167
|
-
React.useEffect(()=>{
|
|
168
|
-
const handlePointerDown = (event)=>{
|
|
169
|
-
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
170
|
-
const eventDetail = {
|
|
171
|
-
originalEvent: event
|
|
172
|
-
};
|
|
173
|
-
function handleAndDispatchPointerDownOutsideEvent() {
|
|
174
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
175
|
-
discrete: true
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* On touch devices, we need to wait for a click event because browsers implement
|
|
180
|
-
* a ~350ms delay between the time the user stops touching the display and when the
|
|
181
|
-
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
182
|
-
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
183
|
-
*
|
|
184
|
-
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
185
|
-
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
186
|
-
*
|
|
187
|
-
* This is why we also continuously remove the previous listener, because we cannot be
|
|
188
|
-
* certain that it was raised, and therefore cleaned-up.
|
|
189
|
-
*/ if (event.pointerType === 'touch') {
|
|
190
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
191
|
-
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
192
|
-
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
193
|
-
once: true
|
|
194
|
-
});
|
|
195
|
-
} else handleAndDispatchPointerDownOutsideEvent();
|
|
196
|
-
}
|
|
197
|
-
isPointerInsideReactTreeRef.current = false;
|
|
198
|
-
};
|
|
199
|
-
/**
|
|
200
|
-
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
201
|
-
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
202
|
-
* this by delaying the event listener registration on the document.
|
|
203
|
-
* This is not React specific, but rather how the DOM works, ie:
|
|
204
|
-
* ```
|
|
205
|
-
* button.addEventListener('pointerdown', () => {
|
|
206
|
-
* console.log('I will log');
|
|
207
|
-
* document.addEventListener('pointerdown', () => {
|
|
208
|
-
* console.log('I will also log');
|
|
209
|
-
* })
|
|
210
|
-
* });
|
|
211
|
-
*/ const timerId = window.setTimeout(()=>{
|
|
212
|
-
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
213
|
-
}, 0);
|
|
214
|
-
return ()=>{
|
|
215
|
-
window.clearTimeout(timerId);
|
|
216
|
-
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
217
|
-
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
218
|
-
};
|
|
219
|
-
}, [
|
|
220
|
-
ownerDocument,
|
|
221
|
-
handlePointerDownOutside
|
|
222
|
-
]);
|
|
223
|
-
return {
|
|
224
|
-
// ensures we check React component tree (not just DOM tree)
|
|
225
|
-
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* Listens for when focus happens outside a react subtree.
|
|
230
|
-
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
231
|
-
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
232
|
-
const handleFocusOutside = index.$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
233
|
-
const isFocusInsideReactTreeRef = React.useRef(false);
|
|
234
|
-
React.useEffect(()=>{
|
|
235
|
-
const handleFocus = (event)=>{
|
|
236
|
-
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
237
|
-
const eventDetail = {
|
|
238
|
-
originalEvent: event
|
|
239
|
-
};
|
|
240
|
-
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
241
|
-
discrete: false
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
};
|
|
245
|
-
ownerDocument.addEventListener('focusin', handleFocus);
|
|
246
|
-
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
247
|
-
;
|
|
248
|
-
}, [
|
|
249
|
-
ownerDocument,
|
|
250
|
-
handleFocusOutside
|
|
251
|
-
]);
|
|
252
|
-
return {
|
|
253
|
-
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
254
|
-
,
|
|
255
|
-
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
259
|
-
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
260
|
-
document.dispatchEvent(event);
|
|
261
|
-
}
|
|
262
|
-
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
263
|
-
const target = detail.originalEvent.target;
|
|
264
|
-
const event = new CustomEvent(name, {
|
|
265
|
-
bubbles: false,
|
|
266
|
-
cancelable: true,
|
|
267
|
-
detail: detail
|
|
268
|
-
});
|
|
269
|
-
if (handler) target.addEventListener(name, handler, {
|
|
270
|
-
once: true
|
|
271
|
-
});
|
|
272
|
-
if (discrete) index.$8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
273
|
-
else target.dispatchEvent(event);
|
|
274
|
-
}
|
|
275
|
-
const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = $5cb92bef7577960e$export$177fb62ff3ec1f22;
|
|
276
|
-
const $5cb92bef7577960e$export$aecb2ddcb55c95be = $5cb92bef7577960e$export$4d5eb2109db14228;
|
|
277
|
-
|
|
278
|
-
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ React.forwardRef((props, forwardedRef)=>{
|
|
279
|
-
var _globalThis$document;
|
|
280
|
-
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
281
|
-
return container ? /*#__PURE__*/ $7SXl2$reactdom__default["default"].createPortal(/*#__PURE__*/ React.createElement(index.$8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends._extends({}, portalProps, {
|
|
282
|
-
ref: forwardedRef
|
|
283
|
-
})), container) : null;
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
exports.$5cb92bef7577960e$export$177fb62ff3ec1f22 = $5cb92bef7577960e$export$177fb62ff3ec1f22;
|
|
287
|
-
exports.$5cb92bef7577960e$export$aecb2ddcb55c95be = $5cb92bef7577960e$export$aecb2ddcb55c95be;
|
|
288
|
-
exports.$5cb92bef7577960e$export$be92b6f5f03c0fe9 = $5cb92bef7577960e$export$be92b6f5f03c0fe9;
|
|
289
|
-
exports.$f1701beae083dbae$export$602eac185826482c = $f1701beae083dbae$export$602eac185826482c;
|