@arc-ui/components 11.16.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/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 +10 -9
- package/dist/InformationCard/InformationCard.esm.js +8 -7
- 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 +13 -286
- package/dist/Modal/Modal.esm.js +6 -279
- package/dist/RadioGroup/RadioGroup.cjs.js +3 -2
- package/dist/RadioGroup/RadioGroup.esm.js +3 -2
- package/dist/Select/Select.cjs.js +31 -2705
- package/dist/Select/Select.esm.js +13 -2668
- 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 +4 -3
- package/dist/Switch/Switch.esm.js +4 -3
- package/dist/Tabs/Tabs.cjs.js +5 -5
- package/dist/Tabs/Tabs.esm.js +5 -5
- package/dist/TextArea/TextArea.cjs.js +20 -20
- package/dist/TextArea/TextArea.esm.js +20 -20
- package/dist/TextInput/TextInput.cjs.js +3 -2
- package/dist/TextInput/TextInput.esm.js +3 -2
- package/dist/Toast/Toast.cjs.js +6 -7
- package/dist/Toast/Toast.esm.js +6 -7
- package/dist/TypographyCard/TypographyCard.cjs.js +13 -70
- package/dist/TypographyCard/TypographyCard.esm.js +14 -71
- 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-904ad028.js → Checkbox-4d4b432f.js} +1 -1
- package/dist/_shared/cjs/{index-3d69ea00.js → Combination-9974f2e2.js} +662 -145
- package/dist/_shared/cjs/{FormControl-166e0957.js → FormControl-b26ad353.js} +8 -5
- package/dist/_shared/cjs/{RadioGroup-1eddf86f.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-cc77dabb.js → Tabs-34db6bc1.js} +4 -4
- package/dist/_shared/cjs/{TextInput-fd9c756f.js → TextInput-d0370fa8.js} +19 -6
- package/dist/_shared/cjs/{Toast-91e96744.js → Toast-392b1d60.js} +292 -34
- package/dist/_shared/cjs/{index-84e6a68f.js → index-6eb396a3.js} +1 -1
- package/dist/_shared/cjs/{index-6542b467.js → index-74004a9c.js} +1 -1
- package/dist/_shared/cjs/index-77ab5c6a.js +2180 -0
- package/dist/_shared/cjs/{index-d31f2b65.js → index-9f99d686.js} +1 -1
- package/dist/_shared/cjs/{index-1641d0b4.js → index-a31e64a9.js} +1 -1
- package/dist/_shared/cjs/{index-49c72a87.js → index-d38f1bd0.js} +1 -1
- 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-8a5bb9a1.js → Checkbox-720b074d.js} +1 -1
- package/dist/_shared/esm/{index-3e2bc99d.js → Combination-e9f7e64e.js} +643 -132
- package/dist/_shared/esm/{FormControl-9d4ddfec.js → FormControl-f0b8fe91.js} +8 -5
- package/dist/_shared/esm/{RadioGroup-238db88d.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-8719d952.js → Tabs-df9965dd.js} +4 -4
- package/dist/_shared/esm/{TextInput-c1e2a1dd.js → TextInput-abbab56b.js} +19 -6
- package/dist/_shared/esm/{Toast-7cb1e544.js → Toast-5d66e13f.js} +264 -7
- package/dist/_shared/esm/{index-39019a9b.js → index-044da8d0.js} +1 -1
- package/dist/_shared/esm/{index-6b7b075c.js → index-25a5b393.js} +1 -1
- package/dist/_shared/esm/{index-246b4f18.js → index-2cfab9f2.js} +1 -1
- package/dist/_shared/esm/{index-12f3a407.js → index-7b531fa7.js} +68 -68
- package/dist/_shared/esm/index-b84a20c6.js +2155 -0
- package/dist/_shared/esm/{index-db47e95a.js → index-ca72c9d5.js} +1 -1
- package/dist/_shared/esm/{index-936b5179.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 +1135 -791
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1136 -791
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -4
- 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/RadioGroup/RadioGroup.d.ts +1 -1
- 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 +22 -3
- package/dist/types/components/index.d.ts +1 -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/index.d.ts +4 -0
- package/dist/types/styles.d.ts +6 -0
- package/package.json +4 -2
- package/dist/_shared/cjs/BtIconArrowRight.esm-8e8ac316.js +0 -30
- package/dist/_shared/cjs/index-4ecad2dd.js +0 -273
- package/dist/_shared/esm/BtIconArrowRight.esm-267916a4.js +0 -24
- package/dist/_shared/esm/index-d0307140.js +0 -264
- package/dist/types/internal-components/index.d.ts +0 -1
- package/dist/_shared/cjs/{index-56a040f4.js → index-dd1d18ea.js} +66 -66
- package/dist/_shared/cjs/{index.es-26dd8c5d.js → use-media-query-e61881d8.js} +8 -8
- /package/dist/types/{internal-components → private-components}/ConditionalWrapper/ConditionalWrapper.d.ts +0 -0
- /package/dist/types/{internal-components → private-components}/ConditionalWrapper/index.d.ts +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign, f as filterDataAttrs } from './filter-data-attrs-ea8f4ed4.js';
|
|
2
2
|
import { c as classNames } from './index-2e73c2e9.js';
|
|
3
3
|
import React__default, { forwardRef, useContext, useState } from 'react';
|
|
4
|
-
import { u as useAriaDescribedby, F as FormControl } from './FormControl-
|
|
4
|
+
import { u as useAriaDescribedby, F as FormControl } from './FormControl-f0b8fe91.js';
|
|
5
5
|
import { C as Context } from './Surface-0ca6817d.js';
|
|
6
6
|
import { V as VisuallyHidden } from './VisuallyHidden-b9eebf71.js';
|
|
7
|
+
import { I as Icon } from './Icon-abd0d990.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Infer the correct inputMode, pattern and type if specifying a `number` type.
|
|
@@ -37,7 +38,7 @@ var useNumericInput = function (props) {
|
|
|
37
38
|
*/
|
|
38
39
|
var TextInput = forwardRef(function (_a, ref) {
|
|
39
40
|
var _b;
|
|
40
|
-
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, prefix = _a.prefix, suffix = _a.suffix, _l = _a.inputAlignment, inputAlignment = _l === void 0 ? "left" : _l, props = __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", "prefix", "suffix", "inputAlignment"]);
|
|
41
|
+
var _c = _a.defaultValue, defaultValue = _c === void 0 ? "" : _c, errorMessage = _a.errorMessage, helper = _a.helper, hideLabel = _a.hideLabel, 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, placeholder = _a.placeholder, 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, iconButton = _a.iconButton, prefix = _a.prefix, suffix = _a.suffix, _l = _a.inputAlignment, inputAlignment = _l === void 0 ? "left" : _l, width = _a.width, props = __rest(_a, ["defaultValue", "errorMessage", "helper", "hideLabel", "id", "inputMode", "isDisabled", "isReadOnly", "isRequired", "label", "labelSize", "maxLength", "minLength", "name", "onBlur", "onChange", "placeholder", "onClickDisclosure", "pattern", "type", "showPassword", "value", "disclosureTitle", "disclosureText", "inputSize", "iconButton", "prefix", "suffix", "inputAlignment", "width"]);
|
|
41
42
|
var surface = useContext(Context).surface;
|
|
42
43
|
var _m = useState(false), showPasswordToggle = _m[0], setShowPasswordToggle = _m[1];
|
|
43
44
|
var inferredInputProps = useNumericInput({
|
|
@@ -52,8 +53,14 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
52
53
|
helper: helper,
|
|
53
54
|
disclosureText: disclosureText
|
|
54
55
|
}).ariaDescribedby;
|
|
56
|
+
var buttonIconSize = {
|
|
57
|
+
s: 24,
|
|
58
|
+
m: 32,
|
|
59
|
+
l: 40
|
|
60
|
+
};
|
|
55
61
|
return (React__default.createElement("div", __assign({ className: classNames((_b = {
|
|
56
62
|
"arc-TextInput": true,
|
|
63
|
+
"arc-TextInput--withAdditionalControl": showPassword || iconButton,
|
|
57
64
|
"arc-TextInput--alignRight": inputAlignment === "right",
|
|
58
65
|
"arc-TextInput--withPasswordToggle": showPassword,
|
|
59
66
|
"arc-TextInput--isDisabled": isDisabled,
|
|
@@ -64,12 +71,18 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
64
71
|
},
|
|
65
72
|
_b["arc-TextInput--size".concat(inputSize && inputSize.toUpperCase())] = inputSize && inputSize !== "m",
|
|
66
73
|
_b)) }, filterDataAttrs(props)),
|
|
67
|
-
React__default.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
|
|
68
|
-
React__default.createElement("div", { className: "arc-TextInput-inputWrapper" },
|
|
74
|
+
React__default.createElement(FormControl, { errorMessage: errorMessage, helper: helper, htmlFor: id, isDisabled: isDisabled, label: label, hideLabel: hideLabel, labelSize: labelSize, requirementStatus: isRequired ? "required" : "optional", disclosureTitle: disclosureTitle, disclosureText: disclosureText, onClickDisclosure: onClickDisclosure },
|
|
75
|
+
React__default.createElement("div", { className: "arc-TextInput-inputWrapper", style: { width: width } },
|
|
69
76
|
prefix && (React__default.createElement("span", { className: "arc-TextInput-prefix", "aria-hidden": true }, prefix)),
|
|
70
|
-
React__default.createElement("input", __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)),
|
|
77
|
+
React__default.createElement("input", __assign({ placeholder: placeholder, "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)),
|
|
78
|
+
iconButton && !showPassword && (React__default.createElement("div", { className: "arc-TextInput-additionalControl" },
|
|
79
|
+
React__default.createElement("button", { ref: iconButton.ref, className: "arc-TextInput-iconButton", disabled: isReadOnly || isDisabled, "aria-label": iconButton.label, onFocus: iconButton.onFocus, onClick: function (e) {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
iconButton.onClick();
|
|
82
|
+
} },
|
|
83
|
+
React__default.createElement(Icon, { icon: iconButton.icon, size: buttonIconSize[inputSize] })))),
|
|
71
84
|
suffix && !showPassword ? (React__default.createElement("span", { className: "arc-TextInput-suffix", "aria-hidden": true }, suffix)) : null,
|
|
72
|
-
showPassword && (React__default.createElement(
|
|
85
|
+
showPassword && (React__default.createElement("div", { className: "arc-TextInput-additionalControl" },
|
|
73
86
|
React__default.createElement("button", { className: "arc-TextInput-passwordToggle", onClick: function () { return setShowPasswordToggle(function (p) { return !p; }); }, type: "button" }, showPasswordToggle ? "Hide" : "Show"),
|
|
74
87
|
React__default.createElement(VisuallyHidden, null,
|
|
75
88
|
React__default.createElement("div", { "aria-live": "polite" },
|
|
@@ -1,18 +1,275 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign, f as filterDataAttrs } from './filter-data-attrs-ea8f4ed4.js';
|
|
2
|
-
import React__default, { useState,
|
|
2
|
+
import React__default, { forwardRef, useContext, useState, useEffect, createElement, useRef, createContext, useCallback, useMemo, Fragment } from 'react';
|
|
3
3
|
import { _ as _extends } from './extends-8cc61aad.js';
|
|
4
|
-
import { createPortal } from 'react-dom';
|
|
5
|
-
import {
|
|
6
|
-
import { $ as $e02a7d9cb1dc128c$export$c74125a8e3af6bb2 } from './index-
|
|
7
|
-
import {
|
|
8
|
-
import { $ as $921a889cee6df7e8$export$99c2b779aa4e8b8b } from './index-
|
|
9
|
-
import { $ as $ea1ef594cf570d83$export$439d29a4e110a164 } from './index-
|
|
4
|
+
import $7SXl2$reactdom__default, { createPortal } from 'react-dom';
|
|
5
|
+
import { b as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, e as $8927f6f2acc4f386$export$250ffa63cdc0d034, d as $e42e1063c40fb3ef$export$b9ecd428b558ff10, f as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a, g as $8927f6f2acc4f386$export$6d1a0317bde7de7f, $ as $c512c27ab02ef895$export$50c7b4e9d9f19c1, h as $9f79659886946c16$export$e5c5a5f917a5871c, a as $71cd76cc60e0454e$export$6f32135080cb4c3 } from './index-7b531fa7.js';
|
|
6
|
+
import { $ as $e02a7d9cb1dc128c$export$c74125a8e3af6bb2 } from './index-044da8d0.js';
|
|
7
|
+
import { $ as $addc16e1bbe58fd0$export$3a72a57244d6e765 } from './index-2cfab9f2.js';
|
|
8
|
+
import { $ as $921a889cee6df7e8$export$99c2b779aa4e8b8b } from './index-ca72c9d5.js';
|
|
9
|
+
import { $ as $ea1ef594cf570d83$export$439d29a4e110a164 } from './index-25a5b393.js';
|
|
10
10
|
import { c as classNames } from './index-2e73c2e9.js';
|
|
11
11
|
import { B as BtIconCrossAlt2Px } from './BtIconCrossAlt2Px.esm-7165ab1a.js';
|
|
12
12
|
import { B as BtIconNotification, a as BtIconAlertTriangle, b as BtIconTick } from './BtIconTick.esm-e265098f.js';
|
|
13
13
|
import { B as BtIconAlert } from './BtIconAlert.esm-a4608d47.js';
|
|
14
14
|
import { I as Icon } from './Icon-abd0d990.js';
|
|
15
15
|
|
|
16
|
+
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
17
|
+
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
18
|
+
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
19
|
+
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
20
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
|
|
21
|
+
layers: new Set(),
|
|
22
|
+
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
23
|
+
branches: new Set()
|
|
24
|
+
});
|
|
25
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
26
|
+
var _node$ownerDocument;
|
|
27
|
+
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
28
|
+
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
29
|
+
const [node1, setNode] = useState(null);
|
|
30
|
+
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;
|
|
31
|
+
const [, force] = useState({});
|
|
32
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
33
|
+
);
|
|
34
|
+
const layers = Array.from(context.layers);
|
|
35
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
36
|
+
...context.layersWithOutsidePointerEventsDisabled
|
|
37
|
+
].slice(-1); // prettier-ignore
|
|
38
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
39
|
+
const index = node1 ? layers.indexOf(node1) : -1;
|
|
40
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
41
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
42
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
43
|
+
const target = event.target;
|
|
44
|
+
const isPointerDownOnBranch = [
|
|
45
|
+
...context.branches
|
|
46
|
+
].some((branch)=>branch.contains(target)
|
|
47
|
+
);
|
|
48
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
49
|
+
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
50
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
51
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
52
|
+
}, ownerDocument);
|
|
53
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
54
|
+
const target = event.target;
|
|
55
|
+
const isFocusInBranch = [
|
|
56
|
+
...context.branches
|
|
57
|
+
].some((branch)=>branch.contains(target)
|
|
58
|
+
);
|
|
59
|
+
if (isFocusInBranch) return;
|
|
60
|
+
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
61
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
62
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
63
|
+
}, ownerDocument);
|
|
64
|
+
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
65
|
+
const isHighestLayer = index === context.layers.size - 1;
|
|
66
|
+
if (!isHighestLayer) return;
|
|
67
|
+
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
68
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
onDismiss();
|
|
71
|
+
}
|
|
72
|
+
}, ownerDocument);
|
|
73
|
+
useEffect(()=>{
|
|
74
|
+
if (!node1) return;
|
|
75
|
+
if (disableOutsidePointerEvents) {
|
|
76
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
77
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
78
|
+
ownerDocument.body.style.pointerEvents = 'none';
|
|
79
|
+
}
|
|
80
|
+
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
81
|
+
}
|
|
82
|
+
context.layers.add(node1);
|
|
83
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
84
|
+
return ()=>{
|
|
85
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
86
|
+
};
|
|
87
|
+
}, [
|
|
88
|
+
node1,
|
|
89
|
+
ownerDocument,
|
|
90
|
+
disableOutsidePointerEvents,
|
|
91
|
+
context
|
|
92
|
+
]);
|
|
93
|
+
/**
|
|
94
|
+
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
95
|
+
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
96
|
+
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
97
|
+
* We only want them to be removed from context stacks when unmounted.
|
|
98
|
+
*/ useEffect(()=>{
|
|
99
|
+
return ()=>{
|
|
100
|
+
if (!node1) return;
|
|
101
|
+
context.layers.delete(node1);
|
|
102
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
103
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
104
|
+
};
|
|
105
|
+
}, [
|
|
106
|
+
node1,
|
|
107
|
+
context
|
|
108
|
+
]);
|
|
109
|
+
useEffect(()=>{
|
|
110
|
+
const handleUpdate = ()=>force({})
|
|
111
|
+
;
|
|
112
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
113
|
+
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
114
|
+
;
|
|
115
|
+
}, []);
|
|
116
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
117
|
+
ref: composedRefs,
|
|
118
|
+
style: {
|
|
119
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
120
|
+
...props.style
|
|
121
|
+
},
|
|
122
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
123
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
124
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
125
|
+
}));
|
|
126
|
+
});
|
|
127
|
+
const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
128
|
+
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
129
|
+
const ref = useRef(null);
|
|
130
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
131
|
+
useEffect(()=>{
|
|
132
|
+
const node = ref.current;
|
|
133
|
+
if (node) {
|
|
134
|
+
context.branches.add(node);
|
|
135
|
+
return ()=>{
|
|
136
|
+
context.branches.delete(node);
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}, [
|
|
140
|
+
context.branches
|
|
141
|
+
]);
|
|
142
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, props, {
|
|
143
|
+
ref: composedRefs
|
|
144
|
+
}));
|
|
145
|
+
});
|
|
146
|
+
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
147
|
+
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
148
|
+
* to mimic layer dismissing behaviour present in OS.
|
|
149
|
+
* Returns props to pass to the node we want to check for outside events.
|
|
150
|
+
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
151
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
152
|
+
const isPointerInsideReactTreeRef = useRef(false);
|
|
153
|
+
const handleClickRef = useRef(()=>{});
|
|
154
|
+
useEffect(()=>{
|
|
155
|
+
const handlePointerDown = (event)=>{
|
|
156
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
157
|
+
const eventDetail = {
|
|
158
|
+
originalEvent: event
|
|
159
|
+
};
|
|
160
|
+
function handleAndDispatchPointerDownOutsideEvent() {
|
|
161
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
162
|
+
discrete: true
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* On touch devices, we need to wait for a click event because browsers implement
|
|
167
|
+
* a ~350ms delay between the time the user stops touching the display and when the
|
|
168
|
+
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
169
|
+
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
170
|
+
*
|
|
171
|
+
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
172
|
+
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
173
|
+
*
|
|
174
|
+
* This is why we also continuously remove the previous listener, because we cannot be
|
|
175
|
+
* certain that it was raised, and therefore cleaned-up.
|
|
176
|
+
*/ if (event.pointerType === 'touch') {
|
|
177
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
178
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
179
|
+
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
180
|
+
once: true
|
|
181
|
+
});
|
|
182
|
+
} else handleAndDispatchPointerDownOutsideEvent();
|
|
183
|
+
}
|
|
184
|
+
isPointerInsideReactTreeRef.current = false;
|
|
185
|
+
};
|
|
186
|
+
/**
|
|
187
|
+
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
188
|
+
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
189
|
+
* this by delaying the event listener registration on the document.
|
|
190
|
+
* This is not React specific, but rather how the DOM works, ie:
|
|
191
|
+
* ```
|
|
192
|
+
* button.addEventListener('pointerdown', () => {
|
|
193
|
+
* console.log('I will log');
|
|
194
|
+
* document.addEventListener('pointerdown', () => {
|
|
195
|
+
* console.log('I will also log');
|
|
196
|
+
* })
|
|
197
|
+
* });
|
|
198
|
+
*/ const timerId = window.setTimeout(()=>{
|
|
199
|
+
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
200
|
+
}, 0);
|
|
201
|
+
return ()=>{
|
|
202
|
+
window.clearTimeout(timerId);
|
|
203
|
+
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
204
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
205
|
+
};
|
|
206
|
+
}, [
|
|
207
|
+
ownerDocument,
|
|
208
|
+
handlePointerDownOutside
|
|
209
|
+
]);
|
|
210
|
+
return {
|
|
211
|
+
// ensures we check React component tree (not just DOM tree)
|
|
212
|
+
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Listens for when focus happens outside a react subtree.
|
|
217
|
+
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
218
|
+
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
219
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
220
|
+
const isFocusInsideReactTreeRef = useRef(false);
|
|
221
|
+
useEffect(()=>{
|
|
222
|
+
const handleFocus = (event)=>{
|
|
223
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
224
|
+
const eventDetail = {
|
|
225
|
+
originalEvent: event
|
|
226
|
+
};
|
|
227
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
228
|
+
discrete: false
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
ownerDocument.addEventListener('focusin', handleFocus);
|
|
233
|
+
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
234
|
+
;
|
|
235
|
+
}, [
|
|
236
|
+
ownerDocument,
|
|
237
|
+
handleFocusOutside
|
|
238
|
+
]);
|
|
239
|
+
return {
|
|
240
|
+
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
241
|
+
,
|
|
242
|
+
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
246
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
247
|
+
document.dispatchEvent(event);
|
|
248
|
+
}
|
|
249
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
250
|
+
const target = detail.originalEvent.target;
|
|
251
|
+
const event = new CustomEvent(name, {
|
|
252
|
+
bubbles: false,
|
|
253
|
+
cancelable: true,
|
|
254
|
+
detail: detail
|
|
255
|
+
});
|
|
256
|
+
if (handler) target.addEventListener(name, handler, {
|
|
257
|
+
once: true
|
|
258
|
+
});
|
|
259
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
260
|
+
else target.dispatchEvent(event);
|
|
261
|
+
}
|
|
262
|
+
const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = $5cb92bef7577960e$export$177fb62ff3ec1f22;
|
|
263
|
+
const $5cb92bef7577960e$export$aecb2ddcb55c95be = $5cb92bef7577960e$export$4d5eb2109db14228;
|
|
264
|
+
|
|
265
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
266
|
+
var _globalThis$document;
|
|
267
|
+
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;
|
|
268
|
+
return container ? /*#__PURE__*/ $7SXl2$reactdom__default.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
269
|
+
ref: forwardedRef
|
|
270
|
+
})), container) : null;
|
|
271
|
+
});
|
|
272
|
+
|
|
16
273
|
/* -------------------------------------------------------------------------------------------------
|
|
17
274
|
* ToastProvider
|
|
18
275
|
* -----------------------------------------------------------------------------------------------*/ const $054eb8030ebde76e$var$PROVIDER_NAME = 'ToastProvider';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { $ as $c512c27ab02ef895$export$50c7b4e9d9f19c1, b as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, c as $5e63c961fc1ce211$export$8c6ed5c666ac1360 } from './index-7b531fa7.js';
|
|
3
3
|
|
|
4
4
|
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
5
5
|
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as _extends } from './extends-8cc61aad.js';
|
|
2
2
|
import { forwardRef, createElement } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { e as $8927f6f2acc4f386$export$250ffa63cdc0d034 } from './index-7b531fa7.js';
|
|
4
4
|
|
|
5
5
|
const $ea1ef594cf570d83$export$439d29a4e110a164 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
6
6
|
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, createContext, useMemo, createElement, useContext,
|
|
1
|
+
import { useCallback, createContext, useMemo, createElement, useContext, forwardRef, Children, isValidElement, cloneElement, Fragment, useEffect, useRef, useLayoutEffect, useState } from 'react';
|
|
2
2
|
import { _ as _extends } from './extends-8cc61aad.js';
|
|
3
3
|
import { flushSync } from 'react-dom';
|
|
4
4
|
|
|
@@ -129,72 +129,6 @@ function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEven
|
|
|
129
129
|
return createScope1;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
/**
|
|
133
|
-
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
134
|
-
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
135
|
-
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
136
|
-
*
|
|
137
|
-
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
138
|
-
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
142
|
-
* prop or avoid re-executing effects when passed as a dependency
|
|
143
|
-
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
144
|
-
const callbackRef = useRef(callback);
|
|
145
|
-
useEffect(()=>{
|
|
146
|
-
callbackRef.current = callback;
|
|
147
|
-
}); // https://github.com/facebook/react/issues/19240
|
|
148
|
-
return useMemo(()=>(...args)=>{
|
|
149
|
-
var _callbackRef$current;
|
|
150
|
-
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
151
|
-
}
|
|
152
|
-
, []);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
156
|
-
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
157
|
-
defaultProp: defaultProp,
|
|
158
|
-
onChange: onChange
|
|
159
|
-
});
|
|
160
|
-
const isControlled = prop !== undefined;
|
|
161
|
-
const value1 = isControlled ? prop : uncontrolledProp;
|
|
162
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
163
|
-
const setValue = useCallback((nextValue)=>{
|
|
164
|
-
if (isControlled) {
|
|
165
|
-
const setter = nextValue;
|
|
166
|
-
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
167
|
-
if (value !== prop) handleChange(value);
|
|
168
|
-
} else setUncontrolledProp(nextValue);
|
|
169
|
-
}, [
|
|
170
|
-
isControlled,
|
|
171
|
-
prop,
|
|
172
|
-
setUncontrolledProp,
|
|
173
|
-
handleChange
|
|
174
|
-
]);
|
|
175
|
-
return [
|
|
176
|
-
value1,
|
|
177
|
-
setValue
|
|
178
|
-
];
|
|
179
|
-
}
|
|
180
|
-
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
181
|
-
const uncontrolledState = useState(defaultProp);
|
|
182
|
-
const [value] = uncontrolledState;
|
|
183
|
-
const prevValueRef = useRef(value);
|
|
184
|
-
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
185
|
-
useEffect(()=>{
|
|
186
|
-
if (prevValueRef.current !== value) {
|
|
187
|
-
handleChange(value);
|
|
188
|
-
prevValueRef.current = value;
|
|
189
|
-
}
|
|
190
|
-
}, [
|
|
191
|
-
value,
|
|
192
|
-
prevValueRef,
|
|
193
|
-
handleChange
|
|
194
|
-
]);
|
|
195
|
-
return uncontrolledState;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
132
|
/* -------------------------------------------------------------------------------------------------
|
|
199
133
|
* Slot
|
|
200
134
|
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
@@ -352,4 +286,70 @@ const $8927f6f2acc4f386$var$NODES = [
|
|
|
352
286
|
);
|
|
353
287
|
}
|
|
354
288
|
|
|
355
|
-
|
|
289
|
+
/**
|
|
290
|
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
291
|
+
* prop or avoid re-executing effects when passed as a dependency
|
|
292
|
+
*/ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
293
|
+
const callbackRef = useRef(callback);
|
|
294
|
+
useEffect(()=>{
|
|
295
|
+
callbackRef.current = callback;
|
|
296
|
+
}); // https://github.com/facebook/react/issues/19240
|
|
297
|
+
return useMemo(()=>(...args)=>{
|
|
298
|
+
var _callbackRef$current;
|
|
299
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
300
|
+
}
|
|
301
|
+
, []);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
306
|
+
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
307
|
+
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
308
|
+
*
|
|
309
|
+
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
310
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
|
|
311
|
+
|
|
312
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {
|
|
313
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
314
|
+
defaultProp: defaultProp,
|
|
315
|
+
onChange: onChange
|
|
316
|
+
});
|
|
317
|
+
const isControlled = prop !== undefined;
|
|
318
|
+
const value1 = isControlled ? prop : uncontrolledProp;
|
|
319
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
320
|
+
const setValue = useCallback((nextValue)=>{
|
|
321
|
+
if (isControlled) {
|
|
322
|
+
const setter = nextValue;
|
|
323
|
+
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
324
|
+
if (value !== prop) handleChange(value);
|
|
325
|
+
} else setUncontrolledProp(nextValue);
|
|
326
|
+
}, [
|
|
327
|
+
isControlled,
|
|
328
|
+
prop,
|
|
329
|
+
setUncontrolledProp,
|
|
330
|
+
handleChange
|
|
331
|
+
]);
|
|
332
|
+
return [
|
|
333
|
+
value1,
|
|
334
|
+
setValue
|
|
335
|
+
];
|
|
336
|
+
}
|
|
337
|
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {
|
|
338
|
+
const uncontrolledState = useState(defaultProp);
|
|
339
|
+
const [value] = uncontrolledState;
|
|
340
|
+
const prevValueRef = useRef(value);
|
|
341
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
342
|
+
useEffect(()=>{
|
|
343
|
+
if (prevValueRef.current !== value) {
|
|
344
|
+
handleChange(value);
|
|
345
|
+
prevValueRef.current = value;
|
|
346
|
+
}
|
|
347
|
+
}, [
|
|
348
|
+
value,
|
|
349
|
+
prevValueRef,
|
|
350
|
+
handleChange
|
|
351
|
+
]);
|
|
352
|
+
return uncontrolledState;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export { $c512c27ab02ef895$export$50c7b4e9d9f19c1 as $, $71cd76cc60e0454e$export$6f32135080cb4c3 as a, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as b, $5e63c961fc1ce211$export$8c6ed5c666ac1360 as c, $e42e1063c40fb3ef$export$b9ecd428b558ff10 as d, $8927f6f2acc4f386$export$250ffa63cdc0d034 as e, $b1b2314f5f9a1d84$export$25bec8c6f54ee79a as f, $8927f6f2acc4f386$export$6d1a0317bde7de7f as g, $9f79659886946c16$export$e5c5a5f917a5871c as h };
|