@citygross/components 0.16.10 → 0.16.12
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/build/@types/components/FormElements/Checkbox/Checkbox.styles.d.ts +1 -0
- package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +1 -1
- package/build/cjs/components/src/components/DeliverySlotItem/DeliverySlotItem.js +6 -6
- package/build/cjs/components/src/components/DeliveryTimeBlock/DeliveryTimeBlock.js +3 -4
- package/build/cjs/components/src/components/DeliveryTimeBlock/DeliveryTimeBlock.js.map +1 -1
- package/build/cjs/components/src/components/FormElements/Checkbox/Checkbox.js +4 -5
- package/build/cjs/components/src/components/FormElements/Checkbox/Checkbox.js.map +1 -1
- package/build/cjs/components/src/components/FormElements/Checkbox/Checkbox.styles.js +3 -1
- package/build/cjs/components/src/components/FormElements/Checkbox/Checkbox.styles.js.map +1 -1
- package/build/cjs/utils/build/index.js +3292 -18308
- package/build/cjs/utils/build/index.js.map +1 -1
- package/build/es/components/src/components/AddressBlock/AddressBlock.js +1 -1
- package/build/es/components/src/components/DeliverySlotItem/DeliverySlotItem.js +7 -7
- package/build/es/components/src/components/DeliveryTimeBlock/DeliveryTimeBlock.js +4 -5
- package/build/es/components/src/components/DeliveryTimeBlock/DeliveryTimeBlock.js.map +1 -1
- package/build/es/components/src/components/FormElements/Checkbox/Checkbox.js +6 -7
- package/build/es/components/src/components/FormElements/Checkbox/Checkbox.js.map +1 -1
- package/build/es/components/src/components/FormElements/Checkbox/Checkbox.styles.js +3 -2
- package/build/es/components/src/components/FormElements/Checkbox/Checkbox.styles.js.map +1 -1
- package/build/es/utils/build/index.js +3292 -18308
- package/build/es/utils/build/index.js.map +1 -1
- package/package.json +3 -4
- package/build/cjs/_virtual/_commonjsHelpers.js +0 -8
- package/build/cjs/_virtual/_commonjsHelpers.js.map +0 -1
- package/build/es/_virtual/_commonjsHelpers.js +0 -4
- package/build/es/_virtual/_commonjsHelpers.js.map +0 -1
|
@@ -43,11 +43,11 @@ import '../Flex/Flex.styles.js';
|
|
|
43
43
|
import '../Form/Form.styles.js';
|
|
44
44
|
import '../FormControl/FormControl.js';
|
|
45
45
|
import '../FormElements/FormElement.types.js';
|
|
46
|
-
import '../ScreenReader/ScreenReader.styles.js';
|
|
47
46
|
import '../FormElements/FormElement.styles.js';
|
|
48
47
|
import '../FormElements/Checkbox/Checkbox.styles.js';
|
|
49
48
|
import '../FormElements/Input/Input.js';
|
|
50
49
|
import '../FormElements/InputOld/InputOld.styles.js';
|
|
50
|
+
import '../ScreenReader/ScreenReader.styles.js';
|
|
51
51
|
import '../FormElements/Radio/Radio.styles.js';
|
|
52
52
|
import '../FormElements/Select/Select.styles.js';
|
|
53
53
|
import '../FormElements/Switch/Switch.styles.js';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
2
|
import { BodyText, TextTypes } from '@citygross/typography';
|
|
3
|
-
import {
|
|
3
|
+
import { getDateInfo, useWindowSize, capitalizeFirstLetter, formatLeadingZero } from '@citygross/utils';
|
|
4
4
|
import { DeliverySlotItemContainer, DeliverySlotContainer, DeliverySlotHeaderText, DeliverySlotBody } from './DeliverySlotItem.styles.js';
|
|
5
5
|
|
|
6
6
|
function DeliverySlotItem(_a) {
|
|
7
7
|
var date = _a.date, selected = _a.selected, children = _a.children, onSelect = _a.onSelect, icon = _a.icon;
|
|
8
|
-
var
|
|
8
|
+
var dateInfo = getDateInfo(date);
|
|
9
9
|
var width = useWindowSize().width;
|
|
10
|
-
var _b = useState(
|
|
11
|
-
var dayNumber =
|
|
12
|
-
var month =
|
|
10
|
+
var _b = useState(dateInfo.day.name.toLocaleLowerCase()), weekDay = _b[0], setWeekDay = _b[1];
|
|
11
|
+
var dayNumber = dateInfo.day.number;
|
|
12
|
+
var month = dateInfo.month.name.toLocaleLowerCase();
|
|
13
13
|
useEffect(function () {
|
|
14
|
-
setWeekDay(
|
|
15
|
-
}, [width]);
|
|
14
|
+
setWeekDay(dateInfo.day.name.toLocaleLowerCase());
|
|
15
|
+
}, [dateInfo.day.name, width]);
|
|
16
16
|
var slotRef = useRef(null);
|
|
17
17
|
return (React.createElement(DeliverySlotItemContainer, { onClick: onSelect, onKeyDown: function (event) {
|
|
18
18
|
if (event.key === 'Enter') {
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { H3, BodyText } from '@citygross/typography';
|
|
3
|
-
import {
|
|
3
|
+
import { formatDateToLocale } from '@citygross/utils';
|
|
4
4
|
import { DeliveryTimeBlock as DeliveryTimeBlock$1, DeliverOption } from './DeliveryTimeBlock.styles.js';
|
|
5
5
|
|
|
6
6
|
function DeliveryTimeBlock(_a) {
|
|
7
|
-
var _b,
|
|
8
|
-
var deliveryDate = _a.deliveryDate, deliveryFromTime = _a.deliveryFromTime, deliveryToTime = _a.deliveryToTime, icon = _a.icon, _d = _a.localTimeVar, localTimeVar = _d === void 0 ? 'kl' : _d, deliverOption = _a.deliverOption, children = _a.children;
|
|
7
|
+
var deliveryDate = _a.deliveryDate, deliveryFromTime = _a.deliveryFromTime, deliveryToTime = _a.deliveryToTime, icon = _a.icon, _b = _a.localTimeVar, localTimeVar = _b === void 0 ? 'kl' : _b, deliverOption = _a.deliverOption, children = _a.children;
|
|
9
8
|
return (React.createElement(DeliveryTimeBlock$1, null,
|
|
10
9
|
React.createElement(DeliverOption, null,
|
|
11
10
|
icon && icon,
|
|
12
11
|
deliverOption && React.createElement(H3, null, deliverOption)),
|
|
13
|
-
React.createElement(BodyText, null,
|
|
14
|
-
|
|
12
|
+
React.createElement(BodyText, null,
|
|
13
|
+
formatDateToLocale(deliveryDate, false, true),
|
|
15
14
|
' ',
|
|
16
15
|
deliveryFromTime && deliveryToTime && (React.createElement("span", { style: { whiteSpace: 'nowrap' } }, "".concat(localTimeVar, " ").concat(deliveryFromTime, " - ").concat(deliveryToTime)))),
|
|
17
16
|
children));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeliveryTimeBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DeliveryTimeBlock.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,19 +3,18 @@ import React from 'react';
|
|
|
3
3
|
import { Icons } from '@citygross/icons';
|
|
4
4
|
import { BodyText } from '@citygross/typography';
|
|
5
5
|
import { getColorAttributes } from '../../../helpers/form-element.js';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { CheckboxContainer, IconContainer } from './Checkbox.styles.js';
|
|
6
|
+
import { OptionInputWrapper } from '../FormElement.styles.js';
|
|
7
|
+
import { CheckboxInput, CheckboxContainer, IconContainer } from './Checkbox.styles.js';
|
|
9
8
|
|
|
10
9
|
var Checkbox = function (_a) {
|
|
11
10
|
var alignItems = _a.alignItems, checked = _a.checked, disabled = _a.disabled, hideLabel = _a.hideLabel, label = _a.label, props = __rest(_a, ["alignItems", "checked", "disabled", "hideLabel", "label"]);
|
|
12
11
|
var _b = getColorAttributes(checked, disabled), iconColor = _b.iconColor, labelColor = _b.labelColor, attributes = __rest(_b, ["iconColor", "labelColor"]);
|
|
13
12
|
return (React.createElement(OptionInputWrapper, { alignItems: alignItems, as: "label", disabled: disabled },
|
|
14
|
-
React.createElement(
|
|
15
|
-
React.createElement(CheckboxContainer, { attributes: attributes, alignItems: alignItems },
|
|
13
|
+
React.createElement(CheckboxInput, __assign({ "aria-label": label, checked: checked, disabled: disabled, type: "checkbox" }, props)),
|
|
14
|
+
React.createElement(CheckboxContainer, { "aria-hidden": "true", attributes: attributes, alignItems: alignItems },
|
|
16
15
|
React.createElement(IconContainer, null,
|
|
17
|
-
React.createElement(Icons.CheckMark, { color: iconColor
|
|
18
|
-
hideLabel
|
|
16
|
+
React.createElement(Icons.CheckMark, { color: iconColor }))),
|
|
17
|
+
!hideLabel && (React.createElement(BodyText, { "aria-hidden": "true", color: labelColor }, label))));
|
|
19
18
|
};
|
|
20
19
|
|
|
21
20
|
export { Checkbox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -30,7 +30,8 @@ var CheckboxContainer = styled.div(templateObject_2 || (templateObject_2 = __mak
|
|
|
30
30
|
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n --checkbox-hover-bg: ", ";\n\n ", ":hover & {\n background: var(--checkbox-hover-bg);\n }\n "], ["\n --checkbox-hover-bg: ", ";\n\n ", ":hover & {\n background: var(--checkbox-hover-bg);\n }\n "])), (_b = attributes.hoverBackgroundColor) !== null && _b !== void 0 ? _b : attributes.backgroundColor, OptionInputWrapper);
|
|
31
31
|
});
|
|
32
32
|
var IconContainer = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n"])));
|
|
33
|
-
var
|
|
33
|
+
var CheckboxInput = styled.input(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n"], ["\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n margin: 0;\n opacity: 0;\n cursor: inherit;\n"])));
|
|
34
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
34
35
|
|
|
35
|
-
export { CheckboxContainer, IconContainer };
|
|
36
|
+
export { CheckboxContainer, CheckboxInput, IconContainer };
|
|
36
37
|
//# sourceMappingURL=Checkbox.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Checkbox.styles.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|