@veracity/vui 2.17.0-beta.2 → 2.17.1-beta.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/cjs/calendar/calendar.d.ts +1 -1
- package/dist/cjs/calendar/calendar.d.ts.map +1 -1
- package/dist/cjs/calendar/calendar.js +1 -1
- package/dist/cjs/datePicker/datePicker.d.ts +1 -1
- package/dist/cjs/datePicker/datePicker.d.ts.map +1 -1
- package/dist/cjs/datePicker/datePicker.js +1 -1
- package/dist/cjs/progress/progress.d.ts +1 -1
- package/dist/cjs/progress/progress.d.ts.map +1 -1
- package/dist/cjs/progress/progress.js +1 -1
- package/dist/cjs/progressCircular/progressCircular.d.ts +1 -1
- package/dist/cjs/progressCircular/progressCircular.d.ts.map +1 -1
- package/dist/cjs/progressCircular/progressCircular.js +1 -1
- package/dist/cjs/stepperHorizontal/stepperHorizontal.d.ts +1 -1
- package/dist/cjs/stepperHorizontal/stepperHorizontal.js +1 -1
- package/dist/cjs/toast/useToast.d.ts.map +1 -1
- package/dist/cjs/toast/useToast.js +21 -18
- package/dist/cjs/tutorial/tutorial.d.ts +1 -1
- package/dist/cjs/tutorial/tutorial.d.ts.map +1 -1
- package/dist/cjs/tutorial/tutorial.js +1 -1
- package/dist/esm/calendar/calendar.d.ts +1 -1
- package/dist/esm/calendar/calendar.d.ts.map +1 -1
- package/dist/esm/calendar/calendar.js +1 -1
- package/dist/esm/datePicker/datePicker.d.ts +1 -1
- package/dist/esm/datePicker/datePicker.d.ts.map +1 -1
- package/dist/esm/datePicker/datePicker.js +1 -1
- package/dist/esm/progress/progress.d.ts +1 -1
- package/dist/esm/progress/progress.d.ts.map +1 -1
- package/dist/esm/progress/progress.js +1 -1
- package/dist/esm/progressCircular/progressCircular.d.ts +1 -1
- package/dist/esm/progressCircular/progressCircular.d.ts.map +1 -1
- package/dist/esm/progressCircular/progressCircular.js +1 -1
- package/dist/esm/stepperHorizontal/stepperHorizontal.d.ts +1 -1
- package/dist/esm/stepperHorizontal/stepperHorizontal.js +1 -1
- package/dist/esm/toast/useToast.d.ts.map +1 -1
- package/dist/esm/toast/useToast.js +21 -18
- package/dist/esm/tutorial/tutorial.d.ts +1 -1
- package/dist/esm/tutorial/tutorial.d.ts.map +1 -1
- package/dist/esm/tutorial/tutorial.js +1 -1
- package/package.json +3 -1
- package/src/calendar/calendar.tsx +1 -1
- package/src/datePicker/datePicker.tsx +1 -1
- package/src/progress/progress.tsx +1 -1
- package/src/progressCircular/progressCircular.tsx +1 -1
- package/src/stepperHorizontal/stepperHorizontal.tsx +1 -1
- package/src/toast/useToast.tsx +42 -27
- package/src/tutorial/tutorial.tsx +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAsD,MAAM,kBAAkB,CAAA;AAepG,
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAsD,MAAM,kBAAkB,CAAA;AAepG,yBAAyB;AACzB,eAAO,MAAM,QAAQ,sDAuHnB,CAAA;AAIF,eAAe,QAAQ,CAAA"}
|
|
@@ -23,7 +23,7 @@ const utils_1 = require("../utils");
|
|
|
23
23
|
const components_1 = require("./components");
|
|
24
24
|
const hooks_1 = require("./hooks");
|
|
25
25
|
const utils_2 = require("./utils");
|
|
26
|
-
/**
|
|
26
|
+
/** Displays calendar. */
|
|
27
27
|
exports.Calendar = (0, core_1.vui)((props, ref) => {
|
|
28
28
|
const _a = (0, core_1.omitThemingProps)(props), { boundaries, className, fixedNumberOfWeeks = false, disabled, isStartDate, mode, onSelectDates, selectedDates } = _a, rest = __rest(_a, ["boundaries", "className", "fixedNumberOfWeeks", "disabled", "isStartDate", "mode", "onSelectDates", "selectedDates"]);
|
|
29
29
|
const styles = (0, core_1.useStyleConfig)('Calendar', props);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatePickerProps } from './datePicker.types';
|
|
2
|
-
/**
|
|
2
|
+
/** Select or input a date. */
|
|
3
3
|
export declare const DatePicker: import("../core").VuiComponent<"span", DatePickerProps>;
|
|
4
4
|
export default DatePicker;
|
|
5
5
|
//# sourceMappingURL=datePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datePicker.d.ts","sourceRoot":"","sources":["../../../src/datePicker/datePicker.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAMpD,
|
|
1
|
+
{"version":3,"file":"datePicker.d.ts","sourceRoot":"","sources":["../../../src/datePicker/datePicker.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAMpD,8BAA8B;AAC9B,eAAO,MAAM,UAAU,yDAsJrB,CAAA;AAIF,eAAe,UAAU,CAAA"}
|
|
@@ -50,7 +50,7 @@ const dateInput_1 = require("./dateInput");
|
|
|
50
50
|
const DatePickerPanel = (0, core_1.styled)(pickerPanel_1.PickerPanel) `
|
|
51
51
|
width: 320px;
|
|
52
52
|
`;
|
|
53
|
-
/**
|
|
53
|
+
/** Select or input a date. */
|
|
54
54
|
exports.DatePicker = (0, core_1.vui)((props, ref) => {
|
|
55
55
|
const _a = (0, core_1.omitThemingProps)(props), { autoOpened, boundaries, popupPosition = 'left', selectedDate: selectedDateProps, showClearButton, slotBottom, slotTop, onSelected, children, className } = _a, rest = __rest(_a, ["autoOpened", "boundaries", "popupPosition", "selectedDate", "showClearButton", "slotBottom", "slotTop", "onSelected", "children", "className"]);
|
|
56
56
|
const styles = (0, core_1.useStyleConfig)('DatePicker', props);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProgressProps } from './progress.types';
|
|
2
2
|
export declare const ProgressBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
-
/**
|
|
3
|
+
/** Indicates a process progress. */
|
|
4
4
|
export declare const Progress: import("../core").VuiComponent<"div", ProgressProps>;
|
|
5
5
|
export default Progress;
|
|
6
6
|
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/progress/progress.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,eAAO,MAAM,YAAY,+HAGxB,CAAA;AAKD,
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/progress/progress.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,eAAO,MAAM,YAAY,+HAGxB,CAAA;AAKD,oCAAoC;AACpC,eAAO,MAAM,QAAQ,sDAuCnB,CAAA;AAGF,eAAe,QAAQ,CAAA"}
|
|
@@ -23,7 +23,7 @@ exports.ProgressBase = core_1.styled.divBox `
|
|
|
23
23
|
`;
|
|
24
24
|
const minPercentageDisplay = 3;
|
|
25
25
|
const maxValue = 100;
|
|
26
|
-
/**
|
|
26
|
+
/** Indicates a process progress. */
|
|
27
27
|
exports.Progress = (0, core_1.vui)((props, ref) => {
|
|
28
28
|
const { className, value = 0, showPercentage } = props, rest = __rest(props, ["className", "value", "showPercentage"]);
|
|
29
29
|
const [width, setWidth] = (0, react_1.useState)(0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProgressCircularProps } from './progressCircular.types';
|
|
2
2
|
export declare const ProgressCircularBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
-
/**
|
|
3
|
+
/** Indicates a process progress. */
|
|
4
4
|
export declare const ProgressCircular: import("../core").VuiComponent<"div", ProgressCircularProps>;
|
|
5
5
|
export default ProgressCircular;
|
|
6
6
|
//# sourceMappingURL=progressCircular.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressCircular.d.ts","sourceRoot":"","sources":["../../../src/progressCircular/progressCircular.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,oBAAoB,+HAIhC,CAAA;AAWD,
|
|
1
|
+
{"version":3,"file":"progressCircular.d.ts","sourceRoot":"","sources":["../../../src/progressCircular/progressCircular.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,oBAAoB,+HAIhC,CAAA;AAWD,oCAAoC;AACpC,eAAO,MAAM,gBAAgB,8DA8D3B,CAAA;AAGF,eAAe,gBAAgB,CAAA"}
|
|
@@ -32,7 +32,7 @@ const ProgressCircle = (0, core_1.styled)(MainCircle) `
|
|
|
32
32
|
transform-origin: 50% 50%;
|
|
33
33
|
transition: stroke-dashoffset 0.5s ease-out;
|
|
34
34
|
`;
|
|
35
|
-
/**
|
|
35
|
+
/** Indicates a process progress. */
|
|
36
36
|
exports.ProgressCircular = (0, core_1.vui)((props, ref) => {
|
|
37
37
|
const { children, className, label, value = 0, showPercentage } = props, rest = __rest(props, ["children", "className", "label", "value", "showPercentage"]);
|
|
38
38
|
const styles = (0, core_1.useStyleConfig)('ProgressCircular', props);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import StepperHorizontalBase from './stepperHorizontalBase';
|
|
2
2
|
import { StepperHorizontalProps } from './stepperHorizontalTypes';
|
|
3
3
|
/**
|
|
4
|
-
* Implements Horizontal stepper **
|
|
4
|
+
* [Beta] Implements Horizontal stepper **
|
|
5
5
|
*/
|
|
6
6
|
export declare const StepperHorizontal: import("../core").VuiComponent<"div", StepperHorizontalProps>;
|
|
7
7
|
export default StepperHorizontalBase;
|
|
@@ -22,7 +22,7 @@ const utils_1 = require("../utils");
|
|
|
22
22
|
const context_1 = require("./context");
|
|
23
23
|
const stepperHorizontalBase_1 = __importDefault(require("./stepperHorizontalBase"));
|
|
24
24
|
/**
|
|
25
|
-
* Implements Horizontal stepper **
|
|
25
|
+
* [Beta] Implements Horizontal stepper **
|
|
26
26
|
*/
|
|
27
27
|
exports.StepperHorizontal = (0, core_1.vui)((props, ref) => {
|
|
28
28
|
const { children, className, size } = props, rest = __rest(props, ["children", "className", "size"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../src/toast/useToast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../src/toast/useToast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AAK9C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAc,MAAM,eAAe,CAAA;AAEvE,eAAO,MAAM,eAAe,SAAS,CAAA;AACrC,eAAO,MAAM,iBAAiB,OAAO,CAAA;AACrC,eAAO,MAAM,iBAAiB,OAAO,CAAA;AAWrC,eAAO,MAAM,QAAQ;0BAGsB,YAAY,KAAG,IAAI;;qBA+BnD,SAAS,aAAY,aAAa;wBAKlC,SAAS,aAAY,aAAa;wBAKlC,SAAS,aAAY,aAAa;sBAKlC,SAAS,aAAY,aAAa;wBAKlC,SAAS,aAAY,aAAa;CAa5C,CAAA"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useToast = exports.slowToastDuration = exports.fastToastDuration = exports.defaultDuration = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const core_1 = require("../core");
|
|
6
7
|
const notification_1 = require("../notification");
|
|
7
8
|
const utils_1 = require("../utils");
|
|
@@ -17,29 +18,31 @@ const setup = {
|
|
|
17
18
|
const getDurationTime = (duration) => (duration === 'fast' ? exports.fastToastDuration : exports.slowToastDuration);
|
|
18
19
|
const useToast = () => {
|
|
19
20
|
const { addToast, removeToast } = (0, core_1.useVuiContext)();
|
|
20
|
-
const
|
|
21
|
-
const showToast = (options) => {
|
|
21
|
+
const showToast = (0, react_1.useCallback)((options) => {
|
|
22
22
|
const id = (options === null || options === void 0 ? void 0 : options.id) ? options.id : (0, utils_1.uid)('toast');
|
|
23
|
-
const { duration = setup.options.duration } = options || {};
|
|
24
|
-
const { status = setup.options.duration } = options || {};
|
|
25
|
-
const { action } = options || {};
|
|
26
|
-
const { icon } = options || {};
|
|
27
|
-
const { text } = options || {};
|
|
28
|
-
const { title } = options || {};
|
|
29
|
-
const onClose = () => hideToast(id);
|
|
23
|
+
const { duration = setup.options.duration, status = 'info', action, icon, text, title } = options || {};
|
|
30
24
|
const toast = {
|
|
31
25
|
id,
|
|
32
|
-
component: ((0, jsx_runtime_1.jsx)(notification_1.Notification, { action: action, animation: "fadeDown", icon: icon, mt: { md: 1, sm: '4px', xs: '4px' }, onClose:
|
|
26
|
+
component: ((0, jsx_runtime_1.jsx)(notification_1.Notification, { action: action, animation: "fadeDown", elevation: 3, icon: icon, mt: { md: 1, sm: '4px', xs: '4px' }, onClose: () => removeToast(id), status: status, text: text, title: title, verticalAlign: "center", w: 1 }))
|
|
33
27
|
};
|
|
34
28
|
addToast(toast);
|
|
35
|
-
if (duration && duration !== 'sticky')
|
|
36
|
-
window.setTimeout(() =>
|
|
29
|
+
if (duration && duration !== 'sticky') {
|
|
30
|
+
window.setTimeout(() => removeToast(id), getDurationTime(duration));
|
|
31
|
+
}
|
|
32
|
+
}, []);
|
|
33
|
+
const showInfo = (0, react_1.useCallback)((text, duration = exports.defaultDuration) => showToast({ text, status: 'info', duration }), [showToast]);
|
|
34
|
+
const showSuccess = (0, react_1.useCallback)((text, duration = exports.defaultDuration) => showToast({ text, status: 'success', duration }), [showToast]);
|
|
35
|
+
const showWarning = (0, react_1.useCallback)((text, duration = exports.defaultDuration) => showToast({ text, status: 'warning', duration }), [showToast]);
|
|
36
|
+
const showError = (0, react_1.useCallback)((text, duration = exports.defaultDuration) => showToast({ text, status: 'error', duration }), [showToast]);
|
|
37
|
+
const showLoading = (0, react_1.useCallback)((text, duration = exports.defaultDuration) => showToast({ text, status: 'loading', duration }), [showToast]);
|
|
38
|
+
return {
|
|
39
|
+
showToast,
|
|
40
|
+
hideToast: removeToast,
|
|
41
|
+
showInfo,
|
|
42
|
+
showSuccess,
|
|
43
|
+
showWarning,
|
|
44
|
+
showError,
|
|
45
|
+
showLoading
|
|
37
46
|
};
|
|
38
|
-
const showInfo = (text, duration = exports.defaultDuration) => showToast({ text, status: 'info', duration });
|
|
39
|
-
const showSuccess = (text, duration = exports.defaultDuration) => showToast({ text, status: 'success', duration });
|
|
40
|
-
const showWarning = (text, duration = exports.defaultDuration) => showToast({ text, status: 'warning', duration });
|
|
41
|
-
const showError = (text, duration = exports.defaultDuration) => showToast({ text, status: 'error', duration });
|
|
42
|
-
const showLoading = (text, duration = exports.defaultDuration) => showToast({ text, status: 'loading', duration });
|
|
43
|
-
return { showToast, hideToast, showInfo, showSuccess, showWarning, showError, showLoading };
|
|
44
47
|
};
|
|
45
48
|
exports.useToast = useToast;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TutorialProps } from './tutorial.types';
|
|
2
|
-
/**
|
|
2
|
+
/** Popover Tutorial is used to display information about a new, or existing feature. */
|
|
3
3
|
export declare function Tutorial({ actionLabel, children, className, onAction, onDismiss, onFinish, steps, title, id, placement, showSkipButton }: TutorialProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare namespace Tutorial {
|
|
5
5
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tutorial.d.ts","sourceRoot":"","sources":["../../../src/tutorial/tutorial.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAI5D
|
|
1
|
+
{"version":3,"file":"tutorial.d.ts","sourceRoot":"","sources":["../../../src/tutorial/tutorial.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAI5D,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,KAAK,EACL,KAAK,EACL,EAAE,EACF,SAAmB,EACnB,cAAc,EACf,EAAE,aAAa,2CAwCf;yBApDe,QAAQ"}
|
|
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("@tippyjs/react"));
|
|
|
9
9
|
const utils_1 = require("../utils");
|
|
10
10
|
const tutorialCard_1 = require("./tutorialCard");
|
|
11
11
|
const useTutorial_1 = require("./useTutorial");
|
|
12
|
-
/**
|
|
12
|
+
/** Popover Tutorial is used to display information about a new, or existing feature. */
|
|
13
13
|
function Tutorial({ actionLabel, children, className, onAction, onDismiss, onFinish, steps, title, id, placement = 'right', showSkipButton }) {
|
|
14
14
|
const { isVisible, setIsVisible, saveDisplayed } = (0, useTutorial_1.useTutorial)(id);
|
|
15
15
|
const onClose = (e) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAsD,MAAM,kBAAkB,CAAA;AAepG,
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAsD,MAAM,kBAAkB,CAAA;AAepG,yBAAyB;AACzB,eAAO,MAAM,QAAQ,sDAuHnB,CAAA;AAIF,eAAe,QAAQ,CAAA"}
|
|
@@ -6,7 +6,7 @@ import { cs } from '../utils';
|
|
|
6
6
|
import { CalendarHeader, DayPicker, MonthPicker, YearPicker } from './components';
|
|
7
7
|
import { useCalendar, useDefaultViewMonth } from './hooks';
|
|
8
8
|
import { isDay, isExact, isFrom, isMonth, isTo, isYear, processSelectMonth, processSelectYear, processViewDate } from './utils';
|
|
9
|
-
/**
|
|
9
|
+
/** Displays calendar. */
|
|
10
10
|
export const Calendar = vui((props, ref) => {
|
|
11
11
|
const { boundaries, className, fixedNumberOfWeeks = false, disabled, isStartDate, mode, onSelectDates, selectedDates, ...rest } = omitThemingProps(props);
|
|
12
12
|
const styles = useStyleConfig('Calendar', props);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DatePickerProps } from './datePicker.types';
|
|
2
|
-
/**
|
|
2
|
+
/** Select or input a date. */
|
|
3
3
|
export declare const DatePicker: import("../core").VuiComponent<"span", DatePickerProps>;
|
|
4
4
|
export default DatePicker;
|
|
5
5
|
//# sourceMappingURL=datePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datePicker.d.ts","sourceRoot":"","sources":["../../../src/datePicker/datePicker.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAMpD,
|
|
1
|
+
{"version":3,"file":"datePicker.d.ts","sourceRoot":"","sources":["../../../src/datePicker/datePicker.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAMpD,8BAA8B;AAC9B,eAAO,MAAM,UAAU,yDAsJrB,CAAA;AAIF,eAAe,UAAU,CAAA"}
|
|
@@ -10,7 +10,7 @@ import { DateInput } from './dateInput';
|
|
|
10
10
|
const DatePickerPanel = styled(PickerPanel) `
|
|
11
11
|
width: 320px;
|
|
12
12
|
`;
|
|
13
|
-
/**
|
|
13
|
+
/** Select or input a date. */
|
|
14
14
|
export const DatePicker = vui((props, ref) => {
|
|
15
15
|
const { autoOpened, boundaries, popupPosition = 'left', selectedDate: selectedDateProps, showClearButton, slotBottom, slotTop, onSelected, children, className, ...rest } = omitThemingProps(props);
|
|
16
16
|
const styles = useStyleConfig('DatePicker', props);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProgressProps } from './progress.types';
|
|
2
2
|
export declare const ProgressBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
-
/**
|
|
3
|
+
/** Indicates a process progress. */
|
|
4
4
|
export declare const Progress: import("../core").VuiComponent<"div", ProgressProps>;
|
|
5
5
|
export default Progress;
|
|
6
6
|
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/progress/progress.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,eAAO,MAAM,YAAY,+HAGxB,CAAA;AAKD,
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/progress/progress.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,eAAO,MAAM,YAAY,+HAGxB,CAAA;AAKD,oCAAoC;AACpC,eAAO,MAAM,QAAQ,sDAuCnB,CAAA;AAGF,eAAe,QAAQ,CAAA"}
|
|
@@ -9,7 +9,7 @@ export const ProgressBase = styled.divBox `
|
|
|
9
9
|
`;
|
|
10
10
|
const minPercentageDisplay = 3;
|
|
11
11
|
const maxValue = 100;
|
|
12
|
-
/**
|
|
12
|
+
/** Indicates a process progress. */
|
|
13
13
|
export const Progress = vui((props, ref) => {
|
|
14
14
|
const { className, value = 0, showPercentage, ...rest } = props;
|
|
15
15
|
const [width, setWidth] = useState(0);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProgressCircularProps } from './progressCircular.types';
|
|
2
2
|
export declare const ProgressCircularBase: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, import("..").SystemProps, never>;
|
|
3
|
-
/**
|
|
3
|
+
/** Indicates a process progress. */
|
|
4
4
|
export declare const ProgressCircular: import("../core").VuiComponent<"div", ProgressCircularProps>;
|
|
5
5
|
export default ProgressCircular;
|
|
6
6
|
//# sourceMappingURL=progressCircular.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressCircular.d.ts","sourceRoot":"","sources":["../../../src/progressCircular/progressCircular.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,oBAAoB,+HAIhC,CAAA;AAWD,
|
|
1
|
+
{"version":3,"file":"progressCircular.d.ts","sourceRoot":"","sources":["../../../src/progressCircular/progressCircular.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,oBAAoB,+HAIhC,CAAA;AAWD,oCAAoC;AACpC,eAAO,MAAM,gBAAgB,8DA8D3B,CAAA;AAGF,eAAe,gBAAgB,CAAA"}
|
|
@@ -18,7 +18,7 @@ const ProgressCircle = styled(MainCircle) `
|
|
|
18
18
|
transform-origin: 50% 50%;
|
|
19
19
|
transition: stroke-dashoffset 0.5s ease-out;
|
|
20
20
|
`;
|
|
21
|
-
/**
|
|
21
|
+
/** Indicates a process progress. */
|
|
22
22
|
export const ProgressCircular = vui((props, ref) => {
|
|
23
23
|
const { children, className, label, value = 0, showPercentage, ...rest } = props;
|
|
24
24
|
const styles = useStyleConfig('ProgressCircular', props);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import StepperHorizontalBase from './stepperHorizontalBase';
|
|
2
2
|
import { StepperHorizontalProps } from './stepperHorizontalTypes';
|
|
3
3
|
/**
|
|
4
|
-
* Implements Horizontal stepper **
|
|
4
|
+
* [Beta] Implements Horizontal stepper **
|
|
5
5
|
*/
|
|
6
6
|
export declare const StepperHorizontal: import("../core").VuiComponent<"div", StepperHorizontalProps>;
|
|
7
7
|
export default StepperHorizontalBase;
|
|
@@ -5,7 +5,7 @@ import { cs, filterUndefined } from '../utils';
|
|
|
5
5
|
import { StepperHorizontalProvider } from './context';
|
|
6
6
|
import StepperHorizontalBase from './stepperHorizontalBase';
|
|
7
7
|
/**
|
|
8
|
-
* Implements Horizontal stepper **
|
|
8
|
+
* [Beta] Implements Horizontal stepper **
|
|
9
9
|
*/
|
|
10
10
|
export const StepperHorizontal = vui((props, ref) => {
|
|
11
11
|
const { children, className, size, ...rest } = props;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../src/toast/useToast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../src/toast/useToast.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,OAAO,CAAA;AAK9C,OAAO,EAAE,aAAa,EAAE,YAAY,EAAc,MAAM,eAAe,CAAA;AAEvE,eAAO,MAAM,eAAe,SAAS,CAAA;AACrC,eAAO,MAAM,iBAAiB,OAAO,CAAA;AACrC,eAAO,MAAM,iBAAiB,OAAO,CAAA;AAWrC,eAAO,MAAM,QAAQ;0BAGsB,YAAY,KAAG,IAAI;;qBA+BnD,SAAS,aAAY,aAAa;wBAKlC,SAAS,aAAY,aAAa;wBAKlC,SAAS,aAAY,aAAa;sBAKlC,SAAS,aAAY,aAAa;wBAKlC,SAAS,aAAY,aAAa;CAa5C,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
2
3
|
import { useVuiContext } from '../core';
|
|
3
4
|
import { Notification } from '../notification';
|
|
4
5
|
import { uid } from '../utils';
|
|
@@ -14,28 +15,30 @@ const setup = {
|
|
|
14
15
|
const getDurationTime = (duration) => (duration === 'fast' ? fastToastDuration : slowToastDuration);
|
|
15
16
|
export const useToast = () => {
|
|
16
17
|
const { addToast, removeToast } = useVuiContext();
|
|
17
|
-
const
|
|
18
|
-
const showToast = (options) => {
|
|
18
|
+
const showToast = useCallback((options) => {
|
|
19
19
|
const id = options?.id ? options.id : uid('toast');
|
|
20
|
-
const { duration = setup.options.duration } = options || {};
|
|
21
|
-
const { status = setup.options.duration } = options || {};
|
|
22
|
-
const { action } = options || {};
|
|
23
|
-
const { icon } = options || {};
|
|
24
|
-
const { text } = options || {};
|
|
25
|
-
const { title } = options || {};
|
|
26
|
-
const onClose = () => hideToast(id);
|
|
20
|
+
const { duration = setup.options.duration, status = 'info', action, icon, text, title } = options || {};
|
|
27
21
|
const toast = {
|
|
28
22
|
id,
|
|
29
|
-
component: (_jsx(Notification, { action: action, animation: "fadeDown", icon: icon, mt: { md: 1, sm: '4px', xs: '4px' }, onClose:
|
|
23
|
+
component: (_jsx(Notification, { action: action, animation: "fadeDown", elevation: 3, icon: icon, mt: { md: 1, sm: '4px', xs: '4px' }, onClose: () => removeToast(id), status: status, text: text, title: title, verticalAlign: "center", w: 1 }))
|
|
30
24
|
};
|
|
31
25
|
addToast(toast);
|
|
32
|
-
if (duration && duration !== 'sticky')
|
|
33
|
-
window.setTimeout(() =>
|
|
26
|
+
if (duration && duration !== 'sticky') {
|
|
27
|
+
window.setTimeout(() => removeToast(id), getDurationTime(duration));
|
|
28
|
+
}
|
|
29
|
+
}, []);
|
|
30
|
+
const showInfo = useCallback((text, duration = defaultDuration) => showToast({ text, status: 'info', duration }), [showToast]);
|
|
31
|
+
const showSuccess = useCallback((text, duration = defaultDuration) => showToast({ text, status: 'success', duration }), [showToast]);
|
|
32
|
+
const showWarning = useCallback((text, duration = defaultDuration) => showToast({ text, status: 'warning', duration }), [showToast]);
|
|
33
|
+
const showError = useCallback((text, duration = defaultDuration) => showToast({ text, status: 'error', duration }), [showToast]);
|
|
34
|
+
const showLoading = useCallback((text, duration = defaultDuration) => showToast({ text, status: 'loading', duration }), [showToast]);
|
|
35
|
+
return {
|
|
36
|
+
showToast,
|
|
37
|
+
hideToast: removeToast,
|
|
38
|
+
showInfo,
|
|
39
|
+
showSuccess,
|
|
40
|
+
showWarning,
|
|
41
|
+
showError,
|
|
42
|
+
showLoading
|
|
34
43
|
};
|
|
35
|
-
const showInfo = (text, duration = defaultDuration) => showToast({ text, status: 'info', duration });
|
|
36
|
-
const showSuccess = (text, duration = defaultDuration) => showToast({ text, status: 'success', duration });
|
|
37
|
-
const showWarning = (text, duration = defaultDuration) => showToast({ text, status: 'warning', duration });
|
|
38
|
-
const showError = (text, duration = defaultDuration) => showToast({ text, status: 'error', duration });
|
|
39
|
-
const showLoading = (text, duration = defaultDuration) => showToast({ text, status: 'loading', duration });
|
|
40
|
-
return { showToast, hideToast, showInfo, showSuccess, showWarning, showError, showLoading };
|
|
41
44
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TutorialProps } from './tutorial.types';
|
|
2
|
-
/**
|
|
2
|
+
/** Popover Tutorial is used to display information about a new, or existing feature. */
|
|
3
3
|
export declare function Tutorial({ actionLabel, children, className, onAction, onDismiss, onFinish, steps, title, id, placement, showSkipButton }: TutorialProps): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export declare namespace Tutorial {
|
|
5
5
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tutorial.d.ts","sourceRoot":"","sources":["../../../src/tutorial/tutorial.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAI5D
|
|
1
|
+
{"version":3,"file":"tutorial.d.ts","sourceRoot":"","sources":["../../../src/tutorial/tutorial.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAI5D,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,KAAK,EACL,KAAK,EACL,EAAE,EACF,SAAmB,EACnB,cAAc,EACf,EAAE,aAAa,2CAwCf;yBApDe,QAAQ"}
|
|
@@ -3,7 +3,7 @@ import Tippy from '@tippyjs/react';
|
|
|
3
3
|
import { cs } from '../utils';
|
|
4
4
|
import { TutorialCard } from './tutorialCard';
|
|
5
5
|
import { useTutorial } from './useTutorial';
|
|
6
|
-
/**
|
|
6
|
+
/** Popover Tutorial is used to display information about a new, or existing feature. */
|
|
7
7
|
export function Tutorial({ actionLabel, children, className, onAction, onDismiss, onFinish, steps, title, id, placement = 'right', showSkipButton }) {
|
|
8
8
|
const { isVisible, setIsVisible, saveDisplayed } = useTutorial(id);
|
|
9
9
|
const onClose = (e) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veracity/vui",
|
|
3
|
-
"version": "2.17.
|
|
3
|
+
"version": "2.17.1-beta.0",
|
|
4
4
|
"description": "Veracity UI is a React component library crafted for use within Veracity applications and pages. Based on Styled Components and @xstyled.",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
"build": "tsc -p tsconfig.json && tsc -p tsconfig.legacy.json",
|
|
13
13
|
"dev": "tsc --watch -p tsconfig.json",
|
|
14
14
|
"eslint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
15
|
+
"eslint:fix": "eslint \"src/**/*.{ts,tsx}\" --fix",
|
|
16
|
+
"fix": "npm run eslint:fix",
|
|
15
17
|
"lint": "npm run eslint && npm run tslint",
|
|
16
18
|
"tslint": "tsc --noEmit"
|
|
17
19
|
},
|
|
@@ -13,7 +13,7 @@ export const ProgressBase = styled.divBox`
|
|
|
13
13
|
const minPercentageDisplay = 3
|
|
14
14
|
const maxValue = 100
|
|
15
15
|
|
|
16
|
-
/**
|
|
16
|
+
/** Indicates a process progress. */
|
|
17
17
|
export const Progress = vui<'div', ProgressProps>((props, ref) => {
|
|
18
18
|
const { className, value = 0, showPercentage, ...rest } = props
|
|
19
19
|
|
|
@@ -22,7 +22,7 @@ const ProgressCircle = styled(MainCircle)`
|
|
|
22
22
|
transition: stroke-dashoffset 0.5s ease-out;
|
|
23
23
|
`
|
|
24
24
|
|
|
25
|
-
/**
|
|
25
|
+
/** Indicates a process progress. */
|
|
26
26
|
export const ProgressCircular = vui<'div', ProgressCircularProps>((props, ref) => {
|
|
27
27
|
const { children, className, label, value = 0, showPercentage, ...rest } = props
|
|
28
28
|
|
|
@@ -7,7 +7,7 @@ import StepperHorizontalBase from './stepperHorizontalBase'
|
|
|
7
7
|
import { StepperHorizontalProps } from './stepperHorizontalTypes'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Implements Horizontal stepper **
|
|
10
|
+
* [Beta] Implements Horizontal stepper **
|
|
11
11
|
*/
|
|
12
12
|
export const StepperHorizontal = vui<'div', StepperHorizontalProps>((props, ref) => {
|
|
13
13
|
const { children, className, size, ...rest } = props
|
package/src/toast/useToast.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from 'react'
|
|
1
|
+
import { ReactNode, useCallback } from 'react'
|
|
2
2
|
|
|
3
3
|
import { useVuiContext } from '../core'
|
|
4
4
|
import { Notification, NotificationStatus } from '../notification'
|
|
@@ -21,18 +21,9 @@ const getDurationTime = (duration: ToastDuration) => (duration === 'fast' ? fast
|
|
|
21
21
|
export const useToast = () => {
|
|
22
22
|
const { addToast, removeToast } = useVuiContext()
|
|
23
23
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const showToast = (options?: ToastOptions): void => {
|
|
24
|
+
const showToast = useCallback((options?: ToastOptions): void => {
|
|
27
25
|
const id = options?.id ? options.id : uid('toast')
|
|
28
|
-
const { duration = setup.options.duration } = options || {}
|
|
29
|
-
const { status = setup.options.duration } = options || {}
|
|
30
|
-
const { action } = options || {}
|
|
31
|
-
const { icon } = options || {}
|
|
32
|
-
const { text } = options || {}
|
|
33
|
-
const { title } = options || {}
|
|
34
|
-
|
|
35
|
-
const onClose = () => hideToast(id)
|
|
26
|
+
const { duration = setup.options.duration, status = 'info', action, icon, text, title } = options || {}
|
|
36
27
|
|
|
37
28
|
const toast = {
|
|
38
29
|
id,
|
|
@@ -40,10 +31,10 @@ export const useToast = () => {
|
|
|
40
31
|
<Notification
|
|
41
32
|
action={action}
|
|
42
33
|
animation="fadeDown"
|
|
34
|
+
elevation={3}
|
|
43
35
|
icon={icon}
|
|
44
36
|
mt={{ md: 1, sm: '4px', xs: '4px' }}
|
|
45
|
-
onClose={
|
|
46
|
-
shadow={3}
|
|
37
|
+
onClose={() => removeToast(id)}
|
|
47
38
|
status={status as NotificationStatus}
|
|
48
39
|
text={text}
|
|
49
40
|
title={title}
|
|
@@ -55,19 +46,43 @@ export const useToast = () => {
|
|
|
55
46
|
|
|
56
47
|
addToast(toast)
|
|
57
48
|
|
|
58
|
-
if (duration && duration !== 'sticky')
|
|
59
|
-
|
|
49
|
+
if (duration && duration !== 'sticky') {
|
|
50
|
+
window.setTimeout(() => removeToast(id), getDurationTime(duration))
|
|
51
|
+
}
|
|
52
|
+
}, [])
|
|
53
|
+
|
|
54
|
+
const showInfo = useCallback(
|
|
55
|
+
(text: ReactNode, duration: ToastDuration = defaultDuration) => showToast({ text, status: 'info', duration }),
|
|
56
|
+
[showToast]
|
|
57
|
+
)
|
|
60
58
|
|
|
61
|
-
const
|
|
62
|
-
showToast({ text, status: '
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const showWarning = (text: ReactNode, duration: ToastDuration = defaultDuration) =>
|
|
66
|
-
showToast({ text, status: 'warning', duration })
|
|
67
|
-
const showError = (text: ReactNode, duration: ToastDuration = defaultDuration) =>
|
|
68
|
-
showToast({ text, status: 'error', duration })
|
|
69
|
-
const showLoading = (text: ReactNode, duration: ToastDuration = defaultDuration) =>
|
|
70
|
-
showToast({ text, status: 'loading', duration })
|
|
59
|
+
const showSuccess = useCallback(
|
|
60
|
+
(text: ReactNode, duration: ToastDuration = defaultDuration) => showToast({ text, status: 'success', duration }),
|
|
61
|
+
[showToast]
|
|
62
|
+
)
|
|
71
63
|
|
|
72
|
-
|
|
64
|
+
const showWarning = useCallback(
|
|
65
|
+
(text: ReactNode, duration: ToastDuration = defaultDuration) => showToast({ text, status: 'warning', duration }),
|
|
66
|
+
[showToast]
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
const showError = useCallback(
|
|
70
|
+
(text: ReactNode, duration: ToastDuration = defaultDuration) => showToast({ text, status: 'error', duration }),
|
|
71
|
+
[showToast]
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
const showLoading = useCallback(
|
|
75
|
+
(text: ReactNode, duration: ToastDuration = defaultDuration) => showToast({ text, status: 'loading', duration }),
|
|
76
|
+
[showToast]
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
showToast,
|
|
81
|
+
hideToast: removeToast,
|
|
82
|
+
showInfo,
|
|
83
|
+
showSuccess,
|
|
84
|
+
showWarning,
|
|
85
|
+
showError,
|
|
86
|
+
showLoading
|
|
87
|
+
}
|
|
73
88
|
}
|
|
@@ -6,7 +6,7 @@ import { CloseEvent, TutorialProps } from './tutorial.types'
|
|
|
6
6
|
import { TutorialCard } from './tutorialCard'
|
|
7
7
|
import { useTutorial } from './useTutorial'
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/** Popover Tutorial is used to display information about a new, or existing feature. */
|
|
10
10
|
export function Tutorial({
|
|
11
11
|
actionLabel,
|
|
12
12
|
children,
|