@qualtrics/ui-react 2.28.0 → 2.29.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/CHANGELOG.md +11 -0
- package/dist/__shared/cjs/{index-2ad33b44.js → index-c2d2f188.js} +601 -391
- package/dist/__shared/cjs/{index-0c005184.js → index-c9e48360.js} +3 -3
- package/dist/components/Accordion/Accordion2.js +3 -3
- package/dist/components/Button/Button.js +3 -3
- package/dist/components/ButtonGroup/ButtonGroup2.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +54 -10
- package/dist/components/Checkbox/Checkbox2.js +3 -3
- package/dist/components/Checkbox/VisualCheckbox2.js +3 -3
- package/dist/components/ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/Combobox/Combobox2.js +3 -3
- package/dist/components/ConfigPane/ConfigPane2.js +3 -3
- package/dist/components/Divider/Divider2.js +3 -3
- package/dist/components/Dropdown/Dropdown.js +59 -7
- package/dist/components/Dropdown/Dropdown2.js +3 -3
- package/dist/components/FilePicker/FilePicker2.js +3 -3
- package/dist/components/FormField/Caption.js +3 -3
- package/dist/components/FormField/FormField2.js +3 -3
- package/dist/components/FullScreenTakeover/FullScreenTakeover2.js +3 -3
- package/dist/components/IconButton/IconButton2.js +3 -3
- package/dist/components/InlineInput/InlineInput2.js +3 -3
- package/dist/components/Input/Input2.js +3 -3
- package/dist/components/InputGroup/InputGroup2.js +3 -3
- package/dist/components/Label/Label2.js +3 -3
- package/dist/components/Link/Link2.js +3 -3
- package/dist/components/LoadingSpinner/LoadingSpinner2.js +3 -3
- package/dist/components/LogicEditor/LogicEditor2.js +3 -3
- package/dist/components/Modal/Modal2.js +3 -3
- package/dist/components/NewMenu/NewMenu.js +3 -3
- package/dist/components/NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/PageLayout/PageLayout.js +3 -3
- package/dist/components/Pagination/Pagination2.js +3 -3
- package/dist/components/Popover/Popover2.js +3 -3
- package/dist/components/QuickSearch/QuickSearch2.js +3 -3
- package/dist/components/Radio/Radio.js +25 -5
- package/dist/components/Radio/Radio2.js +3 -3
- package/dist/components/Radio/RadioGroup.js +16 -3
- package/dist/components/SearchInput/SearchInput2.js +3 -3
- package/dist/components/SidebarNav/SidebarNav2.js +3 -3
- package/dist/components/Slider/Slider2.js +3 -3
- package/dist/components/Switch/Switch2.js +3 -3
- package/dist/components/Table/Table2.js +3 -3
- package/dist/components/Tabs/Tabs2.js +3 -3
- package/dist/components/Tooltip/Tooltip2.js +3 -3
- package/dist/components/deprecated_ColorPicker/ColorPicker2.js +3 -3
- package/dist/components/deprecated_NumberStepper/NumberStepper2.js +3 -3
- package/dist/components/deprecated_Tabs/Tabs2.js +3 -3
- package/dist/components/deprecated_Toolbar/Toolbar2.js +3 -3
- package/dist/hooks/useOverlay/useOverlay2.js +3 -3
- package/dist/hooks/useScreenReaderAnnouncement/useScreenReaderAnnouncement2.js +3 -3
- package/dist/icons/Icon.js +3 -3
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.es.js +1 -1
- package/dist/index.js +3 -3
- package/dist/next/AdvancedTable/AdvancedTable.js +54 -78
- package/dist/next/AdvancedTable/AdvancedTable2.js +3 -3
- package/dist/next/CollapsibleSearchInput/CollapsibleSearchInput2.js +3 -3
- package/dist/next/Combobox/Combobox2.js +3 -3
- package/dist/next/Drawer/Drawer2.js +3 -3
- package/dist/next/FilterAnchor/FilterAnchor2.js +3 -3
- package/dist/next/Form/FormFields/FormFieldWrapper.js +36 -0
- package/dist/next/Form/FormFields/InputField.js +8 -0
- package/dist/next/Form/index.js +2 -0
- package/dist/next/Form/useForm.js +298 -0
- package/dist/next/Form/useFormField.js +25 -0
- package/dist/next/Form/utils/createFormInstance.js +32 -0
- package/dist/next/Form/utils/useFormContext.js +9 -0
- package/dist/next/Input/Input.js +47 -7
- package/dist/next/Input/Input2.js +3 -3
- package/dist/next/Menu/Menu2.js +3 -3
- package/dist/next/Menu/MenuPane.js +2 -2
- package/dist/next/Pagination/Pagination.css.js +9 -0
- package/dist/next/Pagination/Pagination.css.ts.vanilla.js +8 -0
- package/dist/next/Pagination/Pagination.js +166 -0
- package/dist/next/Pagination/RowDisplayCount.js +46 -0
- package/dist/next/Pagination/index.js +2 -0
- package/dist/next/PhoneNumberInput/PhoneNumberInput2.js +3 -3
- package/dist/next/Select/Select2.js +3 -3
- package/dist/next/SplitButton/SplitButton2.js +3 -3
- package/dist/next/TimePicker/TimePicker2.js +3 -3
- package/dist/next/ToggleButton/ToggleButton.js +2 -2
- package/dist/next/ToggleButton/styles.js +3 -3
- package/dist/next/index.d.ts +168 -2
- package/dist/next/index.es.js +29 -23
- package/dist/next/index.js +1962 -1474
- package/dist/utils/Flyout/Flyout2.js +3 -3
- package/icons/package.json +1 -1
- package/next/package.json +2 -2
- package/package.json +2 -2
|
@@ -37,9 +37,9 @@ function styleInject(css, ref) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
var css_248z = ".
|
|
41
|
-
var styles = {"icon":"
|
|
42
|
-
var stylesheet=".
|
|
40
|
+
var css_248z = "._H2Y6u{flex-shrink:0}";
|
|
41
|
+
var styles = {"icon":"_H2Y6u"};
|
|
42
|
+
var stylesheet="._H2Y6u{flex-shrink:0}";
|
|
43
43
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
44
44
|
|
|
45
45
|
const IconSizes = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var AccordionStyles = {"accordion":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._IlCAN{width:100%;display:flex;flex-direction:column}._IlCAN._aH32U{grid-gap:20px;gap:20px}._R-G3w{display:flex;width:100%;border:none;outline:none;background-color:transparent;color:#32363a;font-size:14px;font-weight:700;line-height:18px;text-align:left;padding:10px 16px 10px 0;cursor:pointer}._R-G3w ._32D3C{margin-top:-3px}._kz0tG{flex:1}._TqcBi{padding:8px 16px 16px 24px;font-size:14px;line-height:20px}._utYgf ._R-G3w{border-radius:4px}._utYgf ._R-G3w:hover:not(._LUXRg){background-color:rgba(50,54,58,.08)}._utYgf ._R-G3w:active:not(._LUXRg){background-color:rgba(50,54,58,.11)}._jOoSU ._R-G3w{font-weight:400;padding-left:12px;border-top:1px solid #eee}._jOoSU ._R-G3w:hover:not(._LUXRg){background-color:rgba(50,54,58,.08)}._jOoSU ._R-G3w:active:not(._LUXRg){background-color:rgba(50,54,58,.11)}._aH32U ._IYD0v{border-radius:6px;box-shadow:0 3px 4px rgba(0,0,0,.05),0 6px 10px rgba(0,0,0,.05)}._aH32U ._IYD0v._tYGw8{box-shadow:none}._aH32U ._IYD0v._tYGw8 ._R-G3w{border-radius:6px}._aH32U ._R-G3w{border:1px solid #e5e5e5;border-radius:6px 6px 0 0;font-weight:400;padding:22px 20px}._aH32U ._R-G3w ._kz0tG{padding-left:20px}._aH32U ._R-G3w:hover:not(disabled){border:1px solid #c2c2c2}._aH32U ._R-G3w:active:not(._LUXRg){border:1px solid #898989}._aH32U ._TqcBi{padding:24px 20px;color:#6a6d70;border:1px solid #e5e5e5;border-top:none;border-radius:0 0 6px 6px}._tYGw8 ._TqcBi{display:none}._LUXRg{fill:rgba(81,85,89,.6);background-color:hsla(0,0%,100%,.6);color:rgba(50,54,58,.6);cursor:default}._R-G3w.focus-visible,._R-G3w:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;position:relative}._R-G3w.focus-visible:before,._R-G3w:focus-visible:before{z-index:1}._jOoSU ._R-G3w.focus-visible,._jOoSU ._R-G3w:focus-visible{border-color:transparent}";
|
|
4
|
+
var AccordionStyles = {"accordion":"_IlCAN","block-variant":"_aH32U","header":"_R-G3w","headerIcon":"_32D3C","title":"_kz0tG","panel":"_TqcBi","default-variant":"_utYgf","disabled":"_LUXRg","outlined-variant":"_jOoSU","section":"_IYD0v","closed":"_tYGw8"};
|
|
5
|
+
var stylesheet="._IlCAN{width:100%;display:flex;flex-direction:column}._IlCAN._aH32U{grid-gap:20px;gap:20px}._R-G3w{display:flex;width:100%;border:none;outline:none;background-color:transparent;color:#32363a;font-size:14px;font-weight:700;line-height:18px;text-align:left;padding:10px 16px 10px 0;cursor:pointer}._R-G3w ._32D3C{margin-top:-3px}._kz0tG{flex:1}._TqcBi{padding:8px 16px 16px 24px;font-size:14px;line-height:20px}._utYgf ._R-G3w{border-radius:4px}._utYgf ._R-G3w:hover:not(._LUXRg){background-color:rgba(50,54,58,.08)}._utYgf ._R-G3w:active:not(._LUXRg){background-color:rgba(50,54,58,.11)}._jOoSU ._R-G3w{font-weight:400;padding-left:12px;border-top:1px solid #eee}._jOoSU ._R-G3w:hover:not(._LUXRg){background-color:rgba(50,54,58,.08)}._jOoSU ._R-G3w:active:not(._LUXRg){background-color:rgba(50,54,58,.11)}._aH32U ._IYD0v{border-radius:6px;box-shadow:0 3px 4px rgba(0,0,0,.05),0 6px 10px rgba(0,0,0,.05)}._aH32U ._IYD0v._tYGw8{box-shadow:none}._aH32U ._IYD0v._tYGw8 ._R-G3w{border-radius:6px}._aH32U ._R-G3w{border:1px solid #e5e5e5;border-radius:6px 6px 0 0;font-weight:400;padding:22px 20px}._aH32U ._R-G3w ._kz0tG{padding-left:20px}._aH32U ._R-G3w:hover:not(disabled){border:1px solid #c2c2c2}._aH32U ._R-G3w:active:not(._LUXRg){border:1px solid #898989}._aH32U ._TqcBi{padding:24px 20px;color:#6a6d70;border:1px solid #e5e5e5;border-top:none;border-radius:0 0 6px 6px}._tYGw8 ._TqcBi{display:none}._LUXRg{fill:rgba(81,85,89,.6);background-color:hsla(0,0%,100%,.6);color:rgba(50,54,58,.6);cursor:default}._R-G3w.focus-visible,._R-G3w:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;position:relative}._R-G3w.focus-visible:before,._R-G3w:focus-visible:before{z-index:1}._jOoSU ._R-G3w.focus-visible,._jOoSU ._R-G3w:focus-visible{border-color:transparent}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { AccordionStyles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var buttonStyles = {"btn":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._FTHsZ{padding:0 16px;font-size:14px;line-height:14px;color:#fff;fill:#fff;background-color:#fff;border:1px solid #fff;border-radius:4px;height:36px;min-height:36px;cursor:pointer;position:relative;display:inline-flex;justify-content:center;align-items:center;text-decoration:none;overflow:hidden;transition:border .2s,background .2s,color .2s}._FTHsZ._4QMFo{padding:0 8px;height:26px;min-height:26px}._FTHsZ._lDNex{display:block;width:100%}._FTHsZ._rxEvI{cursor:not-allowed}._FTHsZ:active:focus,._FTHsZ:focus{outline:none}._FTHsZ._fyzTs{background-color:#fff;border-color:#515559;color:#515559;fill:#515559}._FTHsZ._fyzTs:hover:not(._rxEvI){background-color:#eee}._FTHsZ._fyzTs:active:not(._rxEvI){background-color:#e5e5e5}._FTHsZ._fyzTs._rxEvI{color:rgba(81,85,89,.4);fill:rgba(81,85,89,.4);background-color:hsla(0,0%,100%,.4);border:1px solid rgba(81,85,89,.4)}._FTHsZ._OxTS1{background-color:#0b6ed0;border-color:#0b6ed0;color:#fff;fill:#fff}._FTHsZ._OxTS1:hover:not(._rxEvI){background-color:#085caf;border-color:#085caf}._FTHsZ._OxTS1:active:not(._rxEvI){background-color:#0854a1;border-color:#0854a1}._FTHsZ._OxTS1._rxEvI{background-color:rgba(11,110,208,.4);border-color:transparent;fill:hsla(0,0%,100%,.4)}._FTHsZ._8B-wv{background-color:#fff;border-color:#0b6ed0;color:#0b6ed0;fill:#0b6ed0}._FTHsZ._8B-wv:hover:not(._rxEvI){background-color:#eef5fc}._FTHsZ._8B-wv:active:not(._rxEvI){background-color:#e1edf9}._FTHsZ._8B-wv._rxEvI{background-color:hsla(0,0%,100%,.4);border-color:rgba(11,110,208,.4);color:rgba(11,110,208,.4);fill:rgba(11,110,208,.4)}._FTHsZ._f6Yz8{background-color:#fff;border-color:#fff;color:#0b6ed0;fill:#0b6ed0}._FTHsZ._f6Yz8:hover:not(._rxEvI){background-color:#eef5fc;border-color:#eef5fc}._FTHsZ._f6Yz8:active:not(._rxEvI){background-color:#e1edf9;border-color:#e1edf9}._FTHsZ._f6Yz8._rxEvI{background-color:hsla(0,0%,100%,.4);border-color:hsla(0,0%,100%,.4);color:rgba(11,110,208,.4);fill:rgba(11,110,208,.4)}._FTHsZ._xhe-x{color:#0b6ed0;fill:#0b6ed0;padding:0}._FTHsZ._xhe-x:hover:not(._rxEvI){color:#085caf}._FTHsZ._xhe-x:active:not(._rxEvI){color:#0854a1}._FTHsZ._xhe-x._rxEvI{color:rgba(11,110,208,.4);fill:rgba(11,110,208,.4)}._FTHsZ._QhmLS{background-color:#fff;border-color:#b00;color:#b00;fill:#b00}._FTHsZ._QhmLS:hover:not(._rxEvI){background-color:#ffecec}._FTHsZ._QhmLS:active:not(._rxEvI){background-color:#ffdbdb}._FTHsZ._QhmLS._rxEvI{background-color:hsla(0,0%,100%,.4);border-color:rgba(187,0,0,.4);color:rgba(187,0,0,.4);fill:rgba(187,0,0,.4)}._FTHsZ.focus-visible,._FTHsZ:focus-visible{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var buttonStyles = {"btn":"_FTHsZ","small":"_4QMFo","full":"_lDNex","disabled":"_rxEvI","default":"_fyzTs","primary":"_OxTS1","secondary":"_8B-wv","tertiary":"_f6Yz8","link":"_xhe-x","danger":"_QhmLS"};
|
|
5
|
+
var stylesheet="._FTHsZ{padding:0 16px;font-size:14px;line-height:14px;color:#fff;fill:#fff;background-color:#fff;border:1px solid #fff;border-radius:4px;height:36px;min-height:36px;cursor:pointer;position:relative;display:inline-flex;justify-content:center;align-items:center;text-decoration:none;overflow:hidden;transition:border .2s,background .2s,color .2s}._FTHsZ._4QMFo{padding:0 8px;height:26px;min-height:26px}._FTHsZ._lDNex{display:block;width:100%}._FTHsZ._rxEvI{cursor:not-allowed}._FTHsZ:active:focus,._FTHsZ:focus{outline:none}._FTHsZ._fyzTs{background-color:#fff;border-color:#515559;color:#515559;fill:#515559}._FTHsZ._fyzTs:hover:not(._rxEvI){background-color:#eee}._FTHsZ._fyzTs:active:not(._rxEvI){background-color:#e5e5e5}._FTHsZ._fyzTs._rxEvI{color:rgba(81,85,89,.4);fill:rgba(81,85,89,.4);background-color:hsla(0,0%,100%,.4);border:1px solid rgba(81,85,89,.4)}._FTHsZ._OxTS1{background-color:#0b6ed0;border-color:#0b6ed0;color:#fff;fill:#fff}._FTHsZ._OxTS1:hover:not(._rxEvI){background-color:#085caf;border-color:#085caf}._FTHsZ._OxTS1:active:not(._rxEvI){background-color:#0854a1;border-color:#0854a1}._FTHsZ._OxTS1._rxEvI{background-color:rgba(11,110,208,.4);border-color:transparent;fill:hsla(0,0%,100%,.4)}._FTHsZ._8B-wv{background-color:#fff;border-color:#0b6ed0;color:#0b6ed0;fill:#0b6ed0}._FTHsZ._8B-wv:hover:not(._rxEvI){background-color:#eef5fc}._FTHsZ._8B-wv:active:not(._rxEvI){background-color:#e1edf9}._FTHsZ._8B-wv._rxEvI{background-color:hsla(0,0%,100%,.4);border-color:rgba(11,110,208,.4);color:rgba(11,110,208,.4);fill:rgba(11,110,208,.4)}._FTHsZ._f6Yz8{background-color:#fff;border-color:#fff;color:#0b6ed0;fill:#0b6ed0}._FTHsZ._f6Yz8:hover:not(._rxEvI){background-color:#eef5fc;border-color:#eef5fc}._FTHsZ._f6Yz8:active:not(._rxEvI){background-color:#e1edf9;border-color:#e1edf9}._FTHsZ._f6Yz8._rxEvI{background-color:hsla(0,0%,100%,.4);border-color:hsla(0,0%,100%,.4);color:rgba(11,110,208,.4);fill:rgba(11,110,208,.4)}._FTHsZ._xhe-x{color:#0b6ed0;fill:#0b6ed0;padding:0}._FTHsZ._xhe-x:hover:not(._rxEvI){color:#085caf}._FTHsZ._xhe-x:active:not(._rxEvI){color:#0854a1}._FTHsZ._xhe-x._rxEvI{color:rgba(11,110,208,.4);fill:rgba(11,110,208,.4)}._FTHsZ._QhmLS{background-color:#fff;border-color:#b00;color:#b00;fill:#b00}._FTHsZ._QhmLS:hover:not(._rxEvI){background-color:#ffecec}._FTHsZ._QhmLS:active:not(._rxEvI){background-color:#ffdbdb}._FTHsZ._QhmLS._rxEvI{background-color:hsla(0,0%,100%,.4);border-color:rgba(187,0,0,.4);color:rgba(187,0,0,.4);fill:rgba(187,0,0,.4)}._FTHsZ.focus-visible,._FTHsZ:focus-visible{outline:none;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { buttonStyles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"buttonGroup":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._FrmeP{display:inline-flex;align-items:stretch}._FrmeP._yxSwI{width:100%}._FrmeP ._RdNDV{margin:0;min-width:0}._FrmeP ._RdNDV:focus{z-index:20}._FrmeP ._RdNDV:hover{z-index:10}._FrmeP ._RdNDV._f-o3w{border:none}._FrmeP ._RdNDV._yxSwI{display:inline-flex;width:auto;flex-grow:1}._FrmeP ._RdNDV:first-child{margin:0 -1px 0 0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0}._FrmeP ._RdNDV:first-child._f-o3w{border-right:1px solid #fff}._FrmeP ._RdNDV:not(:last-child):not(:first-child){margin:0 -1px 0 0;border-radius:0}._FrmeP ._RdNDV:not(:last-child):not(:first-child)._f-o3w{border-left:1px solid #fff;border-right:1px solid #fff}._FrmeP ._RdNDV:last-child{margin:0;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}._FrmeP ._RdNDV:last-child._f-o3w{border-left:1px solid #fff}._FrmeP ._RdNDV:only-child{margin:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px}";
|
|
4
|
+
var styles = {"buttonGroup":"_FrmeP","full":"_yxSwI","buttonGroupElement":"_RdNDV","primary":"_f-o3w"};
|
|
5
|
+
var stylesheet="._FrmeP{display:inline-flex;align-items:stretch}._FrmeP._yxSwI{width:100%}._FrmeP ._RdNDV{margin:0;min-width:0}._FrmeP ._RdNDV:focus{z-index:20}._FrmeP ._RdNDV:hover{z-index:10}._FrmeP ._RdNDV._f-o3w{border:none}._FrmeP ._RdNDV._yxSwI{display:inline-flex;width:auto;flex-grow:1}._FrmeP ._RdNDV:first-child{margin:0 -1px 0 0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:0;border-bottom-right-radius:0}._FrmeP ._RdNDV:first-child._f-o3w{border-right:1px solid #fff}._FrmeP ._RdNDV:not(:last-child):not(:first-child){margin:0 -1px 0 0;border-radius:0}._FrmeP ._RdNDV:not(:last-child):not(:first-child)._f-o3w{border-left:1px solid #fff;border-right:1px solid #fff}._FrmeP ._RdNDV:last-child{margin:0;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}._FrmeP ._RdNDV:last-child._f-o3w{border-left:1px solid #fff}._FrmeP ._RdNDV:only-child{margin:0;border-top-left-radius:4px;border-bottom-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -3,52 +3,96 @@ import React__default from 'react';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import styles from './Checkbox2.js';
|
|
5
5
|
import Check from './Check.js';
|
|
6
|
+
import Label from '../Label/Label.js';
|
|
6
7
|
import { useFormFieldContext } from '../FormField/FormFieldContext.js';
|
|
7
8
|
import '../../utils/index.js';
|
|
9
|
+
import '../../utils/mergeRefs/index.js';
|
|
10
|
+
import '../../hooks/useId/index.js';
|
|
11
|
+
import FormFieldWrapper from '../../next/Form/FormFields/FormFieldWrapper.js';
|
|
12
|
+
import useFormField from '../../next/Form/useFormField.js';
|
|
13
|
+
import useId from '../../hooks/useId/useId.js';
|
|
8
14
|
import concatIds from '../../utils/concatIds/concatIds.js';
|
|
15
|
+
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
9
16
|
|
|
10
17
|
const Checkbox = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
18
|
+
var _ref2, _ref3, _ref4;
|
|
11
19
|
let {
|
|
12
20
|
id,
|
|
13
21
|
className,
|
|
14
22
|
checked,
|
|
15
23
|
defaultChecked,
|
|
16
24
|
disabled = false,
|
|
17
|
-
onChange,
|
|
25
|
+
onChange: externalOnChange,
|
|
18
26
|
value,
|
|
19
27
|
name,
|
|
28
|
+
label,
|
|
29
|
+
errorText,
|
|
30
|
+
helperText,
|
|
20
31
|
inputProps,
|
|
21
32
|
'aria-label': externalAriaLabel,
|
|
22
33
|
'aria-labelledby': externalAriaLabelledBy,
|
|
23
34
|
'aria-describedby': externalAriaDescribedBy,
|
|
35
|
+
'data-testid': dataTestId,
|
|
24
36
|
...rest
|
|
25
37
|
} = _ref;
|
|
38
|
+
const {
|
|
39
|
+
register,
|
|
40
|
+
fieldErrors
|
|
41
|
+
} = useFormField();
|
|
42
|
+
const inputId = useId(id);
|
|
43
|
+
const registerProps = name && register ? register(name, {
|
|
44
|
+
type: 'checkbox'
|
|
45
|
+
}) : undefined;
|
|
46
|
+
const onChange = e => {
|
|
47
|
+
var _inputProps$onChange;
|
|
48
|
+
registerProps === null || registerProps === void 0 || registerProps.onChange(e);
|
|
49
|
+
externalOnChange === null || externalOnChange === void 0 || externalOnChange(e);
|
|
50
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onChange = inputProps.onChange) === null || _inputProps$onChange === void 0 || _inputProps$onChange.call(inputProps, e);
|
|
51
|
+
};
|
|
52
|
+
const onBlur = e => {
|
|
53
|
+
var _inputProps$onBlur;
|
|
54
|
+
registerProps === null || registerProps === void 0 || registerProps.onBlur(e);
|
|
55
|
+
inputProps === null || inputProps === void 0 || (_inputProps$onBlur = inputProps.onBlur) === null || _inputProps$onBlur === void 0 || _inputProps$onBlur.call(inputProps, e);
|
|
56
|
+
};
|
|
26
57
|
const {
|
|
27
58
|
helperTextId: formFieldHelperTextId,
|
|
28
59
|
errorTextId: formFieldErrorTextId
|
|
29
60
|
} = useFormFieldContext();
|
|
30
61
|
const internalAriaDescribedby = concatIds(externalAriaDescribedBy, formFieldHelperTextId, formFieldErrorTextId, inputProps === null || inputProps === void 0 ? void 0 : inputProps['aria-describedby']);
|
|
31
|
-
return /*#__PURE__*/React__default.createElement(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
62
|
+
return /*#__PURE__*/React__default.createElement(FormFieldWrapper, _extends({
|
|
63
|
+
inputId: inputId,
|
|
64
|
+
"data-testid": dataTestId,
|
|
65
|
+
helperText: helperText,
|
|
66
|
+
errorText: errorText !== null && errorText !== void 0 ? errorText : name && (fieldErrors === null || fieldErrors === void 0 ? void 0 : fieldErrors[name]),
|
|
67
|
+
className: className,
|
|
68
|
+
ref: ref
|
|
69
|
+
}, rest), /*#__PURE__*/React__default.createElement("span", {
|
|
70
|
+
className: styles.checkboxField
|
|
71
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
72
|
+
className: styles.checkbox
|
|
73
|
+
}, /*#__PURE__*/React__default.createElement("input", _extends({}, inputProps, {
|
|
35
74
|
name: name !== null && name !== void 0 ? name : inputProps === null || inputProps === void 0 ? void 0 : inputProps.name,
|
|
36
75
|
className: classNames(styles.input, inputProps === null || inputProps === void 0 ? void 0 : inputProps.className),
|
|
37
76
|
type: "checkbox",
|
|
38
|
-
id: id !== null && id !== void 0 ? id : inputProps === null || inputProps === void 0 ? void 0 : inputProps.id,
|
|
39
|
-
checked: checked !== null && checked !== void 0 ? checked : inputProps === null || inputProps === void 0 ? void 0 : inputProps.checked,
|
|
77
|
+
id: (_ref2 = id !== null && id !== void 0 ? id : inputProps === null || inputProps === void 0 ? void 0 : inputProps.id) !== null && _ref2 !== void 0 ? _ref2 : inputId,
|
|
78
|
+
checked: (_ref3 = checked !== null && checked !== void 0 ? checked : inputProps === null || inputProps === void 0 ? void 0 : inputProps.checked) !== null && _ref3 !== void 0 ? _ref3 : registerProps === null || registerProps === void 0 ? void 0 : registerProps.checked,
|
|
40
79
|
defaultChecked: defaultChecked !== null && defaultChecked !== void 0 ? defaultChecked : inputProps === null || inputProps === void 0 ? void 0 : inputProps.defaultChecked,
|
|
41
80
|
disabled: disabled !== null && disabled !== void 0 ? disabled : inputProps === null || inputProps === void 0 ? void 0 : inputProps.disabled,
|
|
42
|
-
onChange: disabled ? undefined : onChange
|
|
81
|
+
onChange: disabled ? undefined : onChange,
|
|
82
|
+
onBlur: onBlur,
|
|
43
83
|
value: value !== null && value !== void 0 ? value : inputProps === null || inputProps === void 0 ? void 0 : inputProps.value,
|
|
44
84
|
"aria-label": externalAriaLabel !== null && externalAriaLabel !== void 0 ? externalAriaLabel : inputProps === null || inputProps === void 0 ? void 0 : inputProps['aria-label'],
|
|
45
85
|
"aria-labelledby": externalAriaLabelledBy !== null && externalAriaLabelledBy !== void 0 ? externalAriaLabelledBy : inputProps === null || inputProps === void 0 ? void 0 : inputProps['aria-labelledby'],
|
|
46
|
-
"aria-describedby": internalAriaDescribedby
|
|
86
|
+
"aria-describedby": internalAriaDescribedby,
|
|
87
|
+
ref: mergeRefs(registerProps === null || registerProps === void 0 ? void 0 : registerProps.ref, inputProps === null || inputProps === void 0 ? void 0 : inputProps.ref)
|
|
47
88
|
})), /*#__PURE__*/React__default.createElement("span", {
|
|
48
89
|
className: styles.check
|
|
49
90
|
}, /*#__PURE__*/React__default.createElement(Check, {
|
|
50
91
|
className: styles.checkIcon
|
|
51
|
-
})))
|
|
92
|
+
}))), label && /*#__PURE__*/React__default.createElement(Label, {
|
|
93
|
+
htmlFor: (_ref4 = id !== null && id !== void 0 ? id : inputProps === null || inputProps === void 0 ? void 0 : inputProps.id) !== null && _ref4 !== void 0 ? _ref4 : inputId,
|
|
94
|
+
className: styles.checkboxLabel
|
|
95
|
+
}, label)));
|
|
52
96
|
});
|
|
53
97
|
|
|
54
98
|
export { Checkbox as default };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"checkbox":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._ZWiuP{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._zQqJf,._ZWiuP{cursor:pointer;height:16px;width:16px}._zQqJf{position:absolute;opacity:0;z-index:10}._zQqJf:checked~._BD2bu>._NKNqX{fill-opacity:1}._zQqJf:checked:enabled~._BD2bu{border-color:transparent;background-color:#0b6ed0}._zQqJf:checked:enabled~._BD2bu>._NKNqX{fill:#fff}._zQqJf:checked:enabled:hover~._BD2bu{background-color:#085caf}._zQqJf:not(:checked):enabled:hover~._BD2bu{border-color:#0b6ed0}._zQqJf:disabled{cursor:not-allowed}._zQqJf:disabled~._BD2bu{opacity:.4}._gsqFh{color:#32363a;display:flex;align-items:center;cursor:pointer}._XPN4B{cursor:auto;color:hsla(0,0%,53.7%,.4)}._2qX1c{margin-right:12px;flex-shrink:0}._BD2bu{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0}._NKNqX{fill:#0b6ed0;fill-opacity:0}._ZR-Lz{color:#32363a;margin-left:12px}._h0I--{display:flex;align-items:center}._h0I--:has(input:disabled) ._ZR-Lz{color:rgba(50,54,58,.4)}._h0I--:not(:has(input:disabled)) ._ZR-Lz{cursor:pointer}._zQqJf.focus-visible~._BD2bu,._zQqJf:focus-visible~._BD2bu{border-color:#0b6ed0;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"checkbox":"_ZWiuP","input":"_zQqJf","check":"_BD2bu","checkIcon":"_NKNqX","label":"_gsqFh","labelDisabled":"_XPN4B","wrappedInput":"_2qX1c","checkboxLabel":"_ZR-Lz","checkboxField":"_h0I--"};
|
|
5
|
+
var stylesheet="._ZWiuP{display:inline-flex;position:relative;margin-top:6px;margin-bottom:6px}._zQqJf,._ZWiuP{cursor:pointer;height:16px;width:16px}._zQqJf{position:absolute;opacity:0;z-index:10}._zQqJf:checked~._BD2bu>._NKNqX{fill-opacity:1}._zQqJf:checked:enabled~._BD2bu{border-color:transparent;background-color:#0b6ed0}._zQqJf:checked:enabled~._BD2bu>._NKNqX{fill:#fff}._zQqJf:checked:enabled:hover~._BD2bu{background-color:#085caf}._zQqJf:not(:checked):enabled:hover~._BD2bu{border-color:#0b6ed0}._zQqJf:disabled{cursor:not-allowed}._zQqJf:disabled~._BD2bu{opacity:.4}._gsqFh{color:#32363a;display:flex;align-items:center;cursor:pointer}._XPN4B{cursor:auto;color:hsla(0,0%,53.7%,.4)}._2qX1c{margin-right:12px;flex-shrink:0}._BD2bu{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0}._NKNqX{fill:#0b6ed0;fill-opacity:0}._ZR-Lz{color:#32363a;margin-left:12px}._h0I--{display:flex;align-items:center}._h0I--:has(input:disabled) ._ZR-Lz{color:rgba(50,54,58,.4)}._h0I--:not(:has(input:disabled)) ._ZR-Lz{cursor:pointer}._zQqJf.focus-visible~._BD2bu,._zQqJf:focus-visible~._BD2bu{border-color:#0b6ed0;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"checkbox":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._di3vM{display:inline-flex;position:relative}._4-Q9F,._di3vM{cursor:pointer;height:16px;width:16px}._4-Q9F{position:absolute;opacity:0;z-index:10}._4-Q9F._tWw2D~._D0oi6>._3tnkR{fill-opacity:1}._4-Q9F._tWw2D~._D0oi6{border-color:transparent;background-color:#0b6ed0}._4-Q9F._tWw2D~._D0oi6>._3tnkR{fill:#fff}._4-Q9F._tWw2D:hover~._D0oi6{background-color:#085caf}._4-Q9F:not(._tWw2D):hover~._D0oi6{border-color:#0b6ed0}._4-Q9F._2hUHY{cursor:not-allowed}._4-Q9F._2hUHY~._D0oi6{opacity:.4}._D0oi6{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0}._3tnkR{fill:#0b6ed0;fill-opacity:0}";
|
|
4
|
+
var styles = {"checkbox":"_di3vM","input":"_4-Q9F","checked":"_tWw2D","check":"_D0oi6","checkIcon":"_3tnkR","disabled":"_2hUHY"};
|
|
5
|
+
var stylesheet="._di3vM{display:inline-flex;position:relative}._4-Q9F,._di3vM{cursor:pointer;height:16px;width:16px}._4-Q9F{position:absolute;opacity:0;z-index:10}._4-Q9F._tWw2D~._D0oi6>._3tnkR{fill-opacity:1}._4-Q9F._tWw2D~._D0oi6{border-color:transparent;background-color:#0b6ed0}._4-Q9F._tWw2D~._D0oi6>._3tnkR{fill:#fff}._4-Q9F._tWw2D:hover~._D0oi6{background-color:#085caf}._4-Q9F:not(._tWw2D):hover~._D0oi6{border-color:#0b6ed0}._4-Q9F._2hUHY{cursor:not-allowed}._4-Q9F._2hUHY~._D0oi6{opacity:.4}._D0oi6{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;height:16px;width:16px;background-color:#fff;border-radius:4px;border:1px solid #898989;z-index:0}._3tnkR{fill:#0b6ed0;fill-opacity:0}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"colorPicker":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._zAPaO{display:flex;line-height:1.15}._zAPaO ._9jaMv{display:flex;align-items:center;background-color:#fafafa;border:0;border-radius:4px 0 0 4px;padding:0;cursor:pointer;outline:none}._zAPaO ._9jaMv:hover:not(._YBw7x){background-color:#f5f5f5}._zAPaO ._9jaMv._YBw7x{cursor:not-allowed;fill:rgba(81,85,89,.4)}._zAPaO ._9jaMv:active:not(._YBw7x){background-color:#eee}._zAPaO ._-dLLj{width:18px;height:36px;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._zAPaO ._-dLLj._YBw7x{border-color:#d9d9d9}._zAPaO ._GNfcv{position:relative;background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:18px 18px;background-position:0 0,9px 0,9px -9px,0 9px}._zAPaO ._Cbp3o{width:18px;height:36px;border:1px solid #898989;border-width:1px 0}._zAPaO ._Cbp3o._YBw7x{border-color:#d9d9d9}._zAPaO ._CTA-F{height:36px;border:1px solid #898989;border-width:1px 0}._zAPaO ._CTA-F._YBw7x{border-color:#d9d9d9}._zAPaO ._rD9MQ{border-radius:0 4px 4px 0;width:115px;padding-left:21px}._zAPaO ._qAgao{position:absolute;top:10px;left:13px;font-size:14px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._zAPaO ._qAgao._KLJLQ{color:#9d9fa1}._9jaMv.focus-visible,._9jaMv:focus-visible{background:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;z-index:10}._ri4sL{width:264px;padding:8px;background-color:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1);line-height:1.15}._ri4sL ._2-x-P{position:relative;width:246px;height:150px;border-radius:4px;border:1px solid rgba(0,0,0,.43);background:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,transparent);background-origin:border-box}._ri4sL ._Fa0vR{position:absolute;width:12px;height:12px;border-radius:50%;border:1px solid #fff;box-shadow:inset 0 0 0 1px rgba(0,0,0,.5);outline:none;cursor:pointer}._ri4sL ._jPOri{display:flex;justify-content:space-between;margin:12px 0}._ri4sL ._jPOri._UGe8W{margin-bottom:0}._ri4sL ._JleIx{display:flex}._ri4sL ._KPXsg{width:19px;height:38px;border-radius:2px 0 0 2px;border:1px solid rgba(0,0,0,.43);border-right-width:0}._ri4sL ._enXHm{width:19px;height:38px;border-radius:0 2px 2px 0;border:1px solid rgba(0,0,0,.43);border-left-width:0}._ri4sL ._Rgr6d{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:19px 19px;background-position:0 0,9.5px 0,9.5px -9.5px,0 9.5px;border-radius:0 2px 2px 0}._ri4sL ._Srum2{width:202px;height:38px;padding:0 3px;border-radius:1px;border:1px solid rgba(0,0,0,.43);background:linear-gradient(90deg,red,red 2%,#ff0 18%,#0f0 34%,#0ff 50%,#00f 66%,#f0f 82%,red 98%,red)}._ri4sL ._Srum2._ECTpm{height:16px;margin-bottom:6px}._ri4sL ._tCJvD{position:relative;background-color:#fff;border:1px solid rgba(0,0,0,.25);border-radius:1px;background-clip:padding-box;width:8px;height:38px;outline:none;cursor:pointer;top:-1px}._ri4sL ._tCJvD._ECTpm{height:16px}._ri4sL ._mzBKy{position:relative;background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:16px 16px;background-position:0 0,8px 0,8px -8px,0 8px;border-radius:1px}._ri4sL ._RPeY8{width:202px;height:16px;padding:0 3px;border-radius:1px;border:1px solid rgba(0,0,0,.43);background-origin:border-box!important}._ri4sL ._RqtXx{position:relative;background-color:#fff;border:1px solid rgba(0,0,0,.25);border-radius:1px;background-clip:padding-box;width:8px;height:16px;outline:none;cursor:pointer;top:-1px}._ri4sL ._58fi9{display:flex;justify-content:space-between}._ri4sL ._Lkq0o{display:flex;flex-direction:column;align-items:center}._ri4sL ._Lkq0o._SeqVf{margin-left:4px}._ri4sL ._YFRpJ{position:absolute;top:3px;left:5px;font-size:14px;line-height:20px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._ri4sL ._HFCt5{padding:3px 4px 3px 13px!important;width:78px}._ri4sL ._zNYKE{text-align:right;padding:3px 4px 3px 0!important;width:34px}._ri4sL ._uj8td{text-align:right;padding:3px 16px 3px 0!important;width:46px}._ri4sL ._hKenz{position:absolute;top:3px;right:4px;font-size:14px;line-height:20px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._ri4sL ._N8gKE{line-height:22px}._ri4sL ._hd9cb{display:flex}._ri4sL ._E-KvE{display:flex;flex-wrap:wrap;margin:9px -3px -3px}._ri4sL ._E-KvE._3K5YJ{margin-top:0}._ri4sL ._dQygG{width:22px;height:22px;margin:3px;border-radius:4px;border:1px solid rgba(0,0,0,.43);outline:none;cursor:pointer}._mbf73{position:relative}._K3Oti{display:none}._PDPwR{border:0;clip:rect(0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;width:1px;position:absolute}._Fa0vR.focus-visible,._Fa0vR:focus-visible{box-shadow:inset 0 0 0 1px rgba(0,0,0,.5),0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fff}._dQygG.focus-visible,._dQygG:focus-visible,._RqtXx.focus-visible,._RqtXx:focus-visible,._tCJvD.focus-visible,._tCJvD:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
4
|
+
var styles = {"colorPicker":"_zAPaO","colorPickerButton":"_9jaMv","disabledButton":"_YBw7x","colorPickerButtonPreview":"_-dLLj","alphaBackground":"_GNfcv","colorPickerButtonAlphaPreview":"_Cbp3o","caretIcon":"_CTA-F","colorPickerInput":"_rD9MQ","colorPickerInputDecoration":"_qAgao","disabledDecoration":"_KLJLQ","colorPickerFlyout":"_ri4sL","saturationGrid":"_2-x-P","saturationLoop":"_Fa0vR","sliderGroup":"_jPOri","removeBottomMargin":"_UGe8W","sliderPreviewContainer":"_JleIx","sliderPreview":"_KPXsg","sliderPreviewAlpha":"_enXHm","sliderPreviewAlphaBackground":"_Rgr6d","hueSliderRail":"_Srum2","alphaEnabled":"_ECTpm","hueSliderThumb":"_tCJvD","alphaSliderRailBackground":"_mzBKy","alphaSliderRail":"_RPeY8","alphaSliderThumb":"_RqtXx","hexInputGroup":"_58fi9","hexInputContainer":"_Lkq0o","rgbInputContainer":"_SeqVf","hexInputDecoration":"_YFRpJ","hexInput":"_HFCt5","rgbInput":"_zNYKE","alphaInput":"_uj8td","alphaInputDecoration":"_hKenz","inputLabel":"_N8gKE","rgbContainer":"_hd9cb","palette":"_E-KvE","removeUpperMargin":"_3K5YJ","swatch":"_dQygG","relativePositionContainer":"_mbf73","hidden":"_K3Oti","hiddenLiveRegion":"_PDPwR"};
|
|
5
|
+
var stylesheet="._zAPaO{display:flex;line-height:1.15}._zAPaO ._9jaMv{display:flex;align-items:center;background-color:#fafafa;border:0;border-radius:4px 0 0 4px;padding:0;cursor:pointer;outline:none}._zAPaO ._9jaMv:hover:not(._YBw7x){background-color:#f5f5f5}._zAPaO ._9jaMv._YBw7x{cursor:not-allowed;fill:rgba(81,85,89,.4)}._zAPaO ._9jaMv:active:not(._YBw7x){background-color:#eee}._zAPaO ._-dLLj{width:18px;height:36px;border-radius:4px 0 0 4px;border:1px solid #898989;border-right-width:0}._zAPaO ._-dLLj._YBw7x{border-color:#d9d9d9}._zAPaO ._GNfcv{position:relative;background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:18px 18px;background-position:0 0,9px 0,9px -9px,0 9px}._zAPaO ._Cbp3o{width:18px;height:36px;border:1px solid #898989;border-width:1px 0}._zAPaO ._Cbp3o._YBw7x{border-color:#d9d9d9}._zAPaO ._CTA-F{height:36px;border:1px solid #898989;border-width:1px 0}._zAPaO ._CTA-F._YBw7x{border-color:#d9d9d9}._zAPaO ._rD9MQ{border-radius:0 4px 4px 0;width:115px;padding-left:21px}._zAPaO ._qAgao{position:absolute;top:10px;left:13px;font-size:14px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._zAPaO ._qAgao._KLJLQ{color:#9d9fa1}._9jaMv.focus-visible,._9jaMv:focus-visible{background:#fafafa;box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88;z-index:10}._ri4sL{width:264px;padding:8px;background-color:#fff;border:1px solid #eee;border-radius:4px;box-shadow:0 8px 20px rgba(0,0,0,.1);line-height:1.15}._ri4sL ._2-x-P{position:relative;width:246px;height:150px;border-radius:4px;border:1px solid rgba(0,0,0,.43);background:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,transparent);background-origin:border-box}._ri4sL ._Fa0vR{position:absolute;width:12px;height:12px;border-radius:50%;border:1px solid #fff;box-shadow:inset 0 0 0 1px rgba(0,0,0,.5);outline:none;cursor:pointer}._ri4sL ._jPOri{display:flex;justify-content:space-between;margin:12px 0}._ri4sL ._jPOri._UGe8W{margin-bottom:0}._ri4sL ._JleIx{display:flex}._ri4sL ._KPXsg{width:19px;height:38px;border-radius:2px 0 0 2px;border:1px solid rgba(0,0,0,.43);border-right-width:0}._ri4sL ._enXHm{width:19px;height:38px;border-radius:0 2px 2px 0;border:1px solid rgba(0,0,0,.43);border-left-width:0}._ri4sL ._Rgr6d{background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:19px 19px;background-position:0 0,9.5px 0,9.5px -9.5px,0 9.5px;border-radius:0 2px 2px 0}._ri4sL ._Srum2{width:202px;height:38px;padding:0 3px;border-radius:1px;border:1px solid rgba(0,0,0,.43);background:linear-gradient(90deg,red,red 2%,#ff0 18%,#0f0 34%,#0ff 50%,#00f 66%,#f0f 82%,red 98%,red)}._ri4sL ._Srum2._ECTpm{height:16px;margin-bottom:6px}._ri4sL ._tCJvD{position:relative;background-color:#fff;border:1px solid rgba(0,0,0,.25);border-radius:1px;background-clip:padding-box;width:8px;height:38px;outline:none;cursor:pointer;top:-1px}._ri4sL ._tCJvD._ECTpm{height:16px}._ri4sL ._mzBKy{position:relative;background-image:linear-gradient(45deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(135deg,rgba(0,0,0,.1) 25%,transparent 0),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.1) 0),linear-gradient(135deg,transparent 75%,rgba(0,0,0,.1) 0);background-color:#fff;background-size:16px 16px;background-position:0 0,8px 0,8px -8px,0 8px;border-radius:1px}._ri4sL ._RPeY8{width:202px;height:16px;padding:0 3px;border-radius:1px;border:1px solid rgba(0,0,0,.43);background-origin:border-box!important}._ri4sL ._RqtXx{position:relative;background-color:#fff;border:1px solid rgba(0,0,0,.25);border-radius:1px;background-clip:padding-box;width:8px;height:16px;outline:none;cursor:pointer;top:-1px}._ri4sL ._58fi9{display:flex;justify-content:space-between}._ri4sL ._Lkq0o{display:flex;flex-direction:column;align-items:center}._ri4sL ._Lkq0o._SeqVf{margin-left:4px}._ri4sL ._YFRpJ{position:absolute;top:3px;left:5px;font-size:14px;line-height:20px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._ri4sL ._HFCt5{padding:3px 4px 3px 13px!important;width:78px}._ri4sL ._zNYKE{text-align:right;padding:3px 4px 3px 0!important;width:34px}._ri4sL ._uj8td{text-align:right;padding:3px 16px 3px 0!important;width:46px}._ri4sL ._hKenz{position:absolute;top:3px;right:4px;font-size:14px;line-height:20px;color:#32363a;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none}._ri4sL ._N8gKE{line-height:22px}._ri4sL ._hd9cb{display:flex}._ri4sL ._E-KvE{display:flex;flex-wrap:wrap;margin:9px -3px -3px}._ri4sL ._E-KvE._3K5YJ{margin-top:0}._ri4sL ._dQygG{width:22px;height:22px;margin:3px;border-radius:4px;border:1px solid rgba(0,0,0,.43);outline:none;cursor:pointer}._mbf73{position:relative}._K3Oti{display:none}._PDPwR{border:0;clip:rect(0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;width:1px;position:absolute}._Fa0vR.focus-visible,._Fa0vR:focus-visible{box-shadow:inset 0 0 0 1px rgba(0,0,0,.5),0 0 0 2px #fff,0 0 0 4px #0a3f88;background-color:#fff}._dQygG.focus-visible,._dQygG:focus-visible,._RqtXx.focus-visible,._RqtXx:focus-visible,._tCJvD.focus-visible,._tCJvD:focus-visible{box-shadow:0 0 0 2px #fff,0 0 0 4px #0a3f88}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"combobox":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._wh6Pr{position:relative;display:inline-block}._u7y0B{padding-right:36px}._u7y0B._GRJSN{box-shadow:none!important;border:1px solid #898989!important}._iEMqd{margin-top:4px}._YiQMW{position:absolute;right:4px;bottom:4px;height:28px;width:28px;border-radius:4px;fill:#515559;cursor:pointer}._YiQMW:hover{background-color:rgba(50,54,58,.08)}._YiQMW:active{background-color:rgba(50,54,58,.11)}._YiQMW._aCRUz{transform:rotate(-180deg)}._YiQMW._qGsOK{opacity:.4}._Erh9Q{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;background-color:#fff;font-size:14px;color:#32363a;word-break:break-word}._qGsOK{cursor:not-allowed}._qGsOK:hover{background-color:transparent}";
|
|
4
|
+
var styles = {"combobox":"_wh6Pr","comboboxInput":"_u7y0B","ignoreFocusStyle":"_GRJSN","labelledInput":"_iEMqd","comboboxIcon":"_YiQMW","open":"_aCRUz","disabled":"_qGsOK","comboboxEmpty":"_Erh9Q"};
|
|
5
|
+
var stylesheet="._wh6Pr{position:relative;display:inline-block}._u7y0B{padding-right:36px}._u7y0B._GRJSN{box-shadow:none!important;border:1px solid #898989!important}._iEMqd{margin-top:4px}._YiQMW{position:absolute;right:4px;bottom:4px;height:28px;width:28px;border-radius:4px;fill:#515559;cursor:pointer}._YiQMW:hover{background-color:rgba(50,54,58,.08)}._YiQMW:active{background-color:rgba(50,54,58,.11)}._YiQMW._aCRUz{transform:rotate(-180deg)}._YiQMW._qGsOK{opacity:.4}._Erh9Q{min-height:40px;padding:10px 12px;display:flex;flex-direction:row;align-items:center;background-color:#fff;font-size:14px;color:#32363a;word-break:break-word}._qGsOK{cursor:not-allowed}._qGsOK:hover{background-color:transparent}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"paneContainer":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._9LZtk{grid-area:configPane;position:relative;height:100%}._8UbFr{overflow:hidden;height:100%;position:absolute;background-color:#fff;top:0;transition:width .5s;width:292px;border-right:1px solid #898989;box-sizing:border-box}._0NqUx._xoJed ._8UbFr,._0NqUx:not(._Dwisg) ._8UbFr{-webkit-clip-path:inset(0 -20px 0 0);clip-path:inset(0 -20px 0 0);box-shadow:0 8px 20px 0 rgba(0,0,0,.1),0 4px 6px 0 rgba(0,0,0,.05)}._Dwisg ._8UbFr{width:0}._xoJed._Dwisg ._8UbFr{width:30px;cursor:pointer}._GESZ2 ._8UbFr{border-right-color:#eee}._ktImY{height:100%;position:relative;width:292px}._0NqUx ._ktImY,._Dwisg ._ktImY{width:0}._xoJed._0NqUx ._ktImY,._xoJed._Dwisg ._ktImY{width:30px}._AkaRo ._ktImY{transition:width .5s}._m7D9L{position:absolute;width:292px;height:100%;right:0;overflow:auto;padding:12px 0}._Dwisg ._m7D9L{visibility:hidden}._AkaRo ._m7D9L{visibility:visible}._m7D9L ._xeR62{width:252px;margin-left:20px}._hPmGi{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:12px}._6WLnH{flex-grow:1;padding-right:8px;line-height:20px;margin:8px 0}._6WLnH *{font-weight:400;font-size:16px;margin:0}._ZXGAD{position:absolute;transition:left .5s;top:0;left:290px;width:12px;cursor:pointer;height:100%}._Dwisg ._ZXGAD{left:0}._xoJed._Dwisg ._ZXGAD{left:30px}._ZXGAD ._cXKNy{width:4px;height:100%}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._cXKNy,._ZXGAD:hover ._cXKNy{background-color:#9dc5ed}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._DCZsZ>span,._ZXGAD:hover ._DCZsZ>span{background-color:#0b6ed0;border-color:#0b6ed0}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._DCZsZ>span>svg,._ZXGAD:hover ._DCZsZ>span>svg{fill:#fff}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._DCZsZ:active>span,._ZXGAD:hover ._DCZsZ:active>span{background-color:#0854a1;border-color:#0854a1}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._DCZsZ:active>span>svg,._ZXGAD:hover ._DCZsZ:active>span>svg{fill:#fff}._ZXGAD ._DCZsZ{left:-16px;width:36px;height:36px;position:absolute;top:48px;display:flex;justify-content:center;align-items:center;padding:0;background-color:transparent;border:2px solid transparent;border-radius:6px;outline:none;cursor:pointer;z-index:10;opacity:0}._ZXGAD ._DCZsZ._G0QeL._G0QeL._G0QeL{opacity:1}._ZXGAD ._DCZsZ._WRV4D._WRV4D._WRV4D{opacity:0}._ZXGAD ._DCZsZ:active>span{background-color:#0854a1;border-color:#0854a1}._ZXGAD ._DCZsZ:active>span>svg{fill:#fff}._ZXGAD ._DCZsZ>span{width:24px;height:24px;display:flex;justify-content:center;align-items:center;background-color:#fff;border:1px solid #898989;border-radius:50%}._ZXGAD ._DCZsZ>span>svg{fill:#515559;border-radius:50%}._8UbFr:hover+._ZXGAD ._DCZsZ,._Dwisg ._ZXGAD ._DCZsZ,._ZXGAD:hover ._DCZsZ{opacity:1}._DCZsZ.focus-visible,._DCZsZ:focus-visible{opacity:1;border-color:#0a3f88}";
|
|
4
|
+
var styles = {"paneContainer":"_9LZtk","paneContentContainer":"_8UbFr","unpinned":"_0NqUx","hidden":"_Dwisg","preview":"_xoJed","openHidden":"_GESZ2","spacer":"_ktImY","transitioning":"_AkaRo","paneContent":"_m7D9L","paneContentInner":"_xeR62","header":"_hPmGi","title":"_6WLnH","clickableArea":"_ZXGAD","hoverBorder":"_cXKNy","toolbarPanelExpandCollapseButton":"_DCZsZ","overrideShow":"_G0QeL","overrideHide":"_WRV4D"};
|
|
5
|
+
var stylesheet="._9LZtk{grid-area:configPane;position:relative;height:100%}._8UbFr{overflow:hidden;height:100%;position:absolute;background-color:#fff;top:0;transition:width .5s;width:292px;border-right:1px solid #898989;box-sizing:border-box}._0NqUx._xoJed ._8UbFr,._0NqUx:not(._Dwisg) ._8UbFr{-webkit-clip-path:inset(0 -20px 0 0);clip-path:inset(0 -20px 0 0);box-shadow:0 8px 20px 0 rgba(0,0,0,.1),0 4px 6px 0 rgba(0,0,0,.05)}._Dwisg ._8UbFr{width:0}._xoJed._Dwisg ._8UbFr{width:30px;cursor:pointer}._GESZ2 ._8UbFr{border-right-color:#eee}._ktImY{height:100%;position:relative;width:292px}._0NqUx ._ktImY,._Dwisg ._ktImY{width:0}._xoJed._0NqUx ._ktImY,._xoJed._Dwisg ._ktImY{width:30px}._AkaRo ._ktImY{transition:width .5s}._m7D9L{position:absolute;width:292px;height:100%;right:0;overflow:auto;padding:12px 0}._Dwisg ._m7D9L{visibility:hidden}._AkaRo ._m7D9L{visibility:visible}._m7D9L ._xeR62{width:252px;margin-left:20px}._hPmGi{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:12px}._6WLnH{flex-grow:1;padding-right:8px;line-height:20px;margin:8px 0}._6WLnH *{font-weight:400;font-size:16px;margin:0}._ZXGAD{position:absolute;transition:left .5s;top:0;left:290px;width:12px;cursor:pointer;height:100%}._Dwisg ._ZXGAD{left:0}._xoJed._Dwisg ._ZXGAD{left:30px}._ZXGAD ._cXKNy{width:4px;height:100%}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._cXKNy,._ZXGAD:hover ._cXKNy{background-color:#9dc5ed}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._DCZsZ>span,._ZXGAD:hover ._DCZsZ>span{background-color:#0b6ed0;border-color:#0b6ed0}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._DCZsZ>span>svg,._ZXGAD:hover ._DCZsZ>span>svg{fill:#fff}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._DCZsZ:active>span,._ZXGAD:hover ._DCZsZ:active>span{background-color:#0854a1;border-color:#0854a1}._xoJed._Dwisg ._8UbFr:hover+._ZXGAD ._DCZsZ:active>span>svg,._ZXGAD:hover ._DCZsZ:active>span>svg{fill:#fff}._ZXGAD ._DCZsZ{left:-16px;width:36px;height:36px;position:absolute;top:48px;display:flex;justify-content:center;align-items:center;padding:0;background-color:transparent;border:2px solid transparent;border-radius:6px;outline:none;cursor:pointer;z-index:10;opacity:0}._ZXGAD ._DCZsZ._G0QeL._G0QeL._G0QeL{opacity:1}._ZXGAD ._DCZsZ._WRV4D._WRV4D._WRV4D{opacity:0}._ZXGAD ._DCZsZ:active>span{background-color:#0854a1;border-color:#0854a1}._ZXGAD ._DCZsZ:active>span>svg{fill:#fff}._ZXGAD ._DCZsZ>span{width:24px;height:24px;display:flex;justify-content:center;align-items:center;background-color:#fff;border:1px solid #898989;border-radius:50%}._ZXGAD ._DCZsZ>span>svg{fill:#515559;border-radius:50%}._8UbFr:hover+._ZXGAD ._DCZsZ,._Dwisg ._ZXGAD ._DCZsZ,._ZXGAD:hover ._DCZsZ{opacity:1}._DCZsZ.focus-visible,._DCZsZ:focus-visible{opacity:1;border-color:#0a3f88}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styleInject from './../../__node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".
|
|
4
|
-
var styles = {"divider":"
|
|
5
|
-
var stylesheet=".
|
|
3
|
+
var css_248z = "._Qefki{border:none;height:1px;margin:0;flex-shrink:0;background-color:#e5e5e5}";
|
|
4
|
+
var styles = {"divider":"_Qefki"};
|
|
5
|
+
var stylesheet="._Qefki{border:none;height:1px;margin:0;flex-shrink:0;background-color:#e5e5e5}";
|
|
6
6
|
if(typeof process !== 'object' || !process.hasOwnProperty('env') || process.env.NODE_ENV !== 'test'){styleInject(css_248z);}
|
|
7
7
|
|
|
8
8
|
export { styles as default, stylesheet };
|
|
@@ -6,17 +6,23 @@ import { DropdownContextProvider } from './DropdownContext.js';
|
|
|
6
6
|
import DropdownButton from './DropdownButton.js';
|
|
7
7
|
import DropdownList from './DropdownList.js';
|
|
8
8
|
import '../../hooks/index.js';
|
|
9
|
+
import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
|
|
9
10
|
import { ChildIndexProvider } from './ChildIndexContext/index.js';
|
|
11
|
+
import FormFieldWrapper from '../../next/Form/FormFields/FormFieldWrapper.js';
|
|
12
|
+
import useFormField from '../../next/Form/useFormField.js';
|
|
13
|
+
import '../../utils/mergeRefs/index.js';
|
|
10
14
|
import useControllableState from '../../hooks/useControllableState/useControllableState.js';
|
|
11
15
|
import useId from '../../hooks/useId/useId.js';
|
|
12
|
-
import { useDidUpdate } from '../../hooks/useDidUpdate/useDidUpdate.js';
|
|
13
16
|
import useClickOutside from '../../hooks/useClickOutside/useClickOutside.js';
|
|
17
|
+
import mergeRefs from '../../utils/mergeRefs/mergeRefs.js';
|
|
14
18
|
|
|
15
19
|
const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
16
20
|
var _ref2, _dropdownButton$props, _dropdownButton$props2, _dropdownList$props$i, _dropdownList$props;
|
|
17
21
|
let {
|
|
18
22
|
className,
|
|
19
23
|
children,
|
|
24
|
+
label,
|
|
25
|
+
name,
|
|
20
26
|
disabled = false,
|
|
21
27
|
isInvalid = false,
|
|
22
28
|
isOpen: externalIsOpen,
|
|
@@ -28,8 +34,11 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
28
34
|
// TODO: Delete or stabilize since no longer used by AdvancedTable
|
|
29
35
|
defaultValue,
|
|
30
36
|
value: externalValue,
|
|
31
|
-
onChange,
|
|
37
|
+
onChange: externalOnChange,
|
|
38
|
+
onBlur: externalOnBlur,
|
|
32
39
|
id,
|
|
40
|
+
errorText,
|
|
41
|
+
helperText,
|
|
33
42
|
'aria-labelledby': ariaLabelledBy,
|
|
34
43
|
'aria-label': ariaLabel,
|
|
35
44
|
'aria-describedby': ariaDescribedby,
|
|
@@ -40,6 +49,19 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
40
49
|
'data-testid': dataTestId,
|
|
41
50
|
...rest
|
|
42
51
|
} = _ref;
|
|
52
|
+
const {
|
|
53
|
+
register,
|
|
54
|
+
fieldErrors
|
|
55
|
+
} = useFormField();
|
|
56
|
+
|
|
57
|
+
// generate props only if a name is passed and used inside a Form
|
|
58
|
+
const registerProps = name && register ? register(name, {
|
|
59
|
+
type: 'custom'
|
|
60
|
+
}) : undefined;
|
|
61
|
+
const onChange = newValue => {
|
|
62
|
+
externalOnChange === null || externalOnChange === void 0 || externalOnChange(newValue);
|
|
63
|
+
registerProps === null || registerProps === void 0 || registerProps.onChange(newValue);
|
|
64
|
+
};
|
|
43
65
|
const buttonRef = useRef(null);
|
|
44
66
|
const listRef = useRef(null);
|
|
45
67
|
let dropdownButton = /*#__PURE__*/React__default.createElement(DropdownButton, null);
|
|
@@ -65,7 +87,7 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
65
87
|
const dialogId = (_dropdownList$props$i = (_dropdownList$props = dropdownList.props) === null || _dropdownList$props === void 0 ? void 0 : _dropdownList$props.id) !== null && _dropdownList$props$i !== void 0 ? _dropdownList$props$i : "".concat(containerId, "-list");
|
|
66
88
|
const listboxId = "".concat(containerId, "-listbox");
|
|
67
89
|
const [isOpen, setIsOpen] = useControllableState(false, onIsOpenChange, externalIsOpen);
|
|
68
|
-
const [value, setValue] = useControllableState(defaultValue, onChange, externalValue);
|
|
90
|
+
const [value, setValue] = useControllableState(defaultValue, onChange, externalValue !== null && externalValue !== void 0 ? externalValue : registerProps === null || registerProps === void 0 ? void 0 : registerProps.value);
|
|
69
91
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
70
92
|
const [highlightedIndex, setHighlightedIndex] = useControllableState(-1, onHighlightedIndexChange, externalHighlightedIndex);
|
|
71
93
|
const [minWidth, setMinWidth] = useState();
|
|
@@ -75,6 +97,29 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
75
97
|
setSearchValue('');
|
|
76
98
|
}
|
|
77
99
|
}, [isOpen, setSearchValue]);
|
|
100
|
+
|
|
101
|
+
// registerProps.onBlur() marks component touched and runs validation
|
|
102
|
+
// this function is invoked manually to avoid validation timing based only
|
|
103
|
+
// on the blur of the anchor element. This component is marked touched
|
|
104
|
+
// if the anchor is blurred without opening the flyout, or if the flyout
|
|
105
|
+
// is closed without focusing the anchor.
|
|
106
|
+
|
|
107
|
+
const focusRef = useRef();
|
|
108
|
+
const onBlur = e => {
|
|
109
|
+
// Prevents incorrect validation caused by DropdownOptions inheriting this blur event
|
|
110
|
+
// note: relatedTarget in this context refers to where the focus is going after blur
|
|
111
|
+
if (!e.currentTarget.contains(e.relatedTarget)) {
|
|
112
|
+
if (!isOpen) registerProps === null || registerProps === void 0 || registerProps.onBlur(); // marks field touched
|
|
113
|
+
externalOnBlur === null || externalOnBlur === void 0 || externalOnBlur(e);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
useDidUpdate(() => {
|
|
117
|
+
if (!isOpen) {
|
|
118
|
+
var _focusRef$current;
|
|
119
|
+
const isAnchorFocused = (_focusRef$current = focusRef.current) === null || _focusRef$current === void 0 ? void 0 : _focusRef$current.contains(document.activeElement);
|
|
120
|
+
if (!isAnchorFocused) registerProps === null || registerProps === void 0 || registerProps.onBlur(); // marks field touched
|
|
121
|
+
}
|
|
122
|
+
}, [isOpen]);
|
|
78
123
|
const handleClose = useCallback(() => {
|
|
79
124
|
setIsOpen(false);
|
|
80
125
|
setHighlightedIndex(-1);
|
|
@@ -253,7 +298,7 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
253
298
|
setHighlightedIndex,
|
|
254
299
|
setIsOpen,
|
|
255
300
|
disabled,
|
|
256
|
-
isInvalid,
|
|
301
|
+
isInvalid: isInvalid !== null && isInvalid !== void 0 ? isInvalid : !!(name && fieldErrors !== null && fieldErrors !== void 0 && fieldErrors[name]),
|
|
257
302
|
onKeyDownButton,
|
|
258
303
|
onKeyDownList,
|
|
259
304
|
onOptionSelected,
|
|
@@ -273,13 +318,20 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
273
318
|
}
|
|
274
319
|
}, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
|
275
320
|
id: id,
|
|
276
|
-
ref: ref,
|
|
321
|
+
ref: mergeRefs(ref, registerProps === null || registerProps === void 0 ? void 0 : registerProps.ref, focusRef),
|
|
277
322
|
className: classNames(className, styles.container),
|
|
323
|
+
"data-testid": dataTestId,
|
|
324
|
+
onBlur: onBlur
|
|
325
|
+
}), /*#__PURE__*/React__default.createElement(FormFieldWrapper, {
|
|
326
|
+
inputId: buttonId,
|
|
327
|
+
label: label,
|
|
328
|
+
errorText: errorText !== null && errorText !== void 0 ? errorText : name && (fieldErrors === null || fieldErrors === void 0 ? void 0 : fieldErrors[name]),
|
|
329
|
+
helperText: helperText,
|
|
278
330
|
"data-testid": dataTestId
|
|
279
|
-
}
|
|
331
|
+
}, dropdownButton, /*#__PURE__*/React__default.createElement(ChildIndexProvider, {
|
|
280
332
|
items: options,
|
|
281
333
|
setItems: setOptions
|
|
282
|
-
}, dropdownList)));
|
|
334
|
+
}, dropdownList))));
|
|
283
335
|
});
|
|
284
336
|
|
|
285
337
|
export { Dropdown as default };
|