@via-profit/ui-kit 0.5.0 → 0.6.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/Accordion/AccordionActions.d.ts +1 -1
- package/Accordion/AccordionActions.js +2 -1
- package/Accordion/AccordionContainer.d.ts +1 -1
- package/Accordion/AccordionContainer.js +2 -14
- package/Accordion/AccordionContent.d.ts +1 -1
- package/Accordion/AccordionContent.js +5 -1
- package/Accordion/AccordionHeader.d.ts +2 -2
- package/Accordion/AccordionHeader.js +6 -2
- package/Accordion/index.d.ts +9 -9
- package/Accordion/index.js +18 -9
- package/Autocomplete/AutocompleteContainer.d.ts +2 -2
- package/Autocomplete/AutocompleteContainer.js +17 -7
- package/Autocomplete/AutocompleteItem.js +2 -1
- package/Autocomplete/context.d.ts +3 -3
- package/Autocomplete/index.d.ts +2 -2
- package/Avatar/AvatarContainer.d.ts +2 -2
- package/Avatar/AvatarPicture.d.ts +2 -2
- package/Avatar/index.js +1 -2
- package/Badge/BadgeBase.d.ts +1 -1
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Badge/BadgeDeleteButton.d.ts +2 -2
- package/Badge/BadgeStyled.js +1 -1
- package/Badge/index.d.ts +1 -1
- package/Badge/index.js +1 -2
- package/Button/ButtonBase.d.ts +2 -2
- package/Button/ButtonContainer.d.ts +4 -4
- package/Button/ButtonContainer.js +22 -5
- package/Button/ButtonIconWrapper.d.ts +1 -1
- package/Button/ButtonStyled.d.ts +1 -1
- package/Button/ButtonTextWrapper.d.ts +1 -1
- package/Button/buttonVariants.d.ts +1 -1
- package/Button/buttonVariants.js +3 -2
- package/Button/index.d.ts +1 -1
- package/Button/index.js +1 -20
- package/ButtonGroup/index.js +4 -3
- package/CHANGELOG.md +32 -1
- package/Calendar/CalendarComponent.js +18 -9
- package/Calendar/CalendarControlButton.d.ts +2 -2
- package/Calendar/CalendarPaper.js +1 -1
- package/Calendar/CalendarWeekDayLabel.d.ts +2 -2
- package/Calendar/CalendarWeekRowButton.d.ts +1 -1
- package/Calendar/IconChevronDown.js +17 -7
- package/Calendar/index.d.ts +1 -1
- package/Calendar/index.js +17 -7
- package/Checkbox/CheckboxAsterisk.js +17 -7
- package/Checkbox/CheckboxBox.d.ts +2 -2
- package/Checkbox/CheckboxBox.js +1 -1
- package/Checkbox/CheckboxContainer.d.ts +2 -2
- package/Checkbox/CheckboxErrorText.js +17 -7
- package/Checkbox/index.d.ts +10 -10
- package/Checkbox/index.js +1 -2
- package/Checkbox/useCheckboxColor.d.ts +1 -1
- package/ClickOutside/index.js +5 -2
- package/DatePicker/index.d.ts +1 -1
- package/ErrorBoundary/RenderError.js +17 -7
- package/ErrorBoundary/index.d.ts +1 -1
- package/Grid/index.d.ts +17 -5
- package/Grid/index.js +7 -2
- package/Highlighted/index.js +1 -2
- package/LoadingIndicator/LoadingOverlay.js +17 -7
- package/LoadingIndicator/Spinner.js +17 -7
- package/LoadingIndicator/SpinnerCircle.d.ts +2 -3
- package/Menu/MenuContainer.d.ts +2 -2
- package/Menu/MenuContainer.js +19 -10
- package/Menu/MenuItem.js +5 -1
- package/Menu/MenuList.js +1 -1
- package/Menu/context.d.ts +1 -1
- package/Menu/index.d.ts +1 -1
- package/Modal/BaseModal/ModalInner.js +2 -0
- package/Modal/BaseModal/ModalWrapper.js +30 -37
- package/Modal/BaseModal/context.d.ts +1 -1
- package/Modal/BaseModal/index.js +1 -2
- package/Modal/ConfirmBox/ConfirmBoxContent.js +5 -1
- package/Modal/ConfirmBox/ConfirmBoxFooter.js +5 -1
- package/Modal/ConfirmBox/ConfirmBoxHeader.js +5 -1
- package/Modal/ConfirmBox/index.js +1 -2
- package/Modal/Dialog/DialogInner.js +5 -1
- package/Modal/Dialog/index.js +18 -9
- package/Modal/Drawer/DrawerCloseIcon.js +17 -7
- package/Modal/Drawer/DrawerFooter.js +5 -1
- package/Modal/Drawer/DrawerHeader.d.ts +4 -4
- package/Modal/Drawer/DrawerHeader.js +5 -1
- package/Modal/Drawer/index.js +18 -9
- package/Modal/MessageBox/MessageBoxContent.js +5 -1
- package/Modal/MessageBox/MessageBoxFooter.js +5 -1
- package/Modal/MessageBox/MessageBoxHeader.js +5 -1
- package/Modal/MessageBox/index.js +18 -9
- package/Modal/index.js +17 -7
- package/Pagination/PaginationContainer.d.ts +9 -0
- package/Pagination/PaginationContainer.js +34 -0
- package/Pagination/PaginationGap.d.ts +4 -0
- package/Pagination/PaginationGap.js +22 -0
- package/Pagination/PaginationIcons.d.ts +6 -0
- package/Pagination/PaginationIcons.js +21 -0
- package/Pagination/PaginationItem.d.ts +44 -0
- package/Pagination/PaginationItem.js +59 -0
- package/Pagination/getPaginationItems.d.ts +22 -0
- package/Pagination/getPaginationItems.js +42 -0
- package/Pagination/index.d.ts +104 -0
- package/Pagination/index.js +98 -0
- package/Pagination/usePagination.d.ts +105 -0
- package/Pagination/usePagination.js +66 -0
- package/PhoneField/CountryFlagComponent.d.ts +1 -1
- package/PhoneField/UnknownFlag.d.ts +0 -1
- package/PhoneField/flags/BY.js +17 -7
- package/PhoneField/flags/CN.js +17 -7
- package/PhoneField/flags/IL.js +17 -7
- package/PhoneField/flags/JP.js +17 -7
- package/PhoneField/flags/KZ.js +17 -7
- package/PhoneField/flags/RU.js +17 -7
- package/PhoneField/flags/UA.js +17 -7
- package/PhoneField/flags/US.js +17 -7
- package/PhoneField/flags/Unknown.js +17 -7
- package/PhoneField/templates.d.ts +2 -2
- package/Popper/Popper.js +1 -2
- package/Radio/RadioBox.d.ts +1 -1
- package/Radio/RadioBox.js +1 -1
- package/Radio/RadioContainer.d.ts +2 -2
- package/Radio/index.d.ts +5 -5
- package/Radio/index.js +1 -2
- package/Radio/useRadioColor.d.ts +1 -1
- package/RadioGroup/RadioGroupAsterisk.js +17 -7
- package/RadioGroup/RadioGroupErrorText.js +17 -7
- package/RadioGroup/RadioGroupItems.d.ts +1 -1
- package/RadioGroup/index.d.ts +11 -11
- package/RadioGroup/index.js +1 -2
- package/Selectbox/SelectboxButton.d.ts +4 -4
- package/Selectbox/SelectboxButton.js +25 -10
- package/Selectbox/SelectboxButtonWrapper.d.ts +2 -2
- package/Selectbox/SelectboxButtonWrapper.js +19 -10
- package/Selectbox/SelectboxMenu.d.ts +2 -2
- package/Selectbox/SelectboxMenu.js +17 -7
- package/Selectbox/index.d.ts +2 -2
- package/Selectbox/index.js +18 -9
- package/Slider/SliderRail.d.ts +1 -1
- package/Slider/SliderThumb.d.ts +1 -1
- package/Slider/SliderTrack.d.ts +1 -1
- package/Slider/index.js +1 -2
- package/Slider/useSliderColor.d.ts +1 -1
- package/Stack/index.d.ts +18 -6
- package/Stack/index.js +7 -2
- package/Surface/SurfaceContainer.d.ts +3 -3
- package/Surface/SurfaceContainer.js +1 -1
- package/Surface/SurfaceContent.d.ts +2 -2
- package/Surface/SurfaceContent.js +18 -11
- package/Surface/SurfaceFooter.d.ts +2 -2
- package/Surface/SurfaceFooter.js +5 -1
- package/Surface/SurfaceHeader.d.ts +2 -2
- package/Surface/SurfaceHeader.js +6 -2
- package/Surface/SurfaceSubheader.d.ts +2 -2
- package/Surface/SurfaceSubheader.js +6 -2
- package/Surface/index.d.ts +10 -10
- package/Surface/index.js +18 -9
- package/Swiper/Swiper.d.ts +15 -15
- package/Swiper/Swiper.js +18 -9
- package/Swiper/SwiperContainer.d.ts +2 -2
- package/Swiper/SwiperSlide.js +17 -7
- package/Swiper/SwiperSlidesRenderer.js +17 -7
- package/Swiper/SwiperTrack.d.ts +2 -2
- package/Swiper/SwiperTrack.js +17 -7
- package/Swiper/SwiperWrapper.d.ts +2 -2
- package/Swiper/SwiperWrapper.js +17 -7
- package/Switch/SwitchAsterisk.js +17 -7
- package/Switch/SwitchContainer.d.ts +2 -2
- package/Switch/SwitchDot.d.ts +1 -1
- package/Switch/SwitchDot.js +2 -4
- package/Switch/SwitchErrorText.js +17 -7
- package/Switch/SwitchTrack.d.ts +1 -1
- package/Switch/index.d.ts +9 -9
- package/Switch/index.js +1 -2
- package/Switch/useSwitchColor.d.ts +1 -1
- package/Table/Table.d.ts +1 -1
- package/Table/Table.js +1 -1
- package/Table/TableCaption.js +5 -1
- package/Table/TableCell.js +6 -2
- package/Table/TableFooter.js +2 -1
- package/Table/TableHeaderCell.js +6 -2
- package/Tabs/Tab.js +4 -1
- package/Tabs/TabPanel.d.ts +1 -1
- package/Tabs/Tabs.d.ts +7 -7
- package/Tabs/Tabs.js +1 -2
- package/Tabs/useTabsColor.d.ts +1 -1
- package/TextArea/TextAreaIconWrapper.d.ts +3 -3
- package/TextArea/TextAreaIconWrapper.js +17 -7
- package/TextArea/TextAreaInput.js +23 -8
- package/TextArea/index.js +18 -9
- package/TextField/TextFieldContainer.js +17 -7
- package/TextField/TextFieldErrorText.js +17 -7
- package/TextField/TextFieldIconWrapper.d.ts +3 -3
- package/TextField/TextFieldIconWrapper.js +17 -7
- package/TextField/TextFieldInput.js +23 -8
- package/TextField/TextFieldInputWrapper.d.ts +5 -5
- package/TextField/TextFieldInputWrapper.js +22 -9
- package/TextField/TextFieldLabel.js +17 -7
- package/TextField/TextFieldLabelAsterisk.js +17 -7
- package/TextField/index.d.ts +1 -1
- package/TextField/index.js +18 -9
- package/ThemeProvider/createTheme.js +7 -3
- package/ThemeProvider/index.d.ts +45 -12
- package/ThemeProvider/index.js +1 -4
- package/ThemeProvider/tokens.d.ts +54 -3
- package/ThemeProvider/tokens.js +61 -3
- package/Toast/ToastCard.js +5 -2
- package/Toast/ToastContainer.js +1 -2
- package/Tooltip/TooltipContainer.js +2 -0
- package/Tooltip/index.js +3 -4
- package/Typography/Base.d.ts +2 -3
- package/Typography/Blockquote.d.ts +2 -3
- package/Typography/List.d.ts +6 -7
- package/Typography/Paragraph.d.ts +1 -1
- package/Typography/Paragraph.js +17 -7
- package/Typography/SectionDescription.d.ts +2 -3
- package/Typography/U.d.ts +2 -3
- package/esm/Accordion/AccordionActions.js +2 -1
- package/esm/Accordion/AccordionContainer.js +2 -14
- package/esm/Accordion/AccordionContent.js +5 -1
- package/esm/Accordion/AccordionHeader.js +7 -3
- package/esm/Accordion/index.js +1 -2
- package/esm/Autocomplete/AutocompleteItem.js +2 -1
- package/esm/Avatar/index.js +1 -2
- package/esm/Badge/BadgeStyled.js +2 -2
- package/esm/Badge/index.js +1 -2
- package/esm/Button/ButtonContainer.js +23 -6
- package/esm/Button/buttonVariants.js +3 -2
- package/esm/Button/index.js +1 -20
- package/esm/ButtonGroup/index.js +4 -3
- package/esm/Calendar/CalendarComponent.js +1 -2
- package/esm/Calendar/CalendarPaper.js +1 -1
- package/esm/Checkbox/CheckboxBox.js +2 -2
- package/esm/Checkbox/index.js +1 -2
- package/esm/ClickOutside/index.js +5 -2
- package/esm/Grid/index.js +7 -2
- package/esm/Highlighted/index.js +1 -2
- package/esm/Menu/MenuContainer.js +2 -3
- package/esm/Menu/MenuItem.js +5 -1
- package/esm/Menu/MenuList.js +1 -1
- package/esm/Modal/BaseModal/ModalInner.js +2 -0
- package/esm/Modal/BaseModal/ModalWrapper.js +30 -37
- package/esm/Modal/BaseModal/index.js +1 -2
- package/esm/Modal/ConfirmBox/ConfirmBoxContent.js +5 -1
- package/esm/Modal/ConfirmBox/ConfirmBoxFooter.js +5 -1
- package/esm/Modal/ConfirmBox/ConfirmBoxHeader.js +5 -1
- package/esm/Modal/ConfirmBox/index.js +1 -2
- package/esm/Modal/Dialog/DialogInner.js +5 -1
- package/esm/Modal/Dialog/index.js +1 -2
- package/esm/Modal/Drawer/DrawerFooter.js +5 -1
- package/esm/Modal/Drawer/DrawerHeader.js +5 -1
- package/esm/Modal/Drawer/index.js +1 -2
- package/esm/Modal/MessageBox/MessageBoxContent.js +5 -1
- package/esm/Modal/MessageBox/MessageBoxFooter.js +5 -1
- package/esm/Modal/MessageBox/MessageBoxHeader.js +5 -1
- package/esm/Modal/MessageBox/index.js +1 -2
- package/esm/Pagination/PaginationContainer.js +29 -0
- package/esm/Pagination/PaginationGap.js +17 -0
- package/esm/Pagination/PaginationIcons.js +15 -0
- package/esm/Pagination/PaginationItem.js +54 -0
- package/esm/Pagination/getPaginationItems.js +40 -0
- package/esm/Pagination/index.js +77 -0
- package/esm/Pagination/usePagination.js +61 -0
- package/esm/Popper/Popper.js +1 -2
- package/esm/Radio/RadioBox.js +2 -2
- package/esm/Radio/index.js +1 -2
- package/esm/RadioGroup/index.js +1 -2
- package/esm/Selectbox/SelectboxButton.js +8 -3
- package/esm/Selectbox/SelectboxButtonWrapper.js +2 -3
- package/esm/Selectbox/index.js +1 -2
- package/esm/Slider/index.js +1 -2
- package/esm/Stack/index.js +7 -2
- package/esm/Surface/SurfaceContainer.js +1 -1
- package/esm/Surface/SurfaceContent.js +18 -11
- package/esm/Surface/SurfaceFooter.js +5 -1
- package/esm/Surface/SurfaceHeader.js +6 -2
- package/esm/Surface/SurfaceSubheader.js +6 -2
- package/esm/Surface/index.js +1 -2
- package/esm/Swiper/Swiper.js +1 -2
- package/esm/Switch/SwitchDot.js +2 -4
- package/esm/Switch/index.js +1 -2
- package/esm/Table/Table.js +1 -1
- package/esm/Table/TableCaption.js +5 -1
- package/esm/Table/TableCell.js +6 -2
- package/esm/Table/TableFooter.js +2 -1
- package/esm/Table/TableHeaderCell.js +6 -2
- package/esm/Tabs/Tab.js +5 -2
- package/esm/Tabs/Tabs.js +1 -2
- package/esm/TextArea/TextAreaInput.js +6 -1
- package/esm/TextArea/index.js +1 -2
- package/esm/TextField/TextFieldInput.js +6 -1
- package/esm/TextField/TextFieldInputWrapper.js +5 -2
- package/esm/TextField/index.js +1 -2
- package/esm/ThemeProvider/createTheme.js +7 -3
- package/esm/ThemeProvider/index.js +0 -2
- package/esm/ThemeProvider/tokens.js +55 -2
- package/esm/Toast/ToastCard.js +6 -3
- package/esm/Toast/ToastContainer.js +1 -2
- package/esm/Tooltip/TooltipContainer.js +2 -0
- package/esm/Tooltip/index.js +3 -4
- package/esm/utils/getElementRef.js +13 -0
- package/package.json +46 -11
- package/utils/getElementRef.d.ts +8 -0
- package/utils/getElementRef.js +18 -0
- package/ThemeProvider/components.d.ts +0 -79
- package/ThemeProvider/components.js +0 -3
- package/ThemeProvider/useThemeProps.d.ts +0 -7
- package/ThemeProvider/useThemeProps.js +0 -34
- package/esm/ThemeProvider/components.js +0 -2
- package/esm/ThemeProvider/useThemeProps.js +0 -29
|
@@ -8,9 +8,9 @@ export type SelectboxButtonProps = Omit<ButtonProps, 'type'> & {
|
|
|
8
8
|
readonly isOpen?: boolean;
|
|
9
9
|
};
|
|
10
10
|
declare const _default: React.ForwardRefExoticComponent<Omit<ButtonProps, "type"> & {
|
|
11
|
-
readonly fullWidth?: boolean
|
|
12
|
-
readonly error?: boolean
|
|
13
|
-
readonly anchorPos?:
|
|
14
|
-
readonly isOpen?: boolean
|
|
11
|
+
readonly fullWidth?: boolean;
|
|
12
|
+
readonly error?: boolean;
|
|
13
|
+
readonly anchorPos?: AnchorPos;
|
|
14
|
+
readonly isOpen?: boolean;
|
|
15
15
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
16
16
|
export default _default;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -42,13 +52,19 @@ const styled_1 = __importDefault(require("@emotion/styled"));
|
|
|
42
52
|
const Button_1 = __importDefault(require("../Button"));
|
|
43
53
|
const ButtonTextWrapper_1 = __importDefault(require("../Button/ButtonTextWrapper"));
|
|
44
54
|
const react_1 = require("@emotion/react");
|
|
55
|
+
const tokens_1 = require("../ThemeProvider/tokens");
|
|
45
56
|
const StyledSelectboxButton = (0, styled_1.default)(Button_1.default) `
|
|
46
57
|
flex: 1;
|
|
47
|
-
padding:
|
|
58
|
+
padding: ${({ theme }) => {
|
|
59
|
+
const { y, x } = (0, tokens_1.fieldPadding)(theme, tokens_1.FIELD_TEXT_SCALE);
|
|
60
|
+
return `${y} ${x}`;
|
|
61
|
+
}};
|
|
48
62
|
font-size: 1em;
|
|
63
|
+
/* The line of the control: the selectbox has the height of the button */
|
|
64
|
+
line-height: calc(${tokens_1.CONTROL_LINE_HEIGHT} / ${tokens_1.FIELD_TEXT_SCALE});
|
|
49
65
|
background: none;
|
|
50
66
|
width: 100%;
|
|
51
|
-
border-width:
|
|
67
|
+
border-width: ${(0, tokens_1.fieldBorder)(tokens_1.FIELD_TEXT_SCALE)};
|
|
52
68
|
border-style: solid;
|
|
53
69
|
box-shadow: none;
|
|
54
70
|
&:hover {
|
|
@@ -66,7 +82,6 @@ const StyledSelectboxButton = (0, styled_1.default)(Button_1.default) `
|
|
|
66
82
|
}
|
|
67
83
|
`}
|
|
68
84
|
transition: none;
|
|
69
|
-
|
|
70
85
|
`;
|
|
71
86
|
// The value has the size of the text in the fields, so the selectbox has the height of the TextField
|
|
72
87
|
const StyledButtonTextWrapper = (0, styled_1.default)(ButtonTextWrapper_1.default) `
|
|
@@ -5,8 +5,8 @@ export type SelectboxButtonWrapperProps = React.HTMLAttributes<HTMLDivElement> &
|
|
|
5
5
|
readonly isOpen: boolean;
|
|
6
6
|
};
|
|
7
7
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
-
readonly fullWidth?: boolean
|
|
9
|
-
readonly error?: boolean
|
|
8
|
+
readonly fullWidth?: boolean;
|
|
9
|
+
readonly error?: boolean;
|
|
10
10
|
readonly isOpen: boolean;
|
|
11
11
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export default _default;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -39,9 +49,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
50
|
const React = __importStar(require("react"));
|
|
41
51
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
52
|
+
const tokens_1 = require("../ThemeProvider/tokens");
|
|
42
53
|
const Wrapper = styled_1.default.div `
|
|
43
54
|
min-width: 16em;
|
|
44
|
-
font-size:
|
|
55
|
+
font-size: ${tokens_1.FIELD_TEXT_SCALE}em;
|
|
45
56
|
text-align: left;
|
|
46
57
|
max-width: ${({ $fullWidth }) => ($fullWidth ? '100%' : '16em')};
|
|
47
58
|
display: flex;
|
|
@@ -52,8 +63,6 @@ const Wrapper = styled_1.default.div `
|
|
|
52
63
|
background-color: ${({ theme }) => theme.color.surface.toString()};
|
|
53
64
|
color: ${({ theme }) => theme.color.textPrimary.toString()};
|
|
54
65
|
transition: all 180ms ease-out 0s;
|
|
55
|
-
|
|
56
|
-
|
|
57
66
|
`;
|
|
58
67
|
const SelectboxButtonWrapper = (props, ref) => {
|
|
59
68
|
const { fullWidth, children, error } = props, nativeProps = __rest(props, ["fullWidth", "children", "error"]);
|
|
@@ -5,6 +5,6 @@ export interface SelectbosMenuProps<T, Multiple extends boolean | undefined = un
|
|
|
5
5
|
readonly onChange?: OnChange<T, Multiple>;
|
|
6
6
|
}
|
|
7
7
|
declare const _default: <T, Multiple extends boolean | undefined = undefined>(props: SelectbosMenuProps<T, Multiple> & {
|
|
8
|
-
ref?: React.Ref<MenuRef
|
|
9
|
-
}) => JSX.Element;
|
|
8
|
+
ref?: React.Ref<MenuRef>;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
10
|
export default _default;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
package/Selectbox/index.d.ts
CHANGED
|
@@ -176,6 +176,6 @@ export type ItemToString<T, Multiple extends boolean | undefined = undefined> =
|
|
|
176
176
|
export type RenderValue<T, Multiple extends boolean | undefined = undefined> = (value: Multiple extends undefined ? T : readonly T[]) => React.ReactNode;
|
|
177
177
|
export type OnChange<T, Multiple extends boolean | undefined = undefined> = (item: Value<T, Multiple>) => void;
|
|
178
178
|
declare const _default: <T, Multiple extends boolean | undefined = undefined>(props: SelectboxProps<T, Multiple> & {
|
|
179
|
-
ref?: React.ForwardedRef<HTMLButtonElement
|
|
180
|
-
}) => JSX.Element;
|
|
179
|
+
ref?: React.ForwardedRef<HTMLButtonElement>;
|
|
180
|
+
}) => React.JSX.Element;
|
|
181
181
|
export default _default;
|
package/Selectbox/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
36
|
var t = {};
|
|
27
37
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -51,7 +61,6 @@ const TextFieldErrorText_1 = __importDefault(require("../TextField/TextFieldErro
|
|
|
51
61
|
const SelectboxButtonWrapper_1 = __importDefault(require("./SelectboxButtonWrapper"));
|
|
52
62
|
const SelectboxContainer_1 = __importDefault(require("./SelectboxContainer"));
|
|
53
63
|
const SelectboxMenu_1 = __importDefault(require("./SelectboxMenu"));
|
|
54
|
-
const useThemeProps_1 = __importDefault(require("../ThemeProvider/useThemeProps"));
|
|
55
64
|
const DEFAULT_OVERRIDES = {
|
|
56
65
|
Button: SelectboxButton_1.default,
|
|
57
66
|
Icon: SelectboxChevronIcon_1.default,
|
|
@@ -62,7 +71,7 @@ const DEFAULT_OVERRIDES = {
|
|
|
62
71
|
Container: SelectboxContainer_1.default,
|
|
63
72
|
};
|
|
64
73
|
const Selectbox = React.forwardRef((props, ref) => {
|
|
65
|
-
const
|
|
74
|
+
const { items, value, multiple, isOpen = false, isLoading = false, anchorPos = 'bottom-fill', fullWidth = false, children, onChange, selectedItemToString, renderValue, getOptionSelected, onRequestOpen = () => undefined, onRequestClose = () => undefined, overrides, id, label, requiredAsterisk, error, errorText, notSetLabel = 'Not set', autoFlip = true, positionStrategy } = props, nativeButtonProps = __rest(props, ["items", "value", "multiple", "isOpen", "isLoading", "anchorPos", "fullWidth", "children", "onChange", "selectedItemToString", "renderValue", "getOptionSelected", "onRequestOpen", "onRequestClose", "overrides", "id", "label", "requiredAsterisk", "error", "errorText", "notSetLabel", "autoFlip", "positionStrategy"]);
|
|
66
75
|
const menuRef = React.useRef(null);
|
|
67
76
|
const [anchorElement, setAnchorElement] = React.useState(null);
|
|
68
77
|
const overridesMap = React.useMemo(() => (Object.assign(Object.assign({}, DEFAULT_OVERRIDES), overrides)), [overrides]);
|
package/Slider/SliderRail.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type SliderRailProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
|
6
6
|
readonly disabled: boolean;
|
|
7
7
|
};
|
|
8
8
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & {
|
|
9
|
-
readonly color?:
|
|
9
|
+
readonly color?: "default" | "primary" | "secondary" | string;
|
|
10
10
|
readonly orientation: SliderOrientation;
|
|
11
11
|
readonly disabled: boolean;
|
|
12
12
|
} & React.RefAttributes<HTMLSpanElement>>;
|
package/Slider/SliderThumb.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type SliderThumbProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
|
18
18
|
readonly index: number;
|
|
19
19
|
};
|
|
20
20
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & {
|
|
21
|
-
readonly color?:
|
|
21
|
+
readonly color?: "default" | "primary" | "secondary" | string;
|
|
22
22
|
readonly orientation: SliderOrientation;
|
|
23
23
|
readonly disabled: boolean;
|
|
24
24
|
/**
|
package/Slider/SliderTrack.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type SliderTrackProps = React.HTMLAttributes<HTMLSpanElement> & {
|
|
|
14
14
|
readonly end: number;
|
|
15
15
|
};
|
|
16
16
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & {
|
|
17
|
-
readonly color?:
|
|
17
|
+
readonly color?: "default" | "primary" | "secondary" | string;
|
|
18
18
|
readonly orientation: SliderOrientation;
|
|
19
19
|
readonly disabled: boolean;
|
|
20
20
|
/**
|
package/Slider/index.js
CHANGED
|
@@ -22,9 +22,8 @@ const SliderThumb_1 = __importDefault(require("./SliderThumb"));
|
|
|
22
22
|
const SliderMark_1 = __importDefault(require("./SliderMark"));
|
|
23
23
|
const SliderMarkLabel_1 = __importDefault(require("./SliderMarkLabel"));
|
|
24
24
|
const utils_1 = require("./utils");
|
|
25
|
-
const useThemeProps_1 = __importDefault(require("../ThemeProvider/useThemeProps"));
|
|
26
25
|
const Slider = (props, ref) => {
|
|
27
|
-
const
|
|
26
|
+
const { value, defaultValue, onChange, onChangeCommitted, min = 0, max = 100, step = 1, marks = false, orientation = 'horizontal', disabled = false, color, name, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledby, getAriaLabel, getAriaValueText, overrides, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, onLostPointerCapture } = props, nativeProps = __rest(props, ["value", "defaultValue", "onChange", "onChangeCommitted", "min", "max", "step", "marks", "orientation", "disabled", "color", "name", 'aria-label', 'aria-labelledby', "getAriaLabel", "getAriaValueText", "overrides", "onPointerDown", "onPointerMove", "onPointerUp", "onPointerCancel", "onLostPointerCapture"]);
|
|
28
27
|
const overridesMap = react_1.default.useMemo(() => ({
|
|
29
28
|
Container: (overrides === null || overrides === void 0 ? void 0 : overrides.Container) || SliderContainer_1.default,
|
|
30
29
|
Rail: (overrides === null || overrides === void 0 ? void 0 : overrides.Rail) || SliderRail_1.default,
|
|
@@ -2,5 +2,5 @@ import Color from '../Color';
|
|
|
2
2
|
/**
|
|
3
3
|
* Resolves the `color` property of the Slider to the Color instance
|
|
4
4
|
*/
|
|
5
|
-
declare const useSliderColor: (color:
|
|
5
|
+
declare const useSliderColor: (color: "default" | "primary" | "secondary" | string | undefined) => Color;
|
|
6
6
|
export default useSliderColor;
|
package/Stack/index.d.ts
CHANGED
|
@@ -29,34 +29,46 @@ export type StackProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
29
29
|
* The stack takes the width of its content (`inline-flex`) instead of the full width
|
|
30
30
|
*/
|
|
31
31
|
readonly inline?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The element of the stack: `ul`, `ol`, `dl`, `nav`, `section` and others.
|
|
34
|
+
* The lists lose the default margins and markers\
|
|
35
|
+
* **Default:** `div`
|
|
36
|
+
*/
|
|
37
|
+
readonly as?: React.ElementType;
|
|
32
38
|
};
|
|
33
39
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
34
40
|
/**
|
|
35
41
|
* `column` — the elements go one under another, `row` — in a line\
|
|
36
42
|
* **Default:** `column`
|
|
37
43
|
*/
|
|
38
|
-
readonly direction?: "
|
|
44
|
+
readonly direction?: "column" | "row";
|
|
39
45
|
/**
|
|
40
46
|
* The gap between the elements: a step of the theme spacing scale or any CSS length\
|
|
41
47
|
* **Default:** `md`
|
|
42
48
|
*/
|
|
43
|
-
readonly gap?: Spacing
|
|
49
|
+
readonly gap?: Spacing;
|
|
44
50
|
/**
|
|
45
51
|
* The alignment across the direction (`align-items`)\
|
|
46
52
|
* **Default:** `stretch` for the column, `center` for the row
|
|
47
53
|
*/
|
|
48
|
-
readonly align?:
|
|
54
|
+
readonly align?: React.CSSProperties["alignItems"];
|
|
49
55
|
/**
|
|
50
56
|
* The alignment along the direction (`justify-content`)
|
|
51
57
|
*/
|
|
52
|
-
readonly justify?:
|
|
58
|
+
readonly justify?: React.CSSProperties["justifyContent"];
|
|
53
59
|
/**
|
|
54
60
|
* The elements of the row wrap to the next line when they do not fit
|
|
55
61
|
*/
|
|
56
|
-
readonly wrap?: boolean
|
|
62
|
+
readonly wrap?: boolean;
|
|
57
63
|
/**
|
|
58
64
|
* The stack takes the width of its content (`inline-flex`) instead of the full width
|
|
59
65
|
*/
|
|
60
|
-
readonly inline?: boolean
|
|
66
|
+
readonly inline?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The element of the stack: `ul`, `ol`, `dl`, `nav`, `section` and others.
|
|
69
|
+
* The lists lose the default margins and markers\
|
|
70
|
+
* **Default:** `div`
|
|
71
|
+
*/
|
|
72
|
+
readonly as?: React.ElementType;
|
|
61
73
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
62
74
|
export default _default;
|
package/Stack/index.js
CHANGED
|
@@ -17,6 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
19
|
const spacing_1 = require("../utils/spacing");
|
|
20
|
+
/**
|
|
21
|
+
* The lists are the rows of the elements here: no default margins and markers
|
|
22
|
+
*/
|
|
23
|
+
const LIST_TAGS = ['ul', 'ol', 'dl'];
|
|
20
24
|
const StyledStack = styled_1.default.div `
|
|
21
25
|
display: ${({ $inline }) => ($inline ? 'inline-flex' : 'flex')};
|
|
22
26
|
flex-direction: ${({ $direction }) => $direction};
|
|
@@ -26,13 +30,14 @@ const StyledStack = styled_1.default.div `
|
|
|
26
30
|
gap: ${({ theme, $gap }) => (0, spacing_1.resolveSpacing)(theme, $gap)};
|
|
27
31
|
/* A flex child shrinks below its content only with min-width: 0 */
|
|
28
32
|
min-width: 0;
|
|
33
|
+
${({ $isList }) => ($isList ? 'margin: 0; padding: 0; list-style: none;' : '')}
|
|
29
34
|
`;
|
|
30
35
|
/**
|
|
31
36
|
* The elements in a column or in a row with the same gap between them.
|
|
32
37
|
* The children stay the plain elements: no wrappers for the items
|
|
33
38
|
*/
|
|
34
39
|
const Stack = (props, ref) => {
|
|
35
|
-
const { children, direction = 'column', gap = 'md', align, justify, wrap = false, inline = false } = props, nativeProps = __rest(props, ["children", "direction", "gap", "align", "justify", "wrap", "inline"]);
|
|
36
|
-
return (react_1.default.createElement(StyledStack, Object.assign({}, nativeProps, { "$direction": direction, "$gap": gap, "$align": align, "$justify": justify, "$wrap": wrap, "$inline": inline, ref: ref }), children));
|
|
40
|
+
const { children, direction = 'column', gap = 'md', align, justify, wrap = false, inline = false, as } = props, nativeProps = __rest(props, ["children", "direction", "gap", "align", "justify", "wrap", "inline", "as"]);
|
|
41
|
+
return (react_1.default.createElement(StyledStack, Object.assign({}, nativeProps, { "$direction": direction, "$gap": gap, "$align": align, "$justify": justify, "$wrap": wrap, "$inline": inline, "$isList": Boolean(as && LIST_TAGS.includes(as)), as: as, ref: ref }), children));
|
|
37
42
|
};
|
|
38
43
|
exports.default = react_1.default.forwardRef(Stack);
|
|
@@ -5,8 +5,8 @@ export type SurfaceContainerProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
5
5
|
readonly noPadding?: boolean;
|
|
6
6
|
};
|
|
7
7
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
8
|
-
readonly inline?: boolean
|
|
9
|
-
readonly rounded?: boolean
|
|
10
|
-
readonly noPadding?: boolean
|
|
8
|
+
readonly inline?: boolean;
|
|
9
|
+
readonly rounded?: boolean;
|
|
10
|
+
readonly noPadding?: boolean;
|
|
11
11
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
12
|
export default _default;
|
|
@@ -24,7 +24,7 @@ const StyledSurfaceContainer = styled_1.default.div `
|
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
background: ${({ theme }) => theme.color.surface.toString()};
|
|
26
26
|
color: ${({ theme }) => theme.color.textPrimary.toString()};
|
|
27
|
-
box-shadow: ${({ theme }) => (0, tokens_1.elevation)(theme, 'surface'
|
|
27
|
+
box-shadow: ${({ theme }) => (0, tokens_1.elevation)(theme, 'surface')};
|
|
28
28
|
border-radius: ${({ theme }) => theme.shape.radiusFactor}em;
|
|
29
29
|
font-size: 1em;
|
|
30
30
|
|
|
@@ -4,7 +4,7 @@ export type SurfaceContentProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
4
4
|
readonly rounded?: boolean;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
-
readonly noPadding?: boolean
|
|
8
|
-
readonly rounded?: boolean
|
|
7
|
+
readonly noPadding?: boolean;
|
|
8
|
+
readonly rounded?: boolean;
|
|
9
9
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export default _default;
|
|
@@ -17,20 +17,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
19
|
const react_2 = require("@emotion/react");
|
|
20
|
+
const tokens_1 = require("../ThemeProvider/tokens");
|
|
20
21
|
const StyledContent = styled_1.default.div `
|
|
21
22
|
flex: 1;
|
|
22
|
-
${({ $noPadding }) =>
|
|
23
|
-
(0,
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
${({ $noPadding, theme }) => {
|
|
24
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
25
|
+
return (!$noPadding &&
|
|
26
|
+
(0, react_2.css) `
|
|
27
|
+
padding: calc(${y} * 1.4) ${x} ${y} ${x};
|
|
28
|
+
`);
|
|
29
|
+
}}
|
|
26
30
|
|
|
27
|
-
${({ $rounded, $noPadding }) =>
|
|
28
|
-
(0,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
${({ $rounded, $noPadding, theme }) => {
|
|
32
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
33
|
+
return ($rounded &&
|
|
34
|
+
(0, react_2.css) `
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
padding: ${$noPadding ? '0' : `${y} ${x}`};
|
|
39
|
+
`);
|
|
40
|
+
}}
|
|
34
41
|
`;
|
|
35
42
|
const SurfaceContent = (props, ref) => {
|
|
36
43
|
const { children, noPadding, rounded } = props, nativeProps = __rest(props, ["children", "noPadding", "rounded"]);
|
|
@@ -4,7 +4,7 @@ export type SurfaceFooterProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
4
4
|
readonly rounded?: boolean;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
-
readonly noPadding?: boolean
|
|
8
|
-
readonly rounded?: boolean
|
|
7
|
+
readonly noPadding?: boolean;
|
|
8
|
+
readonly rounded?: boolean;
|
|
9
9
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export default _default;
|
package/Surface/SurfaceFooter.js
CHANGED
|
@@ -16,11 +16,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const tokens_1 = require("../ThemeProvider/tokens");
|
|
19
20
|
const StyledFooter = styled_1.default.div `
|
|
20
21
|
display: flex;
|
|
21
22
|
align-items: center;
|
|
22
23
|
justify-content: flex-end;
|
|
23
|
-
padding: ${({ $noPadding }) =>
|
|
24
|
+
padding: ${({ $noPadding, theme }) => {
|
|
25
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container');
|
|
26
|
+
return $noPadding ? '0' : `${y} ${x}`;
|
|
27
|
+
}};
|
|
24
28
|
border-bottom-left-radius: inherit;
|
|
25
29
|
border-bottom-right-radius: inherit;
|
|
26
30
|
`;
|
|
@@ -4,7 +4,7 @@ export type SurfaceHeaderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
4
4
|
readonly rounded?: boolean;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
-
readonly noPadding?: boolean
|
|
8
|
-
readonly rounded?: boolean
|
|
7
|
+
readonly noPadding?: boolean;
|
|
8
|
+
readonly rounded?: boolean;
|
|
9
9
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export default _default;
|
package/Surface/SurfaceHeader.js
CHANGED
|
@@ -16,9 +16,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const tokens_1 = require("../ThemeProvider/tokens");
|
|
19
20
|
const StyledHeader = styled_1.default.div `
|
|
20
|
-
padding: ${({ $noPadding }) =>
|
|
21
|
-
|
|
21
|
+
padding: ${({ $noPadding, theme }) => {
|
|
22
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container', 1.3);
|
|
23
|
+
return $noPadding ? '0' : `${y} ${x} 0 ${x}`;
|
|
24
|
+
}};
|
|
25
|
+
font-size: 1.3em;
|
|
22
26
|
font-weight: 600;
|
|
23
27
|
border-top-left-radius: inherit;
|
|
24
28
|
border-top-right-radius: inherit;
|
|
@@ -4,7 +4,7 @@ export type SurfaceSubheaderProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
4
4
|
readonly rounded?: boolean;
|
|
5
5
|
};
|
|
6
6
|
declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
-
readonly noPadding?: boolean
|
|
8
|
-
readonly rounded?: boolean
|
|
7
|
+
readonly noPadding?: boolean;
|
|
8
|
+
readonly rounded?: boolean;
|
|
9
9
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
10
|
export default _default;
|
|
@@ -16,9 +16,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
const react_1 = __importDefault(require("react"));
|
|
18
18
|
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
19
|
+
const tokens_1 = require("../ThemeProvider/tokens");
|
|
19
20
|
const StyledHeader = styled_1.default.div `
|
|
20
|
-
padding: ${({ $noPadding }) =>
|
|
21
|
-
|
|
21
|
+
padding: ${({ $noPadding, theme }) => {
|
|
22
|
+
const { y, x } = (0, tokens_1.themePadding)(theme, 'container', 0.9);
|
|
23
|
+
return $noPadding ? '0' : `calc(${y} / 2) ${x} 0 ${x}`;
|
|
24
|
+
}};
|
|
25
|
+
font-size: 0.9em;
|
|
22
26
|
font-weight: 200;
|
|
23
27
|
color: ${({ theme }) => theme.color.textSecondary.toString()};
|
|
24
28
|
`;
|
package/Surface/index.d.ts
CHANGED
|
@@ -9,15 +9,15 @@ export type SurfaceProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
9
9
|
/**
|
|
10
10
|
* Header content
|
|
11
11
|
*/
|
|
12
|
-
readonly header?: JSX.Element | string;
|
|
12
|
+
readonly header?: React.JSX.Element | string;
|
|
13
13
|
/**
|
|
14
14
|
* Footer content
|
|
15
15
|
*/
|
|
16
|
-
readonly footer?: JSX.Element | string;
|
|
16
|
+
readonly footer?: React.JSX.Element | string;
|
|
17
17
|
/**
|
|
18
18
|
* Subheader content
|
|
19
19
|
*/
|
|
20
|
-
readonly subheader?: JSX.Element | string;
|
|
20
|
+
readonly subheader?: React.JSX.Element | string;
|
|
21
21
|
/**
|
|
22
22
|
* If true then surface will be inline-flex element, and the flex otherwise
|
|
23
23
|
*/
|
|
@@ -62,30 +62,30 @@ declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTM
|
|
|
62
62
|
/**
|
|
63
63
|
* Header content
|
|
64
64
|
*/
|
|
65
|
-
readonly header?:
|
|
65
|
+
readonly header?: React.JSX.Element | string;
|
|
66
66
|
/**
|
|
67
67
|
* Footer content
|
|
68
68
|
*/
|
|
69
|
-
readonly footer?:
|
|
69
|
+
readonly footer?: React.JSX.Element | string;
|
|
70
70
|
/**
|
|
71
71
|
* Subheader content
|
|
72
72
|
*/
|
|
73
|
-
readonly subheader?:
|
|
73
|
+
readonly subheader?: React.JSX.Element | string;
|
|
74
74
|
/**
|
|
75
75
|
* If true then surface will be inline-flex element, and the flex otherwise
|
|
76
76
|
*/
|
|
77
|
-
readonly inline?: boolean
|
|
77
|
+
readonly inline?: boolean;
|
|
78
78
|
/**
|
|
79
79
|
* The surface will be rounded
|
|
80
80
|
*/
|
|
81
|
-
readonly rounded?: boolean
|
|
81
|
+
readonly rounded?: boolean;
|
|
82
82
|
/**
|
|
83
83
|
* If true then surface does not contin any paddings
|
|
84
84
|
*/
|
|
85
|
-
readonly noPadding?: boolean
|
|
85
|
+
readonly noPadding?: boolean;
|
|
86
86
|
/**
|
|
87
87
|
* Overridable components map
|
|
88
88
|
*/
|
|
89
|
-
readonly overrides?: SurfaceOverrides
|
|
89
|
+
readonly overrides?: SurfaceOverrides;
|
|
90
90
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
91
91
|
export default _default;
|