@dfds-ui/react-components 2.2.0-alpha.9bb1ab0f → 2.2.0-alpha.a78c2264
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/accordion/Accordion.js +70 -51
- package/accordion/AccordionContent.js +13 -6
- package/accordion/AccordionSmall.js +52 -38
- package/app-bar/AppBar.js +49 -35
- package/app-bar/AppBarContext.js +7 -6
- package/app-bar/AppBarDrawer.js +13 -6
- package/app-bar/AppBarIconButton.js +10 -5
- package/app-bar/AppBarItem.js +71 -56
- package/assertions/banner/Banner.js +65 -51
- package/assertions/banner/BannerAction.js +10 -5
- package/assertions/banner/BannerTypography.js +9 -4
- package/assertions/toast/Toast.js +28 -17
- package/assertions/toast/Toaster.js +52 -56
- package/badge/Badge.js +17 -9
- package/button/BadgeIcon.js +18 -16
- package/button/Button.js +27 -19
- package/button/IconButton.js +20 -13
- package/button/LinkButton.js +8 -3
- package/button-stack/ButtonStack.js +27 -19
- package/card/Card.js +49 -35
- package/card/CardActions.js +13 -6
- package/card/CardContent.js +19 -9
- package/card/CardMedia.js +15 -6
- package/card/CardPriceTag.js +22 -4
- package/card/CardTitle.js +25 -15
- package/chip/Chip.js +22 -13
- package/cjs/accordion/Accordion.js +63 -50
- package/cjs/accordion/AccordionContent.js +7 -6
- package/cjs/accordion/AccordionSmall.js +45 -37
- package/cjs/app-bar/AppBar.js +45 -35
- package/cjs/app-bar/AppBarContext.js +5 -4
- package/cjs/app-bar/AppBarDrawer.js +7 -7
- package/cjs/app-bar/AppBarIconButton.js +6 -6
- package/cjs/app-bar/AppBarItem.js +63 -54
- package/cjs/app-bar/AppBarListItem.js +1 -2
- package/cjs/assertions/banner/Banner.js +56 -49
- package/cjs/assertions/banner/BannerAction.js +5 -4
- package/cjs/assertions/banner/BannerTypography.js +9 -7
- package/cjs/assertions/toast/Toast.js +22 -17
- package/cjs/assertions/toast/Toaster.js +36 -28
- package/cjs/badge/Badge.js +11 -7
- package/cjs/button/BadgeIcon.js +19 -17
- package/cjs/button/BaseButton.js +2 -4
- package/cjs/button/Button.js +21 -19
- package/cjs/button/IconButton.js +15 -14
- package/cjs/button/LinkButton.js +6 -6
- package/cjs/button/button-style.js +8 -15
- package/cjs/button-stack/ButtonStack.js +19 -17
- package/cjs/card/Card.js +39 -29
- package/cjs/card/CardActions.js +7 -7
- package/cjs/card/CardContent.js +13 -9
- package/cjs/card/CardMedia.js +9 -6
- package/cjs/card/CardPriceTag.js +16 -4
- package/cjs/card/CardTitle.js +16 -12
- package/cjs/chip/Chip.js +18 -15
- package/cjs/common/LockBodyScroll.js +15 -11
- package/cjs/common/emotionCloneElement.js +1 -2
- package/cjs/common/polymorphic.js +9 -5
- package/cjs/counter/Counter.js +50 -43
- package/cjs/counter/PluralCounter.js +13 -11
- package/cjs/data-table/DataTable.js +45 -37
- package/cjs/date-range-picker/DateRangePicker.d.ts +4 -4
- package/cjs/date-range-picker/DateRangePicker.js +276 -207
- package/cjs/date-range-picker/DateRangePicker.styles.d.ts +6 -0
- package/cjs/date-range-picker/DateRangePicker.styles.js +14 -0
- package/cjs/divider/Divider.js +6 -6
- package/cjs/drawer/Drawer.js +10 -8
- package/cjs/dropdown-menu/Dropdown.js +34 -29
- package/cjs/dropdown-menu/DropdownContext.js +7 -8
- package/cjs/dropdown-menu/MenuCheckbox.js +24 -23
- package/cjs/dropdown-menu/MenuItem.js +30 -28
- package/cjs/dropdown-menu/MenuTitle.js +15 -12
- package/cjs/elevation/index.js +1 -2
- package/cjs/flexbox/FlexBox.js +2 -4
- package/cjs/footer/Footer.js +10 -6
- package/cjs/forms/assistive-text/AssistiveText.js +1 -2
- package/cjs/forms/asterisk/Asterisk.js +5 -4
- package/cjs/forms/checkbox/Checkbox.js +36 -31
- package/cjs/forms/checkbox/ExampleControlComponent.js +7 -7
- package/cjs/forms/email-field/EmailField.js +7 -7
- package/cjs/forms/error-text/ErrorText.js +1 -2
- package/cjs/forms/field/Field.js +10 -6
- package/cjs/forms/input/Input.js +23 -21
- package/cjs/forms/input/InputComposition.js +29 -23
- package/cjs/forms/label/Label.js +6 -3
- package/cjs/forms/number-field/NumberField.js +6 -6
- package/cjs/forms/password-field/PasswordField.js +10 -10
- package/cjs/forms/radio/Radio.js +20 -19
- package/cjs/forms/reactselect/ReactSelect.js +70 -61
- package/cjs/forms/searchable-select/AsyncSearchableSelect.js +47 -38
- package/cjs/forms/select/Select.js +25 -22
- package/cjs/forms/select-field/SelectField.js +33 -29
- package/cjs/forms/switch/Switch.js +28 -22
- package/cjs/forms/tel-field/TelField.js +7 -7
- package/cjs/forms/text-field/TextField.js +37 -34
- package/cjs/global-styles/GlobalStyles.js +3 -2
- package/cjs/global-styles/ResetStyles.js +2 -1
- package/cjs/global-styles/sanitize.js +2 -3
- package/cjs/grid/Column.js +7 -7
- package/cjs/grid/Container.js +34 -29
- package/cjs/hero/Hero.js +32 -12
- package/cjs/hero/stripes.js +177 -162
- package/cjs/ie-banner/IEBanner.js +13 -8
- package/cjs/layout/LayoutLegacy.js +2 -1
- package/cjs/lists/FeatureList.js +16 -13
- package/cjs/lists/ListAddon.js +10 -7
- package/cjs/lists/ListDivider.js +6 -6
- package/cjs/lists/ListIcon.js +6 -6
- package/cjs/lists/ListItem.js +7 -6
- package/cjs/lists/ListText.js +6 -6
- package/cjs/lists/ListTextGroup.js +6 -6
- package/cjs/lists/ListTitle.js +6 -6
- package/cjs/loader/DfdsLoader.js +27 -21
- package/cjs/loader/Loader.js +9 -3
- package/cjs/localization/LocaleFlag.js +5 -4
- package/cjs/localization/locales.js +3 -6
- package/cjs/logo/Logo.js +12 -9
- package/cjs/media/index.js +1 -2
- package/cjs/menu/Menu.js +22 -15
- package/cjs/mobile-stepper/MobileStepper.js +17 -15
- package/cjs/nav-bar/NavBar.js +34 -24
- package/cjs/nav-menu/NavMenuItem.js +13 -11
- package/cjs/pagination/Pagination.js +50 -38
- package/cjs/pagination/Pagination.styles.js +6 -12
- package/cjs/popper/Popper.js +21 -17
- package/cjs/progress-bar/ProgressBar.js +3 -3
- package/cjs/schedule/ScheduleItem.js +11 -8
- package/cjs/schedule/ScheduleList.js +10 -11
- package/cjs/side-sheet/SideSheet.js +41 -33
- package/cjs/side-sheet/SideSheetCloseButton.js +6 -6
- package/cjs/side-sheet/SideSheetContent.js +10 -7
- package/cjs/side-sheet/SideSheetFooter.js +10 -7
- package/cjs/side-sheet/SideSheetHeader.js +10 -7
- package/cjs/side-sheet/SideSheetHeadline.js +6 -5
- package/cjs/site-layout/SiteLayout.js +30 -19
- package/cjs/skeleton/Skeleton.js +6 -6
- package/cjs/social-media-link-list/SocialMediaLinkList.js +64 -58
- package/cjs/spinner/Spinner.js +13 -13
- package/cjs/step/Step.js +29 -20
- package/cjs/step/Step.styles.js +4 -8
- package/cjs/step/StepButton.js +26 -23
- package/cjs/step/StepContent.js +12 -10
- package/cjs/step/StepContext.js +1 -2
- package/cjs/step/StepLabel.js +9 -7
- package/cjs/stepper/Stepper.js +12 -10
- package/cjs/stepper/StepperContext.js +1 -2
- package/cjs/stepper-feedback-message/StepperFeedbackMessage.js +10 -7
- package/cjs/styles/media.js +2 -4
- package/cjs/styles/theme.js +2 -4
- package/cjs/surface/Surface.js +20 -14
- package/cjs/tab/Tab.js +7 -6
- package/cjs/tab/TabPanel.js +6 -6
- package/cjs/tab/Tabs.js +29 -28
- package/cjs/tab/TabsContext.js +7 -8
- package/cjs/table/Table.js +15 -15
- package/cjs/table/TableBody.js +8 -9
- package/cjs/table/TableDataCell.js +9 -10
- package/cjs/table/TableHead.js +10 -12
- package/cjs/table/TableHeaderCell.js +9 -10
- package/cjs/table/TableRow.js +9 -10
- package/cjs/test/Test.js +5 -4
- package/cjs/tooltip/Tooltip.js +28 -22
- package/cjs/typography/Headlines.js +14 -20
- package/cjs/typography/Text.js +2 -3
- package/common/LockBodyScroll.js +20 -10
- package/common/polymorphic.js +9 -3
- package/common/use-media.js +2 -2
- package/counter/Counter.js +50 -42
- package/counter/PluralCounter.js +20 -11
- package/data-table/DataTable.js +52 -38
- package/date-range-picker/DateRangePicker.d.ts +4 -4
- package/date-range-picker/DateRangePicker.js +319 -238
- package/date-range-picker/DateRangePicker.styles.d.ts +6 -0
- package/date-range-picker/DateRangePicker.styles.js +9 -0
- package/divider/Divider.js +10 -5
- package/drawer/Drawer.js +15 -6
- package/dropdown-menu/Dropdown.js +42 -31
- package/dropdown-menu/DropdownContext.js +5 -4
- package/dropdown-menu/MenuCheckbox.js +24 -17
- package/dropdown-menu/MenuItem.js +26 -18
- package/dropdown-menu/MenuTitle.js +14 -11
- package/flexbox/FlexBox.js +2 -2
- package/footer/Footer.js +9 -4
- package/forms/asterisk/Asterisk.js +4 -2
- package/forms/checkbox/Checkbox.js +42 -32
- package/forms/checkbox/ExampleControlComponent.js +15 -8
- package/forms/email-field/EmailField.js +8 -3
- package/forms/field/Field.js +9 -4
- package/forms/input/Input.js +29 -22
- package/forms/input/InputComposition.js +29 -17
- package/forms/label/Label.js +12 -4
- package/forms/number-field/NumberField.js +8 -3
- package/forms/password-field/PasswordField.js +15 -9
- package/forms/radio/Radio.js +25 -18
- package/forms/reactselect/ReactSelect.js +65 -57
- package/forms/searchable-select/AsyncSearchableSelect.js +50 -38
- package/forms/select/Select.js +31 -23
- package/forms/select-field/SelectField.js +38 -29
- package/forms/switch/Switch.js +35 -23
- package/forms/tel-field/TelField.js +8 -3
- package/forms/text-field/TextField.js +43 -34
- package/global-styles/GlobalStyles.js +3 -3
- package/global-styles/ResetStyles.js +2 -2
- package/grid/Column.js +14 -7
- package/grid/Container.js +41 -35
- package/hero/Hero.js +32 -10
- package/hero/stripes.js +176 -160
- package/ie-banner/IEBanner.js +14 -8
- package/layout/LayoutLegacy.js +2 -2
- package/lists/FeatureList.js +21 -11
- package/lists/ListAddon.js +13 -6
- package/lists/ListDivider.js +10 -5
- package/lists/ListIcon.js +10 -5
- package/lists/ListItem.js +13 -6
- package/lists/ListText.js +10 -5
- package/lists/ListTextGroup.js +10 -5
- package/lists/ListTitle.js +10 -5
- package/loader/DfdsLoader.js +25 -19
- package/loader/Loader.js +8 -2
- package/localization/LocaleFlag.js +10 -5
- package/logo/Logo.js +14 -7
- package/menu/Menu.js +25 -12
- package/mobile-stepper/MobileStepper.js +26 -18
- package/nav-bar/NavBar.js +41 -23
- package/nav-menu/NavMenuItem.js +12 -10
- package/package.json +14 -16
- package/pagination/Pagination.js +53 -35
- package/popper/Popper.js +27 -17
- package/progress-bar/ProgressBar.js +2 -2
- package/schedule/ScheduleItem.js +9 -4
- package/schedule/ScheduleList.js +16 -10
- package/side-sheet/SideSheet.js +47 -34
- package/side-sheet/SideSheetCloseButton.js +10 -5
- package/side-sheet/SideSheetContent.js +17 -8
- package/side-sheet/SideSheetFooter.js +17 -8
- package/side-sheet/SideSheetHeader.js +17 -8
- package/side-sheet/SideSheetHeadline.js +5 -4
- package/site-layout/SiteLayout.js +31 -12
- package/skeleton/Skeleton.js +10 -5
- package/social-media-link-list/SocialMediaLinkList.js +69 -55
- package/spinner/Spinner.js +17 -10
- package/step/Step.js +34 -20
- package/step/StepButton.js +23 -15
- package/step/StepContent.js +11 -9
- package/step/StepLabel.js +8 -6
- package/stepper/Stepper.js +13 -11
- package/stepper-feedback-message/StepperFeedbackMessage.js +9 -6
- package/surface/Surface.js +17 -14
- package/tab/Tab.js +13 -6
- package/tab/TabPanel.js +5 -4
- package/tab/Tabs.js +42 -35
- package/tab/TabsContext.js +5 -4
- package/table/Table.js +20 -13
- package/table/TableBody.js +13 -7
- package/table/TableDataCell.js +14 -8
- package/table/TableHead.js +10 -8
- package/table/TableHeaderCell.js +14 -8
- package/table/TableRow.js +11 -10
- package/test/Test.js +4 -2
- package/tooltip/Tooltip.js +31 -21
- package/typography/Headlines.js +13 -6
- package/cjs/date-range-picker/DatePickerDefaultStyles.d.ts +0 -2
- package/cjs/date-range-picker/DatePickerDefaultStyles.js +0 -19
- package/cjs/date-range-picker/DatePickerDfdsStyles.d.ts +0 -2
- package/cjs/date-range-picker/DatePickerDfdsStyles.js +0 -11
- package/date-range-picker/DatePickerDefaultStyles.d.ts +0 -2
- package/date-range-picker/DatePickerDefaultStyles.js +0 -12
- package/date-range-picker/DatePickerDfdsStyles.d.ts +0 -2
- package/date-range-picker/DatePickerDfdsStyles.js +0 -4
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import _styled from "@emotion/styled/base";
|
|
2
3
|
var _excluded = ["visualSize", "children"],
|
|
3
4
|
_excluded2 = ["className", "icon", "color", "size"],
|
|
4
5
|
_excluded3 = ["className", "children"],
|
|
5
6
|
_excluded4 = ["error", "disabled"];
|
|
6
|
-
function
|
|
7
|
-
function
|
|
8
|
-
function
|
|
7
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
12
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
13
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
9
14
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
10
15
|
import React, { forwardRef } from 'react';
|
|
11
16
|
import { css } from '@emotion/react';
|
|
@@ -19,7 +24,7 @@ import { theme } from '@dfds-ui/theme';
|
|
|
19
24
|
<InputIcon />
|
|
20
25
|
</InputComposition>
|
|
21
26
|
*/
|
|
22
|
-
import { jsx as
|
|
27
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
23
28
|
var iconSizes = {
|
|
24
29
|
small: '24px',
|
|
25
30
|
medium: '24px'
|
|
@@ -62,11 +67,13 @@ export var InputComposition = function InputComposition(_ref2) {
|
|
|
62
67
|
visualSize = _ref2$visualSize === void 0 ? 'medium' : _ref2$visualSize,
|
|
63
68
|
children = _ref2.children,
|
|
64
69
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
65
|
-
return
|
|
70
|
+
return _jsx("div", _objectSpread(_objectSpread({
|
|
66
71
|
css: /*#__PURE__*/css("display:flex;position:relative;align-items:center;font-family:", theme.fontFamilies.system, ";background-color:", theme.colors.surface.primary, ";line-height:1.25;", sizeStyles({
|
|
67
72
|
visualSize: visualSize
|
|
68
73
|
}), ";" + (process.env.NODE_ENV === "production" ? "" : ";label:InputComposition;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9mb3Jtcy9pbnB1dC9JbnB1dENvbXBvc2l0aW9uLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF3SWMiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL2Zvcm1zL2lucHV0L0lucHV0Q29tcG9zaXRpb24udHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0LCB7IGZvcndhcmRSZWYsIFJlYWN0Tm9kZSB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcbmltcG9ydCB7IHRoZW1lIH0gZnJvbSAnQGRmZHMtdWkvdGhlbWUnXG5cbi8vIEV4YW1wbGVcbi8qXG48SW5wdXRDb21wb3NpdGlvbj5cbiAgPElucHV0QWRkb24gLz5cbiAgPElucHV0Q29udHJvbCAvPlxuICA8SW5wdXRJY29uIC8+XG48L0lucHV0Q29tcG9zaXRpb24+XG4qL1xuXG5leHBvcnQgdHlwZSBBbGlnbm1lbnQgPSAnbGVmdCcgfCAncmlnaHQnXG5cbmV4cG9ydCB0eXBlIFNpemUgPSAnc21hbGwnIHwgJ21lZGl1bScgfCAnbGFyZ2UnXG5cbnR5cGUgUmVhY3RJbnB1dFByb3BzID0gUmVhY3QuRGV0YWlsZWRIVE1MUHJvcHM8UmVhY3QuSW5wdXRIVE1MQXR0cmlidXRlczxIVE1MSW5wdXRFbGVt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b3JlIGNoYW5naW5nIHRoZXNlIHN0eWxlcyFcbmZ1bmN0aW9uIHNpemVTdHlsZXMoeyB2aXN1YWxTaXplIH06IHsgdmlzdWFsU2l6ZTogU2l6ZSB9KSB7XG4gIHN3aXRjaCAodmlzdWFsU2l6ZSkge1xuICAgIGNhc2UgJ3NtYWxsJzpcbiAgICAgIHJldHVybiBjc3NgXG4gICAgICAgIGhlaWdodDogMnJlbTtcbiAgICAgICAgZm9udC1zaXplOiAxcmVtO1xuICAgICAgICBwYWRkaW5nLXJpZ2h0OiAwLjVyZW07XG4gICAgICAgICYgJHtJbnB1dEVsZW1lbnR9IHtcbiAgICAgICAgICAke2lucHV0VHlwb2dyYXBoeSh2aXN1YWxTaXplKX07XG4gICAgICAgIH1cbiAgICAgICAgJiAke0lucHV0QWRkb259IHtcbiAgICAgICAgICBwYWRkaW5nLWxlZnQ6IDAuNXJlbTtcbiAgICAgICAgfVxuICAgICAgICAmICR7SW5wdXRJY29ufSB7XG4gICAgICAgICAgcGFkZGluZy1sZWZ0OiAwLjI1cmVtO1xuICAgICAgICB9XG4gICAgICBgXG4gICAgY2FzZSAnbWVkaXVtJzpcbiAgICAgIHJldHVybiBjc3NgXG4gICAgICAgIGhlaWdodDogMi41cmVtO1xuICAgICAgICBmb250LXNpemU6IDFyZW07XG4gICAgICAgIHBhZGRpbmctbGVmdDogMC41cmVtO1xuICAgICAgICBwYWRkaW5nLXJpZ2h0OiAwLjVyZW07XG4gICAgICAgICYgJHtJbnB1dEVsZW1lbnR9IHtcbiAgICAgICAgICAke2lucHV0VHlwb2dyYXBoeSh2aXN1YWxTaXplKX07XG4gICAgICAgIH1cbiAgICAgICAgJiAke0lucHV0QWRkb259IHtcbiAgICAgICAgICBwYWRkaW5nLWxlZnQ6IDAuMjVyZW07XG4gICAgICAgIH1cbiAgICAgIGBcbiAgICBjYXNlICdsYXJnZSc6XG4gICAgICByZXR1cm4gY3NzYFxuICAgICAgICBoZWlnaHQ6IDNyZW07XG4gICAgIC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GVkXSB+ICR7SW5wdXRJY29ufSB7XG4gICAgY29sb3I6ICR7dGhlbWUuY29sb3JzLnRleHQuZGFyay5kaXNhYmxlZH07XG4gIH1cbmBcblxuZXhwb3J0IGNvbnN0IElucHV0Q29udHJvbCA9IGZvcndhcmRSZWY8SFRNTElucHV0RWxlbWVudCwgSW5wdXRQcm9wcz4oXG4gICh7IGVycm9yLCBkaXNhYmxlZCwgLi4ucmVzdCB9OiBJbnB1dFByb3BzLCByZWYpID0+IHtcbiAgICByZXR1cm4gKFxuICAgICAgPD5cbiAgICAgICAgPElucHV0RWxlbWVudCBhcmlhLWludmFsaWQ9e2Vycm9yfSBkaXNhYmxlZD17ZGlzYWJsZWR9IHsuLi5yZXN0fSByZWY9e3JlZn0gLz5cbiAgICAgICAgPElucHV0Qm9yZGVyIC8+XG4gICAgICA8Lz5cbiAgICApXG4gIH1cbilcbiJdfQ== */")
|
|
69
|
-
}, rest),
|
|
74
|
+
}, rest), {}, {
|
|
75
|
+
children: children
|
|
76
|
+
}));
|
|
70
77
|
};
|
|
71
78
|
var Icon = function Icon(_ref3) {
|
|
72
79
|
var className = _ref3.className,
|
|
@@ -75,9 +82,10 @@ var Icon = function Icon(_ref3) {
|
|
|
75
82
|
_ref3$size = _ref3.size,
|
|
76
83
|
size = _ref3$size === void 0 ? 'medium' : _ref3$size,
|
|
77
84
|
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
78
|
-
return
|
|
79
|
-
className: className
|
|
80
|
-
|
|
85
|
+
return _jsx("span", {
|
|
86
|
+
className: className,
|
|
87
|
+
children: _jsx(Icon, _objectSpread({}, rest))
|
|
88
|
+
});
|
|
81
89
|
};
|
|
82
90
|
export var InputIcon = /*#__PURE__*/_styled(Icon, process.env.NODE_ENV === "production" ? {
|
|
83
91
|
target: "e1qqeh8b3"
|
|
@@ -89,9 +97,11 @@ var Addon = function Addon(_ref4) {
|
|
|
89
97
|
var className = _ref4.className,
|
|
90
98
|
children = _ref4.children,
|
|
91
99
|
rest = _objectWithoutProperties(_ref4, _excluded3);
|
|
92
|
-
return
|
|
100
|
+
return _jsx("span", _objectSpread(_objectSpread({
|
|
93
101
|
className: className
|
|
94
|
-
}, rest),
|
|
102
|
+
}, rest), {}, {
|
|
103
|
+
children: children
|
|
104
|
+
}));
|
|
95
105
|
};
|
|
96
106
|
export var InputAddon = /*#__PURE__*/_styled(Addon, process.env.NODE_ENV === "production" ? {
|
|
97
107
|
target: "e1qqeh8b2"
|
|
@@ -125,10 +135,12 @@ export var InputControl = /*#__PURE__*/forwardRef(function (_ref6, ref) {
|
|
|
125
135
|
var error = _ref6.error,
|
|
126
136
|
disabled = _ref6.disabled,
|
|
127
137
|
rest = _objectWithoutProperties(_ref6, _excluded4);
|
|
128
|
-
return
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
138
|
+
return _jsxs(_Fragment, {
|
|
139
|
+
children: [_jsx(InputElement, _objectSpread(_objectSpread({
|
|
140
|
+
"aria-invalid": error,
|
|
141
|
+
disabled: disabled
|
|
142
|
+
}, rest), {}, {
|
|
143
|
+
ref: ref
|
|
144
|
+
})), _jsx(InputBorder, {})]
|
|
145
|
+
});
|
|
134
146
|
});
|
package/forms/label/Label.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import _styled from "@emotion/styled/base";
|
|
2
3
|
var _excluded = ["required", "children", "hideAsterisk"];
|
|
3
|
-
function
|
|
4
|
-
function
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
11
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
6
12
|
import React from 'react';
|
|
7
13
|
import { css } from '@emotion/react';
|
|
8
14
|
import Asterisk from '../asterisk/Asterisk';
|
|
9
15
|
import { theme } from '@dfds-ui/theme';
|
|
10
|
-
import { jsx as
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
11
17
|
var labelStyles = process.env.NODE_ENV === "production" ? {
|
|
12
18
|
name: "1q659ri",
|
|
13
19
|
styles: "font-weight:bold;line-height:1.25"
|
|
@@ -39,6 +45,8 @@ var Label = function Label(_ref) {
|
|
|
39
45
|
children = _ref.children,
|
|
40
46
|
hideAsterisk = _ref.hideAsterisk,
|
|
41
47
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
42
|
-
return
|
|
48
|
+
return _jsxs(LabelTag, _objectSpread(_objectSpread({}, rest), {}, {
|
|
49
|
+
children: [children, required && !hideAsterisk && _jsx(Asterisk, {})]
|
|
50
|
+
}));
|
|
43
51
|
};
|
|
44
52
|
export default Label;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import _styled from "@emotion/styled/base";
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
4
9
|
import React from 'react';
|
|
5
10
|
import { css } from '@emotion/react';
|
|
6
11
|
import TextField from '../text-field/TextField';
|
|
7
|
-
import { jsx as
|
|
12
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
8
13
|
var textFieldStyles = process.env.NODE_ENV === "production" ? {
|
|
9
14
|
name: "wcz3kh",
|
|
10
15
|
styles: "input[type='number']{appearance:textfield;}input[type='number']::-webkit-inner-spin-button,input[type='number']::-webkit-outer-spin-button{appearance:none;margin:0;}"
|
|
@@ -16,7 +21,7 @@ var textFieldStyles = process.env.NODE_ENV === "production" ? {
|
|
|
16
21
|
|
|
17
22
|
// NumberField is a composite component used to encapsulate a complete field with label, input and error/hint
|
|
18
23
|
var NumberField = function NumberField(props, ref) {
|
|
19
|
-
return
|
|
24
|
+
return _jsx(TextField, _objectSpread(_objectSpread({}, props), {}, {
|
|
20
25
|
css: textFieldStyles,
|
|
21
26
|
ref: ref,
|
|
22
27
|
type: "number"
|
|
@@ -1,17 +1,22 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import _styled from "@emotion/styled/base";
|
|
2
|
-
function
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
3
8
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
4
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
10
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
6
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++)
|
|
7
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0)
|
|
11
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
13
|
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
9
14
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
10
15
|
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
11
16
|
import React, { useState } from 'react';
|
|
12
17
|
import { Hidden, Shown } from '@dfds-ui/icons';
|
|
13
18
|
import TextField from '../text-field/TextField';
|
|
14
|
-
import { jsx as
|
|
19
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
15
20
|
var IconWrapper = /*#__PURE__*/_styled("span", process.env.NODE_ENV === "production" ? {
|
|
16
21
|
target: "e82rmjd0"
|
|
17
22
|
} : {
|
|
@@ -32,16 +37,17 @@ var PasswordField = function PasswordField(props, ref) {
|
|
|
32
37
|
setVisible = _useState2[1];
|
|
33
38
|
var PasswordIcon = function PasswordIcon(_ref) {
|
|
34
39
|
var showAsText = _ref.showAsText;
|
|
35
|
-
return
|
|
40
|
+
return _jsx(IconWrapper, {
|
|
36
41
|
onClick: function onClick() {
|
|
37
42
|
return setVisible(!showAsText);
|
|
38
|
-
}
|
|
39
|
-
|
|
43
|
+
},
|
|
44
|
+
children: showAsText ? _jsx(Shown, {}) : _jsx(Hidden, {})
|
|
45
|
+
});
|
|
40
46
|
};
|
|
41
|
-
return
|
|
47
|
+
return _jsx(TextField, _objectSpread(_objectSpread({}, props), {}, {
|
|
42
48
|
ref: ref,
|
|
43
49
|
type: visible ? 'text' : 'password',
|
|
44
|
-
icon:
|
|
50
|
+
icon: _jsx(PasswordIcon, {
|
|
45
51
|
showAsText: visible
|
|
46
52
|
})
|
|
47
53
|
}));
|
package/forms/radio/Radio.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
import _styled from "@emotion/styled/base";
|
|
2
3
|
var _excluded = ["children", "disabled", "checked", "className", "error", "onChange", "htmlSize", "size"];
|
|
3
|
-
function
|
|
4
|
-
function
|
|
5
|
-
function
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
6
11
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
7
12
|
import React from 'react';
|
|
8
13
|
import { theme } from '@dfds-ui/theme';
|
|
9
14
|
import { css } from '@emotion/react';
|
|
10
15
|
import { visuallyHidden } from '../../styles';
|
|
11
|
-
import { jsx as
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
12
17
|
export var radioSizes = {
|
|
13
18
|
small: {
|
|
14
19
|
circle: '16px',
|
|
@@ -80,22 +85,24 @@ var Radio = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
|
80
85
|
_ref2$size = _ref2.size,
|
|
81
86
|
size = _ref2$size === void 0 ? 'medium' : _ref2$size,
|
|
82
87
|
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
83
|
-
return
|
|
88
|
+
return _jsxs(Label, {
|
|
84
89
|
hasError: error,
|
|
85
90
|
disabled: disabled,
|
|
86
91
|
size: size,
|
|
87
|
-
className: "".concat(className)
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
className: "".concat(className),
|
|
93
|
+
children: [_jsx("input", _objectSpread({
|
|
94
|
+
type: "radio",
|
|
95
|
+
onChange: onChange,
|
|
96
|
+
checked: checked,
|
|
97
|
+
disabled: disabled,
|
|
98
|
+
readOnly: !onChange,
|
|
99
|
+
"aria-invalid": error,
|
|
100
|
+
size: htmlSize,
|
|
101
|
+
ref: ref
|
|
102
|
+
}, rest)), _jsx("i", {}), _jsx(Text, {
|
|
103
|
+
size: size,
|
|
104
|
+
children: children
|
|
105
|
+
})]
|
|
106
|
+
});
|
|
100
107
|
});
|
|
101
108
|
export default Radio;
|
|
@@ -3,14 +3,13 @@ import _styled from "@emotion/styled/base";
|
|
|
3
3
|
var _excluded = ["ref"],
|
|
4
4
|
_excluded2 = ["name", "error", "selectClassName", "className", "icon", "disabled", "size", "arrow", "htmlSize", "isClearable", "components", "menuPlacement"],
|
|
5
5
|
_excluded3 = ["ref"];
|
|
6
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
7
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
6
8
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
9
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
10
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
9
11
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
10
12
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
11
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
12
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
13
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
14
13
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
15
14
|
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
16
15
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
@@ -22,7 +21,7 @@ import { theme } from '@dfds-ui/theme';
|
|
|
22
21
|
import { Down, Close } from '@dfds-ui/icons';
|
|
23
22
|
import { Drawer } from '../../drawer';
|
|
24
23
|
import Select, { components } from 'react-select';
|
|
25
|
-
import { jsx as
|
|
24
|
+
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
26
25
|
export var ReactSelectWrapper = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
27
26
|
target: "emyde7z1"
|
|
28
27
|
} : {
|
|
@@ -64,26 +63,31 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
64
63
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
65
64
|
};
|
|
66
65
|
export var Menu = function Menu(props) {
|
|
67
|
-
return
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
return _jsx(components.Menu, _objectSpread(_objectSpread({}, props), {}, {
|
|
67
|
+
children: _jsx(Drawer, {
|
|
68
|
+
verticalPosition: props.placement,
|
|
69
|
+
css: _ref,
|
|
70
|
+
children: props.children
|
|
71
|
+
})
|
|
72
|
+
}));
|
|
71
73
|
};
|
|
72
74
|
export var ClearIndicator = function ClearIndicator(props) {
|
|
73
75
|
var _props$children = props.children,
|
|
74
|
-
children = _props$children === void 0 ?
|
|
76
|
+
children = _props$children === void 0 ? _jsx(Close, {}) : _props$children,
|
|
75
77
|
getStyles = props.getStyles,
|
|
76
78
|
_props$innerProps = props.innerProps,
|
|
77
79
|
ref = _props$innerProps.ref,
|
|
78
80
|
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded);
|
|
79
|
-
return
|
|
81
|
+
return _jsx("div", _objectSpread(_objectSpread({}, restInnerProps), {}, {
|
|
80
82
|
ref: ref,
|
|
81
|
-
style: getStyles('clearIndicator', props)
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
style: getStyles('clearIndicator', props),
|
|
84
|
+
children: _jsx("div", {
|
|
85
|
+
style: {
|
|
86
|
+
padding: "0 ".concat(theme.spacing.xxs, "px")
|
|
87
|
+
},
|
|
88
|
+
children: children
|
|
89
|
+
})
|
|
90
|
+
}));
|
|
87
91
|
};
|
|
88
92
|
|
|
89
93
|
// low level component for select element
|
|
@@ -107,57 +111,61 @@ var ReactSelect = function ReactSelect(_ref2, ref) {
|
|
|
107
111
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
108
112
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
109
113
|
var _props$children2 = props.children,
|
|
110
|
-
children = _props$children2 === void 0 ?
|
|
114
|
+
children = _props$children2 === void 0 ? _jsx(Icon, {
|
|
111
115
|
size: size,
|
|
112
|
-
disabled: disabled
|
|
113
|
-
|
|
116
|
+
disabled: disabled,
|
|
117
|
+
children: icon || _jsx(Down, {})
|
|
118
|
+
}) : _props$children2,
|
|
114
119
|
getStyles = props.getStyles,
|
|
115
120
|
_props$innerProps2 = props.innerProps,
|
|
116
121
|
ref = _props$innerProps2.ref,
|
|
117
122
|
restInnerProps = _objectWithoutProperties(_props$innerProps2, _excluded3);
|
|
118
|
-
return
|
|
123
|
+
return _jsx("div", _objectSpread(_objectSpread({}, restInnerProps), {}, {
|
|
119
124
|
ref: ref,
|
|
120
|
-
style: getStyles('dropdownIndicator', props)
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
style: getStyles('dropdownIndicator', props),
|
|
126
|
+
children: _jsx("div", {
|
|
127
|
+
style: {
|
|
128
|
+
padding: "0 ".concat(theme.spacing.xxs)
|
|
129
|
+
},
|
|
130
|
+
children: children
|
|
131
|
+
})
|
|
132
|
+
}));
|
|
126
133
|
};
|
|
127
|
-
return
|
|
134
|
+
return _jsx(ReactSelectWrapper, {
|
|
128
135
|
error: error,
|
|
129
136
|
size: size,
|
|
130
137
|
className: className,
|
|
131
|
-
arrow: arrow
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
138
|
+
arrow: arrow,
|
|
139
|
+
children: _jsx(Select, _objectSpread(_objectSpread({
|
|
140
|
+
as: "Select",
|
|
141
|
+
name: name,
|
|
142
|
+
menuPlacement: menuPlacement,
|
|
143
|
+
styles: {
|
|
144
|
+
option: function option(provided) {
|
|
145
|
+
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
146
|
+
':active': {
|
|
147
|
+
backgroundColor: 'transparent'
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"aria-invalid": error,
|
|
153
|
+
visualSize: size,
|
|
154
|
+
size: htmlSize,
|
|
155
|
+
isDisabled: disabled,
|
|
156
|
+
isClearable: isClearable,
|
|
157
|
+
classNamePrefix: "react-select",
|
|
158
|
+
className: selectClassName,
|
|
159
|
+
components: _objectSpread(_objectSpread({
|
|
160
|
+
Menu: Menu
|
|
161
|
+
}, components), {}, {
|
|
162
|
+
ClearIndicator: ClearIndicator,
|
|
163
|
+
DropdownIndicator: DropdownIndicator
|
|
164
|
+
})
|
|
165
|
+
}, rest), {}, {
|
|
166
|
+
ref: ref
|
|
167
|
+
}))
|
|
168
|
+
});
|
|
161
169
|
};
|
|
162
170
|
/** @deprecated Use dfds-ui/forms */
|
|
163
171
|
export default /*#__PURE__*/React.forwardRef(ReactSelect);
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
1
2
|
var _excluded = ["name", "error", "selectClassName", "className", "icon", "disabled", "size", "arrow", "htmlSize", "handleInputChange", "loadOptions", "onBlur", "onFocus", "onChange", "assistiveText", "autoFocus"],
|
|
2
3
|
_excluded2 = ["ref"];
|
|
3
|
-
function
|
|
4
|
-
function
|
|
5
|
-
function
|
|
4
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
7
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
8
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
9
|
+
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
10
|
+
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
6
11
|
/* eslint-disable @typescript-eslint/no-deprecated */
|
|
7
12
|
import React from 'react';
|
|
8
13
|
import { ReactSelectWrapper, Icon, ClearIndicator } from '../reactselect/ReactSelect';
|
|
@@ -11,7 +16,7 @@ import AsyncSelect from 'react-select/async';
|
|
|
11
16
|
import ErrorText from '../error-text/ErrorText';
|
|
12
17
|
import AssistiveText from '../assistive-text/AssistiveText';
|
|
13
18
|
import { theme } from '@dfds-ui/theme';
|
|
14
|
-
import { jsx as
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
15
20
|
var AsyncSearchableSelect = function AsyncSearchableSelect(_ref) {
|
|
16
21
|
var name = _ref.name,
|
|
17
22
|
error = _ref.error,
|
|
@@ -34,49 +39,56 @@ var AsyncSearchableSelect = function AsyncSearchableSelect(_ref) {
|
|
|
34
39
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
35
40
|
var DropdownIndicator = function DropdownIndicator(props) {
|
|
36
41
|
var _props$children = props.children,
|
|
37
|
-
children = _props$children === void 0 ?
|
|
42
|
+
children = _props$children === void 0 ? _jsx(Icon, {
|
|
38
43
|
size: size,
|
|
39
|
-
disabled: disabled
|
|
40
|
-
|
|
44
|
+
disabled: disabled,
|
|
45
|
+
children: icon || _jsx(Down, {})
|
|
46
|
+
}) : _props$children,
|
|
41
47
|
getStyles = props.getStyles,
|
|
42
48
|
_props$innerProps = props.innerProps,
|
|
43
49
|
ref = _props$innerProps.ref,
|
|
44
50
|
restInnerProps = _objectWithoutProperties(_props$innerProps, _excluded2);
|
|
45
|
-
return
|
|
51
|
+
return _jsx("div", _objectSpread(_objectSpread({}, restInnerProps), {}, {
|
|
46
52
|
ref: ref,
|
|
47
|
-
style: getStyles('dropdownIndicator', props)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
style: getStyles('dropdownIndicator', props),
|
|
54
|
+
children: _jsx("div", {
|
|
55
|
+
style: {
|
|
56
|
+
padding: "0 ".concat(theme.spacing.xxs)
|
|
57
|
+
},
|
|
58
|
+
children: children
|
|
59
|
+
})
|
|
60
|
+
}));
|
|
53
61
|
};
|
|
54
|
-
return
|
|
62
|
+
return _jsxs(ReactSelectWrapper, {
|
|
55
63
|
error: error,
|
|
56
64
|
size: size,
|
|
57
65
|
className: className,
|
|
58
|
-
arrow: arrow
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
66
|
+
arrow: arrow,
|
|
67
|
+
children: [_jsx(AsyncSelect, _objectSpread({
|
|
68
|
+
as: "Select",
|
|
69
|
+
name: name,
|
|
70
|
+
"aria-invalid": error,
|
|
71
|
+
visualSize: size,
|
|
72
|
+
size: htmlSize,
|
|
73
|
+
isDisabled: disabled,
|
|
74
|
+
classNamePrefix: "react-select",
|
|
75
|
+
className: selectClassName,
|
|
76
|
+
loadOptions: loadOptions,
|
|
77
|
+
onInputChange: handleInputChange,
|
|
78
|
+
onChange: onChange,
|
|
79
|
+
onBlur: onBlur,
|
|
80
|
+
onFocus: onFocus,
|
|
81
|
+
autoFocus: autoFocus,
|
|
82
|
+
components: {
|
|
83
|
+
DropdownIndicator: DropdownIndicator,
|
|
84
|
+
ClearIndicator: ClearIndicator
|
|
85
|
+
}
|
|
86
|
+
}, rest)), error ? _jsx(ErrorText, {
|
|
87
|
+
small: true,
|
|
88
|
+
children: error
|
|
89
|
+
}) : assistiveText && _jsx(AssistiveText, {
|
|
90
|
+
children: assistiveText
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
81
93
|
};
|
|
82
94
|
export default AsyncSearchableSelect;
|