@uxf/ui 11.29.0 → 11.30.1
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/components.d.ts +20 -20
- package/components.js +20 -20
- package/css/colors.css +2 -0
- package/css/dialog.css +1 -1
- package/css/modal-header.css +6 -2
- package/css/text-link.css +18 -3
- package/css/toggle.css +100 -16
- package/datetime-picker-input/datetime-picker-input.js +3 -4
- package/datetime-picker-input/get-datetime-string.d.ts +6 -0
- package/datetime-picker-input/get-datetime-string.js +19 -0
- package/icons-config.js +5 -0
- package/package.json +1 -1
- package/readmes.d.ts +4 -4
- package/readmes.js +40 -40
- package/text-link/theme.d.ts +1 -0
- package/toggle/theme.d.ts +5 -0
- package/toggle/toggle.d.ts +2 -1
- package/toggle/toggle.js +3 -3
- package/toggle/toggle.stories.js +1 -0
package/components.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ import * as buttonStories from "./button/button.stories";
|
|
|
6
6
|
import * as buttonGroupStories from "./button-group/button-group.stories";
|
|
7
7
|
import * as buttonListStories from "./button-list/button-list.stories";
|
|
8
8
|
import * as calendarStories from "./calendar/calendar.stories";
|
|
9
|
+
import * as checkboxStories from "./checkbox/checkbox.stories";
|
|
10
|
+
import * as checkboxButtonStories from "./checkbox-button/checkbox-button.stories";
|
|
11
|
+
import * as checkboxInputStories from "./checkbox-input/checkbox-input.stories";
|
|
12
|
+
import * as chipStories from "./chip/chip.stories";
|
|
9
13
|
import * as colorRadioStories from "./color-radio/color-radio.stories";
|
|
10
14
|
import * as colorRadioGroupStories from "./color-radio-group/color-radio-group.stories";
|
|
11
15
|
import * as comboboxStories from "./combobox/combobox.stories";
|
|
@@ -22,10 +26,6 @@ import * as errorMessageStories from "./error-message/error-message.stories";
|
|
|
22
26
|
import * as fileInputStories from "./file-input/file-input.stories";
|
|
23
27
|
import * as flashMessagesStories from "./flash-messages/flash-messages.stories";
|
|
24
28
|
import * as formComponentStories from "./form-component/form-component.stories";
|
|
25
|
-
import * as checkboxStories from "./checkbox/checkbox.stories";
|
|
26
|
-
import * as checkboxButtonStories from "./checkbox-button/checkbox-button.stories";
|
|
27
|
-
import * as checkboxInputStories from "./checkbox-input/checkbox-input.stories";
|
|
28
|
-
import * as chipStories from "./chip/chip.stories";
|
|
29
29
|
import * as iconStories from "./icon/icon.stories";
|
|
30
30
|
import * as imageGalleryStories from "./image-gallery/image-gallery.stories";
|
|
31
31
|
import * as inputStories from "./input/input.stories";
|
|
@@ -88,6 +88,22 @@ export declare const components: {
|
|
|
88
88
|
readonly title: "Calendar";
|
|
89
89
|
readonly stories: typeof calendarStories;
|
|
90
90
|
};
|
|
91
|
+
readonly checkbox: {
|
|
92
|
+
readonly title: "Checkbox";
|
|
93
|
+
readonly stories: typeof checkboxStories;
|
|
94
|
+
};
|
|
95
|
+
readonly "checkbox-button": {
|
|
96
|
+
readonly title: "CheckboxButton";
|
|
97
|
+
readonly stories: typeof checkboxButtonStories;
|
|
98
|
+
};
|
|
99
|
+
readonly "checkbox-input": {
|
|
100
|
+
readonly title: "CheckboxInput";
|
|
101
|
+
readonly stories: typeof checkboxInputStories;
|
|
102
|
+
};
|
|
103
|
+
readonly chip: {
|
|
104
|
+
readonly title: "Chip";
|
|
105
|
+
readonly stories: typeof chipStories;
|
|
106
|
+
};
|
|
91
107
|
readonly "color-radio": {
|
|
92
108
|
readonly title: "ColorRadio";
|
|
93
109
|
readonly stories: typeof colorRadioStories;
|
|
@@ -152,22 +168,6 @@ export declare const components: {
|
|
|
152
168
|
readonly title: "FormComponent";
|
|
153
169
|
readonly stories: typeof formComponentStories;
|
|
154
170
|
};
|
|
155
|
-
readonly checkbox: {
|
|
156
|
-
readonly title: "Checkbox";
|
|
157
|
-
readonly stories: typeof checkboxStories;
|
|
158
|
-
};
|
|
159
|
-
readonly "checkbox-button": {
|
|
160
|
-
readonly title: "CheckboxButton";
|
|
161
|
-
readonly stories: typeof checkboxButtonStories;
|
|
162
|
-
};
|
|
163
|
-
readonly "checkbox-input": {
|
|
164
|
-
readonly title: "CheckboxInput";
|
|
165
|
-
readonly stories: typeof checkboxInputStories;
|
|
166
|
-
};
|
|
167
|
-
readonly chip: {
|
|
168
|
-
readonly title: "Chip";
|
|
169
|
-
readonly stories: typeof chipStories;
|
|
170
|
-
};
|
|
171
171
|
readonly icon: {
|
|
172
172
|
readonly title: "Icon";
|
|
173
173
|
readonly stories: typeof iconStories;
|
package/components.js
CHANGED
|
@@ -33,6 +33,10 @@ const buttonStories = __importStar(require("./button/button.stories"));
|
|
|
33
33
|
const buttonGroupStories = __importStar(require("./button-group/button-group.stories"));
|
|
34
34
|
const buttonListStories = __importStar(require("./button-list/button-list.stories"));
|
|
35
35
|
const calendarStories = __importStar(require("./calendar/calendar.stories"));
|
|
36
|
+
const checkboxStories = __importStar(require("./checkbox/checkbox.stories"));
|
|
37
|
+
const checkboxButtonStories = __importStar(require("./checkbox-button/checkbox-button.stories"));
|
|
38
|
+
const checkboxInputStories = __importStar(require("./checkbox-input/checkbox-input.stories"));
|
|
39
|
+
const chipStories = __importStar(require("./chip/chip.stories"));
|
|
36
40
|
const colorRadioStories = __importStar(require("./color-radio/color-radio.stories"));
|
|
37
41
|
const colorRadioGroupStories = __importStar(require("./color-radio-group/color-radio-group.stories"));
|
|
38
42
|
const comboboxStories = __importStar(require("./combobox/combobox.stories"));
|
|
@@ -49,10 +53,6 @@ const errorMessageStories = __importStar(require("./error-message/error-message.
|
|
|
49
53
|
const fileInputStories = __importStar(require("./file-input/file-input.stories"));
|
|
50
54
|
const flashMessagesStories = __importStar(require("./flash-messages/flash-messages.stories"));
|
|
51
55
|
const formComponentStories = __importStar(require("./form-component/form-component.stories"));
|
|
52
|
-
const checkboxStories = __importStar(require("./checkbox/checkbox.stories"));
|
|
53
|
-
const checkboxButtonStories = __importStar(require("./checkbox-button/checkbox-button.stories"));
|
|
54
|
-
const checkboxInputStories = __importStar(require("./checkbox-input/checkbox-input.stories"));
|
|
55
|
-
const chipStories = __importStar(require("./chip/chip.stories"));
|
|
56
56
|
const iconStories = __importStar(require("./icon/icon.stories"));
|
|
57
57
|
const imageGalleryStories = __importStar(require("./image-gallery/image-gallery.stories"));
|
|
58
58
|
const inputStories = __importStar(require("./input/input.stories"));
|
|
@@ -115,6 +115,22 @@ exports.components = {
|
|
|
115
115
|
title: "Calendar",
|
|
116
116
|
stories: calendarStories
|
|
117
117
|
},
|
|
118
|
+
"checkbox": {
|
|
119
|
+
title: "Checkbox",
|
|
120
|
+
stories: checkboxStories
|
|
121
|
+
},
|
|
122
|
+
"checkbox-button": {
|
|
123
|
+
title: "CheckboxButton",
|
|
124
|
+
stories: checkboxButtonStories
|
|
125
|
+
},
|
|
126
|
+
"checkbox-input": {
|
|
127
|
+
title: "CheckboxInput",
|
|
128
|
+
stories: checkboxInputStories
|
|
129
|
+
},
|
|
130
|
+
"chip": {
|
|
131
|
+
title: "Chip",
|
|
132
|
+
stories: chipStories
|
|
133
|
+
},
|
|
118
134
|
"color-radio": {
|
|
119
135
|
title: "ColorRadio",
|
|
120
136
|
stories: colorRadioStories
|
|
@@ -179,22 +195,6 @@ exports.components = {
|
|
|
179
195
|
title: "FormComponent",
|
|
180
196
|
stories: formComponentStories
|
|
181
197
|
},
|
|
182
|
-
"checkbox": {
|
|
183
|
-
title: "Checkbox",
|
|
184
|
-
stories: checkboxStories
|
|
185
|
-
},
|
|
186
|
-
"checkbox-button": {
|
|
187
|
-
title: "CheckboxButton",
|
|
188
|
-
stories: checkboxButtonStories
|
|
189
|
-
},
|
|
190
|
-
"checkbox-input": {
|
|
191
|
-
title: "CheckboxInput",
|
|
192
|
-
stories: checkboxInputStories
|
|
193
|
-
},
|
|
194
|
-
"chip": {
|
|
195
|
-
title: "Chip",
|
|
196
|
-
stories: chipStories
|
|
197
|
-
},
|
|
198
198
|
"icon": {
|
|
199
199
|
title: "Icon",
|
|
200
200
|
stories: iconStories
|
package/css/colors.css
CHANGED
|
@@ -37,6 +37,8 @@
|
|
|
37
37
|
--uxf-color-warning-border: #fec84b;
|
|
38
38
|
--uxf-color-warning-surface-default: #dc6803;
|
|
39
39
|
--uxf-color-warning-surface-default-hover: #b54707;
|
|
40
|
+
--uxf-color-warning-surface-muted: #fef0c7;
|
|
41
|
+
--uxf-color-warning-icon-on-muted: #b54707;
|
|
40
42
|
|
|
41
43
|
/** info */
|
|
42
44
|
--uxf-color-info-text: #3e4783;
|
package/css/dialog.css
CHANGED
package/css/modal-header.css
CHANGED
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
font-size: var(--uxf-modal-header-title-font-size);
|
|
23
23
|
font-weight: var(--uxf-modal-header-title-font-weight);
|
|
24
24
|
line-height: var(--uxf-modal-header-title-line-height);
|
|
25
|
-
padding: theme("spacing.
|
|
25
|
+
padding: theme("spacing.3") theme("spacing.2") theme("spacing.3") theme("spacing.4");
|
|
26
26
|
width: 100%;
|
|
27
27
|
|
|
28
28
|
&--has-go-back {
|
|
29
|
-
padding: theme("spacing.2");
|
|
29
|
+
padding: theme("spacing.3") theme("spacing.2");
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
&__text-wrapper {
|
|
@@ -34,6 +34,10 @@
|
|
|
34
34
|
padding: theme("spacing.1");
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
&__title {
|
|
38
|
+
padding-top: 1px;
|
|
39
|
+
}
|
|
40
|
+
|
|
37
41
|
&__description {
|
|
38
42
|
color: var(--uxf-modal-header-description-text-color);
|
|
39
43
|
font-size: var(--uxf-modal-header-description-font-size);
|
package/css/text-link.css
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
.uxf-text-link {
|
|
2
|
-
@apply
|
|
3
|
-
transition before:absolute
|
|
4
|
-
before:-inset-1 focus-visible:before:rounded-lg focus-visible:before:border-2;
|
|
2
|
+
@apply relative underline outline-none transition before:absolute before:-inset-1 focus-visible:before:rounded-lg focus-visible:before:border-2;
|
|
5
3
|
|
|
6
4
|
:root .dark & {
|
|
7
5
|
@apply text-primary focus-visible:before:border-primary is-hoverable:text-primary-400;
|
|
8
6
|
}
|
|
7
|
+
|
|
8
|
+
&--variant-default {
|
|
9
|
+
color: var(--uxf-color-primary-surface-default);
|
|
10
|
+
|
|
11
|
+
@apply is-hoverable:text-[--uxf-color-primary-surface-default-hover] focus-visible:before:border-[--uxf-color-primary-surface-default];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&--variant-text {
|
|
15
|
+
color: var(--uxf-color-base-text-high-emphasis);
|
|
16
|
+
|
|
17
|
+
@apply is-hoverable:text-[--uxf-color-base-text-low-emphasis] focus-visible:before:border-[--uxf-color-base-text-high-emphasis];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.is-disabled {
|
|
21
|
+
color: var(--uxf-color-base-text-disabled);
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
}
|
|
9
24
|
}
|
package/css/toggle.css
CHANGED
|
@@ -1,59 +1,143 @@
|
|
|
1
1
|
.uxf-toggle {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
--uxf-toggle-selected-color: var(--uxf-color-primary-surface-default);
|
|
3
|
+
|
|
4
|
+
align-items: center;
|
|
5
|
+
background-color: theme("colors.gray.200");
|
|
6
|
+
border-radius: theme("borderRadius.full");
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
flex-shrink: 0;
|
|
9
|
+
outline: none;
|
|
10
|
+
padding: 2px;
|
|
11
|
+
position: relative;
|
|
12
|
+
|
|
13
|
+
@apply ring-offset-2 focus-visible:ring-2 focus-visible:ring-[--uxf-toggle-selected-color];
|
|
14
|
+
|
|
15
|
+
&--size-default {
|
|
16
|
+
height: 24px;
|
|
17
|
+
width: 48px;
|
|
18
|
+
|
|
19
|
+
.uxf-toggle__inner {
|
|
20
|
+
height: 20px;
|
|
21
|
+
width: 20px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:active {
|
|
25
|
+
.uxf-toggle__inner {
|
|
26
|
+
width: 30px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&--size-sm {
|
|
32
|
+
height: 16px;
|
|
33
|
+
width: 28px;
|
|
34
|
+
|
|
35
|
+
.uxf-toggle__inner {
|
|
36
|
+
height: 12px;
|
|
37
|
+
width: 12px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&:active {
|
|
41
|
+
.uxf-toggle__inner {
|
|
42
|
+
width: 16px;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
4
46
|
|
|
5
47
|
:root .dark & {
|
|
6
|
-
|
|
48
|
+
background-color: theme("colors.gray.400");
|
|
49
|
+
|
|
50
|
+
@apply focus-visible:ring-[--uxf-toggle-background-color] focus-visible:ring-offset-gray-900;
|
|
7
51
|
}
|
|
8
52
|
|
|
9
53
|
&__wrapper {
|
|
10
|
-
|
|
54
|
+
align-items: center;
|
|
55
|
+
display: flex;
|
|
56
|
+
gap: 16px;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
padding: 16px;
|
|
11
59
|
|
|
12
60
|
&--reversed {
|
|
13
|
-
|
|
61
|
+
flex-direction: row-reverse;
|
|
14
62
|
|
|
15
63
|
.uxf-toggle__label {
|
|
16
|
-
|
|
64
|
+
padding-right: 16px;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&--size-sm {
|
|
69
|
+
.uxf-toggle__label {
|
|
70
|
+
font-size: 14px;
|
|
17
71
|
}
|
|
18
72
|
}
|
|
19
73
|
}
|
|
20
74
|
|
|
21
75
|
&__label {
|
|
22
|
-
|
|
76
|
+
color: theme("colors.lightMedium");
|
|
77
|
+
width: 100%;
|
|
23
78
|
|
|
24
79
|
:root .dark & {
|
|
25
|
-
|
|
80
|
+
color: theme("colors.darkMedium");
|
|
26
81
|
}
|
|
27
82
|
}
|
|
28
83
|
|
|
29
84
|
&__inner {
|
|
30
|
-
|
|
85
|
+
background-color: theme("colors.white");
|
|
86
|
+
border-radius: theme("borderRadius.full");
|
|
87
|
+
display: inline-block;
|
|
88
|
+
|
|
89
|
+
@apply transition-all;
|
|
31
90
|
|
|
32
91
|
:root .dark & {
|
|
33
|
-
|
|
92
|
+
background-color: theme("colors.gray.900");
|
|
34
93
|
}
|
|
35
94
|
}
|
|
36
95
|
|
|
37
96
|
&.is-selected {
|
|
38
|
-
|
|
97
|
+
background-color: var(--uxf-toggle-selected-color);
|
|
98
|
+
|
|
99
|
+
&.uxf-toggle--size-default {
|
|
100
|
+
.uxf-toggle__inner {
|
|
101
|
+
transform: translateX(24px);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:active {
|
|
105
|
+
.uxf-toggle__inner {
|
|
106
|
+
transform: translateX(14px);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&.uxf-toggle--size-sm {
|
|
112
|
+
.uxf-toggle__inner {
|
|
113
|
+
transform: translateX(12px);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&:active {
|
|
117
|
+
.uxf-toggle__inner {
|
|
118
|
+
transform: translateX(8px);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
39
122
|
|
|
40
123
|
:root .dark & {
|
|
41
|
-
|
|
124
|
+
background-color: var(--uxf-toggle-selected-color);
|
|
42
125
|
}
|
|
43
126
|
}
|
|
44
127
|
|
|
45
128
|
&.is-disabled {
|
|
46
|
-
|
|
129
|
+
background-color: theme("colors.gray.100");
|
|
130
|
+
pointer-events: none;
|
|
47
131
|
|
|
48
132
|
:root .dark & {
|
|
49
|
-
|
|
133
|
+
background-color: theme("colors.gray.700");
|
|
50
134
|
}
|
|
51
135
|
|
|
52
136
|
.uxf-toggle__inner {
|
|
53
|
-
|
|
137
|
+
background-color: theme("colors.gray.400");
|
|
54
138
|
|
|
55
139
|
:root .dark & {
|
|
56
|
-
|
|
140
|
+
background-color: theme("colors.gray.500");
|
|
57
141
|
}
|
|
58
142
|
}
|
|
59
143
|
}
|
|
@@ -35,6 +35,7 @@ const react_1 = __importStar(require("react"));
|
|
|
35
35
|
const _input_with_popover_1 = require("../_input-with-popover");
|
|
36
36
|
const datetime_picker_1 = require("../datetime-picker");
|
|
37
37
|
const icon_1 = require("../icon");
|
|
38
|
+
const get_datetime_string_1 = require("./get-datetime-string");
|
|
38
39
|
(0, dayjs_1.extend)(customParseFormat_1.default);
|
|
39
40
|
exports.ALLOWED_DATETIME_FORMAT = [
|
|
40
41
|
"D. M. YYYY H:mm",
|
|
@@ -75,12 +76,10 @@ exports.DatetimePickerInput = (0, react_1.forwardRef)((props, ref) => {
|
|
|
75
76
|
onChange(value === "" ? null : value);
|
|
76
77
|
}
|
|
77
78
|
}, [onChange]);
|
|
78
|
-
const value = getValue(props.value);
|
|
79
|
+
const value = getValue(props.value); // hodnota zobrazená v textinputu (human readable)
|
|
79
80
|
const parsedMinDate = getBoundaryDate(props.minDate);
|
|
80
81
|
const parsedMaxDate = getBoundaryDate(props.maxDate);
|
|
81
82
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
82
|
-
react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, onChange: onInputChange, placeholder: (_a = props.placeholder) !== null && _a !== void 0 ? _a : (0, dayjs_1.default)().format(exports.DISPLAY_DATETIME_FORMAT), ref: ref, value: value, triggerElement: (_b = props.triggerElement) !== null && _b !== void 0 ? _b : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }) }, ({ close }) => (0, is_not_nil_1.isNotNil)(props.CustomDatetimePicker) ? (react_1.default.createElement(props.CustomDatetimePicker, { value: (0,
|
|
83
|
-
? (0, dayjs_1.default)(value).format("YYYY-MM-DD[T]HH:mm:ssZ")
|
|
84
|
-
: null, onChange: onChange, onClose: close })) : (react_1.default.createElement(datetime_picker_1.DatetimePicker, { minDate: parsedMinDate, maxDate: parsedMaxDate, bottomContent: props.bottomContent, closePopoverHandler: close, onChange: onChange, value: props.value, unavailableDates: props.unavailableDates })))));
|
|
83
|
+
react_1.default.createElement(_input_with_popover_1._InputWithPopover, { ...props, className: className, onChange: onInputChange, placeholder: (_a = props.placeholder) !== null && _a !== void 0 ? _a : (0, dayjs_1.default)().format(exports.DISPLAY_DATETIME_FORMAT), ref: ref, value: value, triggerElement: (_b = props.triggerElement) !== null && _b !== void 0 ? _b : react_1.default.createElement(icon_1.Icon, { name: "calendar", size: 20 }) }, ({ close }) => (0, is_not_nil_1.isNotNil)(props.CustomDatetimePicker) ? (react_1.default.createElement(props.CustomDatetimePicker, { value: (0, get_datetime_string_1.getDatetimeString)(props.value), onChange: onChange, onClose: close })) : (react_1.default.createElement(datetime_picker_1.DatetimePicker, { minDate: parsedMinDate, maxDate: parsedMaxDate, bottomContent: props.bottomContent, closePopoverHandler: close, onChange: onChange, value: props.value, unavailableDates: props.unavailableDates })))));
|
|
85
84
|
});
|
|
86
85
|
exports.DatetimePickerInput.displayName = "UxfUiDatePickerInput";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DatetimeString } from "@uxf/core/date";
|
|
2
|
+
import { Nullish } from "@uxf/core/types";
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated tuhle metodu nepoužívat - něco podobného se musí přenést do @uxf/core
|
|
5
|
+
*/
|
|
6
|
+
export declare function getDatetimeString(value: string | Nullish): DatetimeString | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getDatetimeString = void 0;
|
|
7
|
+
const is_nil_1 = require("@uxf/core/utils/is-nil");
|
|
8
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated tuhle metodu nepoužívat - něco podobného se musí přenést do @uxf/core
|
|
11
|
+
*/
|
|
12
|
+
function getDatetimeString(value) {
|
|
13
|
+
if ((0, is_nil_1.isNil)(value)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const date = (0, dayjs_1.default)(value, ["YYYY-MM-DD[T]HH:mm:ssZ", "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"]);
|
|
17
|
+
return date.isValid() ? date.format("YYYY-MM-DD[T]HH:mm:ssZ") : null;
|
|
18
|
+
}
|
|
19
|
+
exports.getDatetimeString = getDatetimeString;
|
package/icons-config.js
CHANGED
|
@@ -115,6 +115,11 @@ module.exports = {
|
|
|
115
115
|
height: 512,
|
|
116
116
|
data: `<path fill="currentColor" d="M248.4 84.3c1.6-2.7 4.5-4.3 7.6-4.3s6 1.6 7.6 4.3L461.9 410c1.4 2.3 2.1 4.9 2.1 7.5c0 8-6.5 14.5-14.5 14.5H62.5c-8 0-14.5-6.5-14.5-14.5c0-2.7 .7-5.3 2.1-7.5L248.4 84.3zm-41-25L9.1 385c-6 9.8-9.1 21-9.1 32.5C0 452 28 480 62.5 480h387c34.5 0 62.5-28 62.5-62.5c0-11.5-3.2-22.7-9.1-32.5L304.6 59.3C294.3 42.4 275.9 32 256 32s-38.3 10.4-48.6 27.3zM288 368a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm-8-184c0-13.3-10.7-24-24-24s-24 10.7-24 24v96c0 13.3 10.7 24 24 24s24-10.7 24-24V184z"/>`,
|
|
117
117
|
},
|
|
118
|
+
"triangle-exclamation-solid": {
|
|
119
|
+
width: 512,
|
|
120
|
+
height: 512,
|
|
121
|
+
data: `<path fill="currentColor" d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480L40 480c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24l0 112c0 13.3 10.7 24 24 24s24-10.7 24-24l0-112c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/>`,
|
|
122
|
+
},
|
|
118
123
|
user: {
|
|
119
124
|
width: 448,
|
|
120
125
|
height: 512,
|
package/package.json
CHANGED
package/readmes.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ export declare const readmes: {
|
|
|
9
9
|
readonly "button-group": typeof alertBubbleReadme;
|
|
10
10
|
readonly "button-list": typeof alertBubbleReadme;
|
|
11
11
|
readonly calendar: typeof alertBubbleReadme;
|
|
12
|
+
readonly checkbox: typeof alertBubbleReadme;
|
|
13
|
+
readonly "checkbox-button": typeof alertBubbleReadme;
|
|
14
|
+
readonly "checkbox-input": typeof alertBubbleReadme;
|
|
15
|
+
readonly chip: typeof alertBubbleReadme;
|
|
12
16
|
readonly "color-radio": typeof alertBubbleReadme;
|
|
13
17
|
readonly "color-radio-group": typeof alertBubbleReadme;
|
|
14
18
|
readonly combobox: typeof alertBubbleReadme;
|
|
@@ -25,10 +29,6 @@ export declare const readmes: {
|
|
|
25
29
|
readonly "file-input": typeof alertBubbleReadme;
|
|
26
30
|
readonly "flash-messages": typeof alertBubbleReadme;
|
|
27
31
|
readonly "form-component": typeof alertBubbleReadme;
|
|
28
|
-
readonly checkbox: typeof alertBubbleReadme;
|
|
29
|
-
readonly "checkbox-button": typeof alertBubbleReadme;
|
|
30
|
-
readonly "checkbox-input": typeof alertBubbleReadme;
|
|
31
|
-
readonly chip: typeof alertBubbleReadme;
|
|
32
32
|
readonly icon: typeof alertBubbleReadme;
|
|
33
33
|
readonly "image-gallery": typeof alertBubbleReadme;
|
|
34
34
|
readonly input: typeof alertBubbleReadme;
|
package/readmes.js
CHANGED
|
@@ -13,26 +13,26 @@ const README_md_5 = __importDefault(require("./button/README.md"));
|
|
|
13
13
|
const README_md_6 = __importDefault(require("./button-group/README.md"));
|
|
14
14
|
const README_md_7 = __importDefault(require("./button-list/README.md"));
|
|
15
15
|
const README_md_8 = __importDefault(require("./calendar/README.md"));
|
|
16
|
-
const README_md_9 = __importDefault(require("./
|
|
17
|
-
const README_md_10 = __importDefault(require("./
|
|
18
|
-
const README_md_11 = __importDefault(require("./
|
|
19
|
-
const README_md_12 = __importDefault(require("./
|
|
20
|
-
const README_md_13 = __importDefault(require("./
|
|
21
|
-
const README_md_14 = __importDefault(require("./
|
|
22
|
-
const README_md_15 = __importDefault(require("./
|
|
23
|
-
const README_md_16 = __importDefault(require("./
|
|
24
|
-
const README_md_17 = __importDefault(require("./
|
|
25
|
-
const README_md_18 = __importDefault(require("./
|
|
26
|
-
const README_md_19 = __importDefault(require("./
|
|
27
|
-
const README_md_20 = __importDefault(require("./
|
|
28
|
-
const README_md_21 = __importDefault(require("./
|
|
29
|
-
const README_md_22 = __importDefault(require("./
|
|
30
|
-
const README_md_23 = __importDefault(require("./
|
|
31
|
-
const README_md_24 = __importDefault(require("./
|
|
32
|
-
const README_md_25 = __importDefault(require("./
|
|
33
|
-
const README_md_26 = __importDefault(require("./
|
|
34
|
-
const README_md_27 = __importDefault(require("./
|
|
35
|
-
const README_md_28 = __importDefault(require("./
|
|
16
|
+
const README_md_9 = __importDefault(require("./checkbox/README.md"));
|
|
17
|
+
const README_md_10 = __importDefault(require("./checkbox-button/README.md"));
|
|
18
|
+
const README_md_11 = __importDefault(require("./checkbox-input/README.md"));
|
|
19
|
+
const README_md_12 = __importDefault(require("./chip/README.md"));
|
|
20
|
+
const README_md_13 = __importDefault(require("./color-radio/README.md"));
|
|
21
|
+
const README_md_14 = __importDefault(require("./color-radio-group/README.md"));
|
|
22
|
+
const README_md_15 = __importDefault(require("./combobox/README.md"));
|
|
23
|
+
const README_md_16 = __importDefault(require("./date-picker/README.md"));
|
|
24
|
+
const README_md_17 = __importDefault(require("./date-picker-input/README.md"));
|
|
25
|
+
const README_md_18 = __importDefault(require("./date-range-picker/README.md"));
|
|
26
|
+
const README_md_19 = __importDefault(require("./date-range-picker-input/README.md"));
|
|
27
|
+
const README_md_20 = __importDefault(require("./datetime-picker/README.md"));
|
|
28
|
+
const README_md_21 = __importDefault(require("./datetime-picker-input/README.md"));
|
|
29
|
+
const README_md_22 = __importDefault(require("./dialog/README.md"));
|
|
30
|
+
const README_md_23 = __importDefault(require("./dropdown/README.md"));
|
|
31
|
+
const README_md_24 = __importDefault(require("./dropzone/README.md"));
|
|
32
|
+
const README_md_25 = __importDefault(require("./error-message/README.md"));
|
|
33
|
+
const README_md_26 = __importDefault(require("./file-input/README.md"));
|
|
34
|
+
const README_md_27 = __importDefault(require("./flash-messages/README.md"));
|
|
35
|
+
const README_md_28 = __importDefault(require("./form-component/README.md"));
|
|
36
36
|
const README_md_29 = __importDefault(require("./icon/README.md"));
|
|
37
37
|
const README_md_30 = __importDefault(require("./image-gallery/README.md"));
|
|
38
38
|
const README_md_31 = __importDefault(require("./input/README.md"));
|
|
@@ -71,26 +71,26 @@ exports.readmes = {
|
|
|
71
71
|
"button-group": README_md_6.default,
|
|
72
72
|
"button-list": README_md_7.default,
|
|
73
73
|
"calendar": README_md_8.default,
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
74
|
+
"checkbox": README_md_9.default,
|
|
75
|
+
"checkbox-button": README_md_10.default,
|
|
76
|
+
"checkbox-input": README_md_11.default,
|
|
77
|
+
"chip": README_md_12.default,
|
|
78
|
+
"color-radio": README_md_13.default,
|
|
79
|
+
"color-radio-group": README_md_14.default,
|
|
80
|
+
"combobox": README_md_15.default,
|
|
81
|
+
"date-picker": README_md_16.default,
|
|
82
|
+
"date-picker-input": README_md_17.default,
|
|
83
|
+
"date-range-picker": README_md_18.default,
|
|
84
|
+
"date-range-picker-input": README_md_19.default,
|
|
85
|
+
"datetime-picker": README_md_20.default,
|
|
86
|
+
"datetime-picker-input": README_md_21.default,
|
|
87
|
+
"dialog": README_md_22.default,
|
|
88
|
+
"dropdown": README_md_23.default,
|
|
89
|
+
"dropzone": README_md_24.default,
|
|
90
|
+
"error-message": README_md_25.default,
|
|
91
|
+
"file-input": README_md_26.default,
|
|
92
|
+
"flash-messages": README_md_27.default,
|
|
93
|
+
"form-component": README_md_28.default,
|
|
94
94
|
"icon": README_md_29.default,
|
|
95
95
|
"image-gallery": README_md_30.default,
|
|
96
96
|
"input": README_md_31.default,
|
package/text-link/theme.d.ts
CHANGED
package/toggle/theme.d.ts
CHANGED
package/toggle/toggle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ToggleVariant } from "@uxf/ui/toggle/theme";
|
|
1
|
+
import { ToggleSize, ToggleVariant } from "@uxf/ui/toggle/theme";
|
|
2
2
|
import React, { CSSProperties, ReactNode } from "react";
|
|
3
3
|
import { FormControlProps } from "../types";
|
|
4
4
|
export interface ToggleProps extends FormControlProps<boolean | undefined> {
|
|
@@ -6,6 +6,7 @@ export interface ToggleProps extends FormControlProps<boolean | undefined> {
|
|
|
6
6
|
hiddenLabel?: boolean;
|
|
7
7
|
id?: string;
|
|
8
8
|
label: ReactNode;
|
|
9
|
+
size?: ToggleSize;
|
|
9
10
|
style?: CSSProperties;
|
|
10
11
|
variant?: ToggleVariant;
|
|
11
12
|
}
|
package/toggle/toggle.js
CHANGED
|
@@ -29,10 +29,10 @@ const classes_1 = require("@uxf/core/constants/classes");
|
|
|
29
29
|
const cx_1 = require("@uxf/core/utils/cx");
|
|
30
30
|
const react_2 = __importStar(require("react"));
|
|
31
31
|
exports.Toggle = (0, react_2.forwardRef)((props, ref) => {
|
|
32
|
-
var _a, _b;
|
|
32
|
+
var _a, _b, _c, _d;
|
|
33
33
|
return (react_2.default.createElement(react_1.Switch.Group, null,
|
|
34
|
-
react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-toggle__wrapper", `uxf-toggle__wrapper--${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"}`, props.hiddenLabel && "uxf-toggle__wrapper--hiddenLabel", props.className) },
|
|
35
|
-
react_2.default.createElement(react_1.Switch, { checked: props.value, className: (0, cx_1.cx)(props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED, "uxf-toggle", `uxf-toggle--${(
|
|
34
|
+
react_2.default.createElement("div", { className: (0, cx_1.cx)("uxf-toggle__wrapper", `uxf-toggle__wrapper--${(_a = props.variant) !== null && _a !== void 0 ? _a : "default"}`, `uxf-toggle__wrapper--size-${(_b = props.size) !== null && _b !== void 0 ? _b : "default"}`, props.hiddenLabel && "uxf-toggle__wrapper--hiddenLabel", props.className) },
|
|
35
|
+
react_2.default.createElement(react_1.Switch, { checked: props.value, className: (0, cx_1.cx)(props.isDisabled && classes_1.CLASSES.IS_DISABLED, props.isInvalid && classes_1.CLASSES.IS_INVALID, props.isReadOnly && classes_1.CLASSES.IS_READONLY, props.value && classes_1.CLASSES.IS_SELECTED, "uxf-toggle", `uxf-toggle--${(_c = props.variant) !== null && _c !== void 0 ? _c : "default"}`, `uxf-toggle--size-${(_d = props.size) !== null && _d !== void 0 ? _d : "default"}`), disabled: props.isDisabled, id: props.id, name: props.name, onChange: props.onChange, ref: ref, style: props.style },
|
|
36
36
|
react_2.default.createElement("span", { className: "uxf-toggle__inner" })),
|
|
37
37
|
react_2.default.createElement(react_1.Switch.Label, { hidden: props.hiddenLabel, className: "uxf-toggle__label" }, props.label))));
|
|
38
38
|
});
|
package/toggle/toggle.stories.js
CHANGED
|
@@ -36,6 +36,7 @@ function Default() {
|
|
|
36
36
|
const onChange = (0, action_1.action)("onChange", () => setChecked((prev) => !prev));
|
|
37
37
|
const storyToggles = (react_1.default.createElement(react_1.default.Fragment, null,
|
|
38
38
|
react_1.default.createElement(index_1.Toggle, { label: "Opravdu?", onChange: onChange, value: checked, name: "toggle" }),
|
|
39
|
+
react_1.default.createElement(index_1.Toggle, { label: "Opravdu? - size sm", onChange: onChange, value: checked, name: "toggle", size: "sm" }),
|
|
39
40
|
react_1.default.createElement(index_1.Toggle, { label: "Opravdu?", onChange: onChange, value: checked, isDisabled: true, name: "toggle-disabled" }),
|
|
40
41
|
react_1.default.createElement(index_1.Toggle, { label: "Opravdu?", onChange: onChange, value: checked, hiddenLabel: true, name: "toggle-hidden-label" }),
|
|
41
42
|
react_1.default.createElement(index_1.Toggle, { label: "Opravdu? (reversed)", onChange: onChange, value: checked, variant: "reversed", name: "toggle-reversed" })));
|