@homecode/ui 4.17.2 → 4.18.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/dist/esm/src/components/Calendar/Calendar.styl.js +1 -1
- package/dist/esm/src/components/DatePicker/DatePicker.js +3 -2
- package/dist/esm/src/components/DatePicker/DatePicker.styl.js +2 -2
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.js +4 -2
- package/dist/esm/src/components/DatePickerInput/DatePickerInput.styl.js +2 -2
- package/dist/esm/src/components/Select/Select.js +1 -1
- package/dist/esm/types/src/components/DatePicker/DatePicker.types.d.ts +1 -0
- package/dist/esm/types/src/components/DatePickerInput/DatePickerInput.types.d.ts +4 -8
- package/dist/esm/types/src/components/Icon/Icon.example.d.ts +0 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Calendar_size-s__MFLPb{font-size:.5em}.Calendar_size-m__IGeoI{font-size:.75em}.Calendar_size-l__a2zct{font-size:1em}.Calendar_root__v8Jg6{display:flex;flex-direction:column}.Calendar_header__IHzS-{align-items:center;display:flex;justify-content:space-between}.Calendar_month__gi10Q{width:100%}.Calendar_year__UlmLM{min-width:5em}.Calendar_year__UlmLM input{min-width:0;min-width:auto}.Calendar_month__gi10Q{margin-left:var(--indent-s)}.Calendar_weekDays__Pglyw{align-items:center;color:var(--accent-color-alpha-500);display:flex;font-size:.75em;margin-top:var(--indent-s);width:100%}.Calendar_weekDays__Pglyw .Calendar_day__A3NG-{padding:1.5em 0}.Calendar_size-s__MFLPb .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:first-child{border-top-left-radius:4px}.Calendar_size-s__MFLPb .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:last-child{border-top-right-radius:4px}.Calendar_size-m__IGeoI .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:first-child{border-top-left-radius:6px}.Calendar_size-m__IGeoI .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:last-child{border-top-right-radius:6px}.Calendar_size-l__a2zct .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:first-child{border-top-left-radius:8px}.Calendar_size-l__a2zct .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:last-child{border-top-right-radius:8px}.Calendar_days__64U-y{display:flex;flex-wrap:wrap;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;user-select:none}.Calendar_days__64U-y .Calendar_day__A3NG-:not(.Calendar_currMonth__oL4nl){color:var(--accent-color-alpha-500)}.Calendar_hideOtherMonthDays__DydjR .Calendar_days__64U-y .Calendar_day__A3NG-:not(.Calendar_currMonth__oL4nl){opacity:0;pointer-events:none}.Calendar_size-s__MFLPb .Calendar_days__64U-y .Calendar_day__A3NG-:first-child{border-top-left-radius:4px}.Calendar_size-m__IGeoI .Calendar_days__64U-y .Calendar_day__A3NG-:first-child{border-top-left-radius:6px}.Calendar_size-l__a2zct .Calendar_days__64U-y .Calendar_day__A3NG-:first-child{border-top-left-radius:8px}.Calendar_size-s__MFLPb .Calendar_days__64U-y .Calendar_day__A3NG-:last-child{border-bottom-right-radius:4px}.Calendar_size-m__IGeoI .Calendar_days__64U-y .Calendar_day__A3NG-:last-child{border-bottom-right-radius:6px}.Calendar_size-l__a2zct .Calendar_days__64U-y .Calendar_day__A3NG-:last-child{border-bottom-right-radius:8px}.Calendar_size-s__MFLPb .Calendar_days__64U-y .Calendar_day__A3NG-:nth-child(7){border-top-right-radius:4px}.Calendar_size-m__IGeoI .Calendar_days__64U-y .Calendar_day__A3NG-:nth-child(7){border-top-right-radius:6px}.Calendar_size-l__a2zct .Calendar_days__64U-y .Calendar_day__A3NG-:nth-child(7){border-top-right-radius:8px}.Calendar_size-s__MFLPb .Calendar_days__64U-y .Calendar_day__A3NG-:nth-last-child(7){border-bottom-left-radius:4px}.Calendar_size-m__IGeoI .Calendar_days__64U-y .Calendar_day__A3NG-:nth-last-child(7){border-bottom-left-radius:6px}.Calendar_size-l__a2zct .Calendar_days__64U-y .Calendar_day__A3NG-:nth-last-child(7){border-bottom-left-radius:8px}.Calendar_day__A3NG-{align-items:center;display:flex;height:2em;justify-content:center;min-width:0;min-width:auto;padding:0;width:14.28571%}.Calendar_day__A3NG-.Calendar_disabled__sZi-f{background-color:var(--accent-color-alpha-100);border-radius:0;opacity:.3;pointer-events:none}.Calendar_day__A3NG-.Calendar_selected__ffB6-{background-color:var(--active-color-alpha-500)!important}.Calendar_day__A3NG-.Calendar_currMonth__oL4nl{font-weight:700}";
|
|
3
|
+
var css_248z = ".Calendar_size-s__MFLPb{font-size:.5em}.Calendar_size-m__IGeoI{font-size:.75em}.Calendar_size-l__a2zct{font-size:1em}.Calendar_root__v8Jg6{display:flex;flex-direction:column}.Calendar_header__IHzS-{align-items:center;display:flex;justify-content:space-between}.Calendar_month__gi10Q{width:100%}.Calendar_year__UlmLM{min-width:5em}.Calendar_year__UlmLM input{min-width:0;min-width:auto}.Calendar_month__gi10Q{margin-left:var(--indent-s)}.Calendar_weekDays__Pglyw{align-items:center;color:var(--accent-color-alpha-500);display:flex;font-size:.75em;margin-top:var(--indent-s);width:100%}.Calendar_weekDays__Pglyw .Calendar_day__A3NG-{padding:1.5em 0}.Calendar_size-s__MFLPb .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:first-child{border-top-left-radius:4px}.Calendar_size-s__MFLPb .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:last-child{border-top-right-radius:4px}.Calendar_size-m__IGeoI .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:first-child{border-top-left-radius:6px}.Calendar_size-m__IGeoI .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:last-child{border-top-right-radius:6px}.Calendar_size-l__a2zct .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:first-child{border-top-left-radius:8px}.Calendar_size-l__a2zct .Calendar_weekDays__Pglyw .Calendar_day__A3NG-:last-child{border-top-right-radius:8px}.Calendar_days__64U-y{display:flex;flex-wrap:wrap;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;user-select:none}.Calendar_days__64U-y .Calendar_day__A3NG-:not(.Calendar_currMonth__oL4nl){color:var(--accent-color-alpha-500)}.Calendar_hideOtherMonthDays__DydjR .Calendar_days__64U-y .Calendar_day__A3NG-:not(.Calendar_currMonth__oL4nl){opacity:0;pointer-events:none}.Calendar_size-s__MFLPb .Calendar_days__64U-y .Calendar_day__A3NG-:first-child{border-top-left-radius:4px}.Calendar_size-m__IGeoI .Calendar_days__64U-y .Calendar_day__A3NG-:first-child{border-top-left-radius:6px}.Calendar_size-l__a2zct .Calendar_days__64U-y .Calendar_day__A3NG-:first-child{border-top-left-radius:8px}.Calendar_size-s__MFLPb .Calendar_days__64U-y .Calendar_day__A3NG-:last-child{border-bottom-right-radius:4px}.Calendar_size-m__IGeoI .Calendar_days__64U-y .Calendar_day__A3NG-:last-child{border-bottom-right-radius:6px}.Calendar_size-l__a2zct .Calendar_days__64U-y .Calendar_day__A3NG-:last-child{border-bottom-right-radius:8px}.Calendar_size-s__MFLPb .Calendar_days__64U-y .Calendar_day__A3NG-:nth-child(7){border-top-right-radius:4px}.Calendar_size-m__IGeoI .Calendar_days__64U-y .Calendar_day__A3NG-:nth-child(7){border-top-right-radius:6px}.Calendar_size-l__a2zct .Calendar_days__64U-y .Calendar_day__A3NG-:nth-child(7){border-top-right-radius:8px}.Calendar_size-s__MFLPb .Calendar_days__64U-y .Calendar_day__A3NG-:nth-last-child(7){border-bottom-left-radius:4px}.Calendar_size-m__IGeoI .Calendar_days__64U-y .Calendar_day__A3NG-:nth-last-child(7){border-bottom-left-radius:6px}.Calendar_size-l__a2zct .Calendar_days__64U-y .Calendar_day__A3NG-:nth-last-child(7){border-bottom-left-radius:8px}.Calendar_day__A3NG-{align-items:center;display:flex;height:2em;justify-content:center;min-width:0;min-width:auto;padding:0;width:14.28571%}.Calendar_day__A3NG-.Calendar_disabled__sZi-f{background-color:var(--accent-color-alpha-100);border-radius:0;opacity:.3;pointer-events:none}.Calendar_day__A3NG-.Calendar_selected__ffB6-{background-color:var(--active-color-alpha-500)!important}.Calendar_day__A3NG-.Calendar_currMonth__oL4nl{font-weight:700}.pointer .Calendar_day__A3NG-:focus{background-color:transparent}";
|
|
4
4
|
var S = {"size-s":"Calendar_size-s__MFLPb","size-m":"Calendar_size-m__IGeoI","size-l":"Calendar_size-l__a2zct","root":"Calendar_root__v8Jg6","header":"Calendar_header__IHzS-","month":"Calendar_month__gi10Q","year":"Calendar_year__UlmLM","weekDays":"Calendar_weekDays__Pglyw","day":"Calendar_day__A3NG-","days":"Calendar_days__64U-y","currMonth":"Calendar_currMonth__oL4nl","hideOtherMonthDays":"Calendar_hideOtherMonthDays__DydjR","disabled":"Calendar_disabled__sZi-f","selected":"Calendar_selected__ffB6-"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -7,7 +7,7 @@ import { dateToString, isDateAfter, strigToDate, isDateBetween, isDateEqual } fr
|
|
|
7
7
|
import S from './DatePicker.styl.js';
|
|
8
8
|
|
|
9
9
|
function DatePicker(props) {
|
|
10
|
-
const { value, onChange, size, calendarProps } = props;
|
|
10
|
+
const { value, onChange, size, doubleCalendar, calendarProps = {} } = props;
|
|
11
11
|
const isRange = Array.isArray(value);
|
|
12
12
|
const [isPicking, setIsPicking] = useState(false);
|
|
13
13
|
const onFirstDateChange = useCallback((val) => {
|
|
@@ -40,7 +40,8 @@ function DatePicker(props) {
|
|
|
40
40
|
}
|
|
41
41
|
return (createElement(Button, { ...props, variant: "clear", className: cn(classes), size: size, key: `${year}-${month}-${day}` }, day));
|
|
42
42
|
}, [size, isPicking, isRange, value, onChange]);
|
|
43
|
-
|
|
43
|
+
calendarProps.className = cn(calendarProps.className, S.calendar);
|
|
44
|
+
return (jsxs("div", { className: cn(S.root, doubleCalendar && S.doubleCalendar, props.className), onPointerDown: onPointerDown, onPointerUp: onPointerUp, children: [jsx(Calendar, { size: size, hideOtherMonthDays: isRange, ...calendarProps, renderDay: renderDay, value: strigToDate(isRange ? value[0] : value), onDayPointerDown: onFirstDateChange, onDayPointerUp: undefined }), isRange && doubleCalendar && (jsx(Calendar, { size: size, hideOtherMonthDays: isRange, ...calendarProps, renderDay: renderDay, value: strigToDate(value[1]), onDayPointerDown: val => onChange([value[0], dateToString(val)]), onDayPointerUp: val => onChange([value[0], dateToString(val)]) }))] }));
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
export { DatePicker };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".DatePicker_root__hh-PP{display:flex;flex-direction:
|
|
4
|
-
var S = {"root":"DatePicker_root__hh-PP","day":"DatePicker_day__kGD0i","start":"DatePicker_start__qd0rW","end":"DatePicker_end__KYPnO","between":"DatePicker_between__1Bifb"};
|
|
3
|
+
var css_248z = ".DatePicker_root__hh-PP{display:flex;flex-direction:row;gap:var(--indent-m)}.DatePicker_calendar__0Fk4N{width:100%}.DatePicker_doubleCalendar__4YbNN .DatePicker_calendar__0Fk4N{width:50%}.DatePicker_day__kGD0i.DatePicker_end__KYPnO,.DatePicker_day__kGD0i.DatePicker_start__qd0rW{background-color:var(--active-color-alpha-500)!important}.DatePicker_day__kGD0i.DatePicker_start__qd0rW{border-bottom-right-radius:0;border-top-right-radius:0}.DatePicker_day__kGD0i.DatePicker_end__KYPnO{border-bottom-left-radius:0;border-top-left-radius:0}.DatePicker_day__kGD0i.DatePicker_between__1Bifb{background-color:var(--active-color-alpha-100);border-radius:0}.DatePicker_day__kGD0i:hover{background-color:var(--accent-color-alpha-100)}";
|
|
4
|
+
var S = {"root":"DatePicker_root__hh-PP","calendar":"DatePicker_calendar__0Fk4N","doubleCalendar":"DatePicker_doubleCalendar__4YbNN","day":"DatePicker_day__kGD0i","start":"DatePicker_start__qd0rW","end":"DatePicker_end__KYPnO","between":"DatePicker_between__1Bifb"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
|
@@ -10,8 +10,10 @@ import S from './DatePickerInput.styl.js';
|
|
|
10
10
|
function DatePickerInput(props) {
|
|
11
11
|
const { value, variant = 'default', size = 'm', popupProps, displayFormat = 'MMM Do YYYY', } = props;
|
|
12
12
|
const isRange = Array.isArray(value);
|
|
13
|
-
return (jsx(Popup, { size: size, focusControl: true, direction: "bottom-right", ...popupProps, trigger:
|
|
14
|
-
|
|
13
|
+
return (jsx(Popup, { size: size, focusControl: true, direction: "bottom-right", ...popupProps, trigger:
|
|
14
|
+
// @ts-ignore
|
|
15
|
+
jsx(Button, { variant: variant, size: size, children: isRange ? (jsxs(Fragment, { children: [jsx(DateTime, { value: strToDate(value[0]), format: displayFormat }), ' - ', jsx(DateTime, { value: strToDate(value[1]), format: displayFormat })] })) : (jsx(DateTime, { value: strToDate(value), format: displayFormat })) }), contentProps: {
|
|
16
|
+
className: cn(S.popupContent, props.doubleCalendar && S.doubleCalendar, S[`size-${size}`]),
|
|
15
17
|
}, content: jsx(DatePicker, { ...props, className: S.content, calendarProps: { className: S.calendar } }) }));
|
|
16
18
|
}
|
|
17
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".DatePickerInput_popupContent__rcVHH{min-width:-moz-fit-content;min-width:fit-content}.DatePickerInput_content__yll-b{padding:.5em}.DatePickerInput_range__xWj9K .DatePickerInput_content__yll-b{display:flex;flex-direction:row;flex-wrap:nowrap;gap:1em}.
|
|
4
|
-
var S = {"popupContent":"DatePickerInput_popupContent__rcVHH","content":"DatePickerInput_content__yll-b","range":"DatePickerInput_range__xWj9K","calendar":"DatePickerInput_calendar__vf0za","size-s":"DatePickerInput_size-s__5t05o","size-m":"DatePickerInput_size-m__TTkHV","size-l":"DatePickerInput_size-l__-fWkE"};
|
|
3
|
+
var css_248z = ".DatePickerInput_popupContent__rcVHH{min-width:-moz-fit-content;min-width:fit-content}.DatePickerInput_content__yll-b{padding:.5em}.DatePickerInput_range__xWj9K .DatePickerInput_content__yll-b{display:flex;flex-direction:row;flex-wrap:nowrap;gap:1em}.DatePickerInput_doubleCalendar__H5CMo .DatePickerInput_calendar__vf0za{width:50%}.DatePickerInput_size-s__5t05o{border-radius:6px!important}.DatePickerInput_size-s__5t05o .DatePickerInput_content__yll-b{min-width:12em;padding:8px}.DatePickerInput_doubleCalendar__H5CMo.DatePickerInput_size-s__5t05o .DatePickerInput_content__yll-b{min-width:25em}.DatePickerInput_size-m__TTkHV{border-radius:9px!important}.DatePickerInput_size-m__TTkHV .DatePickerInput_content__yll-b{min-width:16em;padding:12px}.DatePickerInput_doubleCalendar__H5CMo.DatePickerInput_size-m__TTkHV .DatePickerInput_content__yll-b{min-width:33em}.DatePickerInput_size-l__-fWkE{border-radius:12px!important}.DatePickerInput_size-l__-fWkE .DatePickerInput_content__yll-b{min-width:20em;padding:14px}.DatePickerInput_doubleCalendar__H5CMo.DatePickerInput_size-l__-fWkE .DatePickerInput_content__yll-b{min-width:41em}";
|
|
4
|
+
var S = {"popupContent":"DatePickerInput_popupContent__rcVHH","content":"DatePickerInput_content__yll-b","range":"DatePickerInput_range__xWj9K","doubleCalendar":"DatePickerInput_doubleCalendar__H5CMo","calendar":"DatePickerInput_calendar__vf0za","size-s":"DatePickerInput_size-s__5t05o","size-m":"DatePickerInput_size-m__TTkHV","size-l":"DatePickerInput_size-l__-fWkE"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
7
7
|
export { S as default };
|
|
@@ -574,7 +574,7 @@ class Select extends Component {
|
|
|
574
574
|
const { className, popupProps, size, error, blur } = this.props;
|
|
575
575
|
const { isOpen, isFocused } = this.store;
|
|
576
576
|
const classes = cn(S.root, className, S[`size-${size}`]);
|
|
577
|
-
return (jsxs(Fragment, { children: [jsx(Popup, { className: classes, direction: "bottom", size: size, focusControl: true, hoverControl: isFocused, blur: blur,
|
|
577
|
+
return (jsxs(Fragment, { children: [jsx(Popup, { className: classes, direction: "bottom", size: size, focusControl: true, hoverControl: isFocused, blur: blur, isOpen: isOpen, ...popupProps, onOpen: this.onPopupOpen, onClose: this.onPopupClose, disabled: this.isDisabled(), trigger: this.renderTrigger(), triggerProps: {
|
|
578
578
|
onFocus: this.onFocus,
|
|
579
579
|
onBlur: this.onBlur,
|
|
580
580
|
}, content: this.renderOptionsList() }), this.isErrorVisible() && (jsx(AssistiveText, { variant: "danger", size: size, children: error }))] }));
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import type { Size, Variant } from 'uilib/types';
|
|
2
1
|
import type { Props as PopupProps } from 'uilib/components/Popup/Popup.types';
|
|
2
|
+
import type { Props as DatePickerProps } from 'uilib/components/DatePicker/DatePicker.types';
|
|
3
3
|
export type Value = string | [string, string];
|
|
4
|
-
export type Props = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
displayFormat?: string;
|
|
8
|
-
value: Value;
|
|
9
|
-
onChange: (value: Value) => void;
|
|
10
|
-
variant?: Variant;
|
|
4
|
+
export type Props = DatePickerProps & {
|
|
5
|
+
variant?: string;
|
|
6
|
+
displayFormat: string;
|
|
11
7
|
popupProps?: PopupProps;
|
|
12
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@homecode/ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.18.0",
|
|
4
4
|
"description": "React UI components library",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"types": "dist/esm/types/index.d.ts",
|
|
41
41
|
"type": "module",
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@homecode/ui": "^4.17.
|
|
43
|
+
"@homecode/ui": "^4.17.2",
|
|
44
44
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
|
|
45
45
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
46
46
|
"classnames": "^2.3.2",
|