@veritone-ce/design-system 2.3.3 → 2.3.5
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/Badge/index.js +5 -2
- package/dist/cjs/Badge/styles.module.scss.js +1 -1
- package/dist/cjs/Button/index.js +13 -8
- package/dist/cjs/Checkbox/index.js +18 -7
- package/dist/cjs/Checkbox/styles.module.scss.js +1 -1
- package/dist/cjs/Chip/styles.module.scss.js +1 -1
- package/dist/cjs/DatePicker/Calendar.js +150 -0
- package/dist/cjs/DatePicker/DateField.js +30 -0
- package/dist/cjs/DatePicker/index.js +122 -0
- package/dist/cjs/DatePicker/styles.module.scss.js +7 -0
- package/dist/cjs/DateRangePicker/index.js +41 -0
- package/dist/cjs/DateRangePicker/styles.module.scss.js +7 -0
- package/dist/cjs/Drawer/styles.module.scss.js +1 -1
- package/dist/cjs/FormControl/styles.module.scss.js +1 -1
- package/dist/cjs/Input/styles.module.scss.js +1 -1
- package/dist/cjs/Menu/controlled.js +36 -20
- package/dist/cjs/RadioButton/index.js +17 -8
- package/dist/cjs/RadioButton/styles.module.scss.js +1 -1
- package/dist/cjs/Select/styles.module.scss.js +1 -1
- package/dist/cjs/Textarea/styles.module.scss.js +1 -1
- package/dist/cjs/Tooltip/index.js +20 -6
- package/dist/cjs/Tooltip/styles.module.scss.js +1 -1
- package/dist/cjs/Typography/index.js +1 -1
- package/dist/cjs/index.js +26 -22
- package/dist/cjs/styles/defaultTheme.js +1 -1
- package/dist/cjs/styles.css +14 -12
- package/dist/esm/Badge/index.js +5 -2
- package/dist/esm/Badge/styles.module.scss.js +1 -1
- package/dist/esm/Button/index.js +13 -8
- package/dist/esm/Checkbox/index.js +18 -7
- package/dist/esm/Checkbox/styles.module.scss.js +1 -1
- package/dist/esm/Chip/styles.module.scss.js +1 -1
- package/dist/esm/DatePicker/Calendar.js +146 -0
- package/dist/esm/DatePicker/DateField.js +26 -0
- package/dist/esm/DatePicker/index.js +118 -0
- package/dist/esm/DatePicker/styles.module.scss.js +3 -0
- package/dist/esm/DateRangePicker/index.js +37 -0
- package/dist/esm/DateRangePicker/styles.module.scss.js +3 -0
- package/dist/esm/Drawer/styles.module.scss.js +1 -1
- package/dist/esm/FormControl/styles.module.scss.js +1 -1
- package/dist/esm/Input/styles.module.scss.js +1 -1
- package/dist/esm/Menu/controlled.js +37 -21
- package/dist/esm/RadioButton/index.js +17 -8
- package/dist/esm/RadioButton/styles.module.scss.js +1 -1
- package/dist/esm/Select/styles.module.scss.js +1 -1
- package/dist/esm/Textarea/styles.module.scss.js +1 -1
- package/dist/esm/Tooltip/index.js +21 -7
- package/dist/esm/Tooltip/styles.module.scss.js +1 -1
- package/dist/esm/Typography/index.js +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/styles/defaultTheme.js +1 -1
- package/dist/esm/styles.css +14 -12
- package/dist/types/Badge/index.d.ts +4 -1
- package/dist/types/Button/index.d.ts +14 -7
- package/dist/types/Checkbox/index.d.ts +12 -4
- package/dist/types/DatePicker/Calendar.d.ts +7 -0
- package/dist/types/DatePicker/DateField.d.ts +3 -0
- package/dist/types/DatePicker/index.d.ts +17 -0
- package/dist/types/DateRangePicker/index.d.ts +16 -0
- package/dist/types/Dialog/components.d.ts +14 -4
- package/dist/types/Drawer/components.d.ts +14 -4
- package/dist/types/Input/index.d.ts +12 -2
- package/dist/types/Menu/controlled.d.ts +2 -0
- package/dist/types/RadioButton/index.d.ts +11 -6
- package/dist/types/Textarea/index.d.ts +11 -2
- package/dist/types/index.d.ts +4 -0
- package/package.json +5 -3
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
'use client';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
import { useLocale, useCalendar, useCalendarGrid, useCalendarCell } from 'react-aria';
|
|
6
|
+
import { useCalendarState } from 'react-stately';
|
|
7
|
+
import { createCalendar, getWeeksInMonth } from '@internationalized/date';
|
|
8
|
+
import Button from '../Button/index.js';
|
|
9
|
+
import IconButton from '../IconButton/index.js';
|
|
10
|
+
import { adaptMuiSvgIcon } from '../Icon/wrappers.js';
|
|
11
|
+
import '../Icon/factory.js';
|
|
12
|
+
import { ArrowDropUp, ArrowBackIosNew, ArrowForwardIos } from '@mui/icons-material';
|
|
13
|
+
import modules_efc4e723 from './styles.module.scss.js';
|
|
14
|
+
import 'color2k';
|
|
15
|
+
import '../styles/css-vars.js';
|
|
16
|
+
import { defaultThemeCssVariableUsages } from '../styles/defaultTheme.js';
|
|
17
|
+
import '@mui/system';
|
|
18
|
+
import '../Box/index.js';
|
|
19
|
+
import '../styles/styled.js';
|
|
20
|
+
|
|
21
|
+
const ArrowUpDownIcon = adaptMuiSvgIcon(ArrowDropUp);
|
|
22
|
+
const ArrowBackIcon = adaptMuiSvgIcon(ArrowBackIosNew);
|
|
23
|
+
const ArrowForwardIcon = adaptMuiSvgIcon(ArrowForwardIos);
|
|
24
|
+
function Calendar({
|
|
25
|
+
changeYear: propsChangeYear,
|
|
26
|
+
...props
|
|
27
|
+
}) {
|
|
28
|
+
const { locale } = useLocale();
|
|
29
|
+
const [yearPickerIsOpen, setYearPickerIsOpen] = React__default.useState(false);
|
|
30
|
+
const state = useCalendarState({
|
|
31
|
+
...props,
|
|
32
|
+
locale,
|
|
33
|
+
createCalendar
|
|
34
|
+
});
|
|
35
|
+
const { calendarProps, prevButtonProps, nextButtonProps, title } = useCalendar(props, state);
|
|
36
|
+
const changeYear = (year) => {
|
|
37
|
+
propsChangeYear(year);
|
|
38
|
+
setYearPickerIsOpen(false);
|
|
39
|
+
};
|
|
40
|
+
const handlePrevButtonClick = (e) => {
|
|
41
|
+
prevButtonProps.onPress?.(e);
|
|
42
|
+
};
|
|
43
|
+
const handleNextButtonClick = (e) => {
|
|
44
|
+
nextButtonProps.onPress?.(e);
|
|
45
|
+
};
|
|
46
|
+
const toggleYearPicker = () => {
|
|
47
|
+
setYearPickerIsOpen(!yearPickerIsOpen);
|
|
48
|
+
};
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", { ...calendarProps, className: modules_efc4e723.calendarBox, children: [
|
|
50
|
+
/* @__PURE__ */ jsxs("div", { className: modules_efc4e723.calendarHeader, children: [
|
|
51
|
+
/* @__PURE__ */ jsx(
|
|
52
|
+
Button,
|
|
53
|
+
{
|
|
54
|
+
variant: "tertiary",
|
|
55
|
+
palette: defaultThemeCssVariableUsages.palette.action.text,
|
|
56
|
+
endIcon: /* @__PURE__ */ jsx(
|
|
57
|
+
ArrowUpDownIcon,
|
|
58
|
+
{
|
|
59
|
+
style: !yearPickerIsOpen ? {
|
|
60
|
+
transform: "rotate(180deg)",
|
|
61
|
+
transition: "0.3s ease"
|
|
62
|
+
} : { transition: "0.3s ease" }
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
onClick: () => toggleYearPicker(),
|
|
66
|
+
children: title
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
!yearPickerIsOpen && /* @__PURE__ */ jsxs("div", { className: modules_efc4e723.monthPickerArrowButtonsWrapper, children: [
|
|
70
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: (e) => handlePrevButtonClick(e), children: /* @__PURE__ */ jsx(ArrowBackIcon, { size: "small" }) }),
|
|
71
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: (e) => handleNextButtonClick(e), children: /* @__PURE__ */ jsx(ArrowForwardIcon, { size: "small" }) })
|
|
72
|
+
] })
|
|
73
|
+
] }),
|
|
74
|
+
yearPickerIsOpen ? /* @__PURE__ */ jsx(YearPicker, { changeYear, activeYear: state.value?.year }) : /* @__PURE__ */ jsx(CalendarGrid, { state })
|
|
75
|
+
] });
|
|
76
|
+
}
|
|
77
|
+
function CalendarGrid({
|
|
78
|
+
state,
|
|
79
|
+
startDate,
|
|
80
|
+
endDate,
|
|
81
|
+
weekdayStyle
|
|
82
|
+
}) {
|
|
83
|
+
const { locale } = useLocale();
|
|
84
|
+
const { gridProps, headerProps, weekDays } = useCalendarGrid(
|
|
85
|
+
{ startDate, endDate, weekdayStyle },
|
|
86
|
+
state
|
|
87
|
+
);
|
|
88
|
+
const weeksInMonth = getWeeksInMonth(state.visibleRange.start, locale);
|
|
89
|
+
return /* @__PURE__ */ jsxs("table", { className: modules_efc4e723.calendarGrid, ...gridProps, children: [
|
|
90
|
+
/* @__PURE__ */ jsx("thead", { ...headerProps, children: /* @__PURE__ */ jsx("tr", { children: weekDays.map((day, index) => /* @__PURE__ */ jsx("th", { className: modules_efc4e723.weekdayHeader, children: day }, index)) }) }),
|
|
91
|
+
/* @__PURE__ */ jsx("tbody", { children: [...new Array(Math.max(weeksInMonth, 6)).keys()].map((weekIndex) => /* @__PURE__ */ jsx("tr", { children: state.getDatesInWeek(weekIndex).map(
|
|
92
|
+
(date, i) => date ? /* @__PURE__ */ jsx(CalendarCell, { state, date }, i) : /* @__PURE__ */ jsx("td", {}, i)
|
|
93
|
+
) }, weekIndex)) })
|
|
94
|
+
] });
|
|
95
|
+
}
|
|
96
|
+
function CalendarCell({ state, date }) {
|
|
97
|
+
const ref = React__default.useRef(null);
|
|
98
|
+
const {
|
|
99
|
+
cellProps,
|
|
100
|
+
buttonProps,
|
|
101
|
+
isSelected,
|
|
102
|
+
isOutsideVisibleRange,
|
|
103
|
+
isDisabled,
|
|
104
|
+
formattedDate
|
|
105
|
+
} = useCalendarCell({ date }, state, ref);
|
|
106
|
+
return /* @__PURE__ */ jsx("td", { ...cellProps, children: /* @__PURE__ */ jsx(
|
|
107
|
+
Button,
|
|
108
|
+
{
|
|
109
|
+
...buttonProps,
|
|
110
|
+
ref,
|
|
111
|
+
size: "small",
|
|
112
|
+
variant: !isSelected ? "tertiary" : "secondary",
|
|
113
|
+
active: isSelected,
|
|
114
|
+
disabled: isDisabled,
|
|
115
|
+
className: modules_efc4e723.calendarCellBtn,
|
|
116
|
+
style: isOutsideVisibleRange ? { display: "none" } : {},
|
|
117
|
+
children: formattedDate
|
|
118
|
+
}
|
|
119
|
+
) });
|
|
120
|
+
}
|
|
121
|
+
const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
|
|
122
|
+
const years = Array.from(
|
|
123
|
+
{ length: currentYear + 1 - 1900 },
|
|
124
|
+
(_, i) => currentYear - i
|
|
125
|
+
);
|
|
126
|
+
function YearPicker({
|
|
127
|
+
changeYear,
|
|
128
|
+
activeYear
|
|
129
|
+
}) {
|
|
130
|
+
return /* @__PURE__ */ jsx("div", { className: modules_efc4e723.yearPickerLayout, children: years.map((year, index) => /* @__PURE__ */ jsx(
|
|
131
|
+
Button,
|
|
132
|
+
{
|
|
133
|
+
variant: "secondary",
|
|
134
|
+
size: "small",
|
|
135
|
+
active: year === activeYear,
|
|
136
|
+
className: modules_efc4e723.yearPillButton,
|
|
137
|
+
onClick: () => {
|
|
138
|
+
changeYear(year);
|
|
139
|
+
},
|
|
140
|
+
children: year
|
|
141
|
+
},
|
|
142
|
+
index
|
|
143
|
+
)) });
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export { Calendar as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React__default from 'react';
|
|
4
|
+
import { useLocale, useDateField, useDateSegment } from 'react-aria';
|
|
5
|
+
import { useDateFieldState } from 'react-stately';
|
|
6
|
+
import { createCalendar } from '@internationalized/date';
|
|
7
|
+
import modules_efc4e723 from './styles.module.scss.js';
|
|
8
|
+
|
|
9
|
+
function DateField(props) {
|
|
10
|
+
const ref = React__default.useRef(null);
|
|
11
|
+
const { locale } = useLocale();
|
|
12
|
+
const state = useDateFieldState({
|
|
13
|
+
...props,
|
|
14
|
+
locale,
|
|
15
|
+
createCalendar
|
|
16
|
+
});
|
|
17
|
+
const { fieldProps } = useDateField(props, state, ref);
|
|
18
|
+
return /* @__PURE__ */ jsx("div", { ...fieldProps, ref, className: modules_efc4e723.reactAriaDateInput, children: state.segments.map((segment, i) => /* @__PURE__ */ jsx(DateSegmentItem, { segment, state }, i)) });
|
|
19
|
+
}
|
|
20
|
+
function DateSegmentItem({ segment, state }) {
|
|
21
|
+
const ref = React__default.useRef(null);
|
|
22
|
+
const { segmentProps } = useDateSegment(segment, state, ref);
|
|
23
|
+
return /* @__PURE__ */ jsx("div", { ...segmentProps, ref, children: segment.text });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { DateField as default };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
'use client';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useRef } from 'react';
|
|
5
|
+
import { useFloating, useRole, useDismiss, useInteractions, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
6
|
+
import { useDatePicker } from 'react-aria';
|
|
7
|
+
import { useDatePickerState } from 'react-stately';
|
|
8
|
+
import { parseDate } from '@internationalized/date';
|
|
9
|
+
import Calendar from './Calendar.js';
|
|
10
|
+
import DateField from './DateField.js';
|
|
11
|
+
import IconButton from '../IconButton/index.js';
|
|
12
|
+
import { adaptMuiSvgIcon } from '../Icon/wrappers.js';
|
|
13
|
+
import '../Icon/factory.js';
|
|
14
|
+
import { CalendarTodayOutlined } from '@mui/icons-material';
|
|
15
|
+
import modules_efc4e723 from './styles.module.scss.js';
|
|
16
|
+
import { PortalThemeRelay } from '../styles/portal.js';
|
|
17
|
+
import { useFormControlContext } from '../FormControl/context.js';
|
|
18
|
+
|
|
19
|
+
const CalendarTodayOutlinedIcon = adaptMuiSvgIcon(CalendarTodayOutlined);
|
|
20
|
+
function DatePicker({
|
|
21
|
+
placement = "bottom-start",
|
|
22
|
+
...props
|
|
23
|
+
}) {
|
|
24
|
+
const ctx = useFormControlContext();
|
|
25
|
+
const disabled = props.disabled ?? ctx.disabled;
|
|
26
|
+
const error = props.error ?? ctx.error;
|
|
27
|
+
const formatProps = {
|
|
28
|
+
label: "Date Picker",
|
|
29
|
+
// TODO: perhaps get from context?
|
|
30
|
+
value: props.value ? parseDate(props.value) : void 0,
|
|
31
|
+
shouldForceLeadingZeros: props.shouldForceLeadingZeros,
|
|
32
|
+
defaultValue: props.defaultValue ? parseDate(props.defaultValue) : void 0,
|
|
33
|
+
onChange: (newValue) => {
|
|
34
|
+
props.onChange?.(newValue.toString());
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const ref = useRef(null);
|
|
38
|
+
const state = useDatePickerState(formatProps);
|
|
39
|
+
const {
|
|
40
|
+
groupProps,
|
|
41
|
+
/*labelProps,*/
|
|
42
|
+
fieldProps,
|
|
43
|
+
buttonProps,
|
|
44
|
+
calendarProps
|
|
45
|
+
} = useDatePicker(formatProps, state, ref);
|
|
46
|
+
const { refs, floatingStyles, context } = useFloating({
|
|
47
|
+
// ensure floating ui state is up to date with date picker state
|
|
48
|
+
open: state.isOpen,
|
|
49
|
+
// any floating-ui native stuff will trigger this, rippling up to date picker state
|
|
50
|
+
onOpenChange: (open) => {
|
|
51
|
+
open ? state.setOpen(open) : state.close();
|
|
52
|
+
},
|
|
53
|
+
placement
|
|
54
|
+
});
|
|
55
|
+
const role = useRole(context);
|
|
56
|
+
const dismiss = useDismiss(context);
|
|
57
|
+
const { getReferenceProps, getFloatingProps } = useInteractions([
|
|
58
|
+
dismiss,
|
|
59
|
+
role
|
|
60
|
+
]);
|
|
61
|
+
const changeYear = (year) => {
|
|
62
|
+
const currentMonthSelected = state.dateValue?.month ?? 1;
|
|
63
|
+
const currentDaySelected = state.dateValue?.day ?? 1;
|
|
64
|
+
state.setDateValue(
|
|
65
|
+
parseDate(
|
|
66
|
+
`${year}-${currentMonthSelected.toString().length === 1 ? "0" + currentMonthSelected : currentMonthSelected}-${currentDaySelected.toString().length === 1 ? "0" + currentDaySelected : currentDaySelected}`
|
|
67
|
+
)
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
return /* @__PURE__ */ jsxs(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
...getReferenceProps(),
|
|
74
|
+
ref: refs.setReference,
|
|
75
|
+
"data-testid": props["data-testid"],
|
|
76
|
+
className: modules_efc4e723.reactAriaDatePicker,
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ jsxs(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
...groupProps,
|
|
82
|
+
ref,
|
|
83
|
+
"data-disabled": disabled,
|
|
84
|
+
"data-focused": state.isOpen,
|
|
85
|
+
"data-error": error,
|
|
86
|
+
className: modules_efc4e723.reactAriaGroup,
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ jsx(DateField, { ...fieldProps }),
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
IconButton,
|
|
91
|
+
{
|
|
92
|
+
...buttonProps,
|
|
93
|
+
disabled,
|
|
94
|
+
onClick: () => context.onOpenChange(!context.open),
|
|
95
|
+
className: modules_efc4e723.reactAriaButton,
|
|
96
|
+
children: /* @__PURE__ */ jsx(CalendarTodayOutlinedIcon, {})
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
context.open && /* @__PURE__ */ jsx(FloatingPortal, { root: props.portalEl, children: /* @__PURE__ */ jsx(FloatingFocusManager, { context, modal: false, children: /* @__PURE__ */ jsx(PortalThemeRelay, { children: /* @__PURE__ */ jsx(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
ref: refs.setFloating,
|
|
106
|
+
style: {
|
|
107
|
+
...floatingStyles
|
|
108
|
+
},
|
|
109
|
+
...getFloatingProps(),
|
|
110
|
+
children: /* @__PURE__ */ jsx(Calendar, { ...calendarProps, changeYear })
|
|
111
|
+
}
|
|
112
|
+
) }) }) })
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export { DatePicker as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
var modules_efc4e723 = {"reactAriaDatePicker":"vt_ce_DatePicker_reactAriaDatePicker__c88815e1","reactAriaGroup":"vt_ce_DatePicker_reactAriaGroup__c88815e1","reactAriaButton":"vt_ce_DatePicker_reactAriaButton__c88815e1","reactAriaDateInput":"vt_ce_DatePicker_reactAriaDateInput__c88815e1","calendarBox":"vt_ce_DatePicker_calendarBox__c88815e1","calendarHeader":"vt_ce_DatePicker_calendarHeader__c88815e1","monthPickerArrowButtonsWrapper":"vt_ce_DatePicker_monthPickerArrowButtonsWrapper__c88815e1","yearPickerLayout":"vt_ce_DatePicker_yearPickerLayout__c88815e1","yearPillButton":"vt_ce_DatePicker_yearPillButton__c88815e1","calendarGrid":"vt_ce_DatePicker_calendarGrid__c88815e1","weekdayHeader":"vt_ce_DatePicker_weekdayHeader__c88815e1","calendarCellBtn":"vt_ce_DatePicker_calendarCellBtn__c88815e1"};
|
|
2
|
+
|
|
3
|
+
export { modules_efc4e723 as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
'use client';
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import DatePicker from '../DatePicker/index.js';
|
|
5
|
+
import modules_efc4e723 from './styles.module.scss.js';
|
|
6
|
+
import FormControl from '../FormControl/index.js';
|
|
7
|
+
import { useFormControlContext } from '../FormControl/context.js';
|
|
8
|
+
|
|
9
|
+
function DateRangePicker({
|
|
10
|
+
startDate,
|
|
11
|
+
endDate,
|
|
12
|
+
portalEl
|
|
13
|
+
}) {
|
|
14
|
+
const ctx = useFormControlContext();
|
|
15
|
+
return /* @__PURE__ */ jsxs("span", { className: modules_efc4e723.dateRangePickerWrapper, children: [
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
FormControl,
|
|
18
|
+
{
|
|
19
|
+
disabled: ctx.disabled,
|
|
20
|
+
error: ctx.error,
|
|
21
|
+
...startDate.control,
|
|
22
|
+
children: /* @__PURE__ */ jsx(DatePicker, { ...startDate.props, portalEl })
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
FormControl,
|
|
27
|
+
{
|
|
28
|
+
disabled: ctx.disabled,
|
|
29
|
+
error: ctx.error,
|
|
30
|
+
...endDate.control,
|
|
31
|
+
children: /* @__PURE__ */ jsx(DatePicker, { ...endDate.props, portalEl })
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { DateRangePicker as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var modules_efc4e723 = {"drawer-overlay":"
|
|
1
|
+
var modules_efc4e723 = {"drawer-overlay":"vt_ce_Drawer_drawerOverlay__8f34504f","drawer-overlay-enabled":"vt_ce_Drawer_drawerOverlayEnabled__8f34504f","drawer-overlay-strategy-fixed":"vt_ce_Drawer_drawerOverlayStrategyFixed__8f34504f","drawer-overlay-strategy-absolute":"vt_ce_Drawer_drawerOverlayStrategyAbsolute__8f34504f","drawer-overlay-placement-start":"vt_ce_Drawer_drawerOverlayPlacementStart__8f34504f","drawer":"vt_ce_Drawer_drawer__8f34504f","drawer-overlay-placement-end":"vt_ce_Drawer_drawerOverlayPlacementEnd__8f34504f","drawer-wrapper":"vt_ce_Drawer_drawerWrapper__8f34504f","drawer-start":"vt_ce_Drawer_drawerStart__8f34504f","drawer-end":"vt_ce_Drawer_drawerEnd__8f34504f","drawer-content":"vt_ce_Drawer_drawerContent__8f34504f","drawer-title-container":"vt_ce_Drawer_drawerTitleContainer__8f34504f","drawer-title":"vt_ce_Drawer_drawerTitle__8f34504f","drawer-title-actions":"vt_ce_Drawer_drawerTitleActions__8f34504f","drawer-typography":"vt_ce_Drawer_drawerTypography__8f34504f","drawer-actions":"vt_ce_Drawer_drawerActions__8f34504f"};
|
|
2
2
|
|
|
3
3
|
export { modules_efc4e723 as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var modules_efc4e723 = {"form-control":"
|
|
1
|
+
var modules_efc4e723 = {"form-control":"vt_ce_FormControl_formControl__876f6d27","placement-block-start":"vt_ce_FormControl_placementBlockStart__876f6d27","label":"vt_ce_FormControl_label__876f6d27","placement-inline-start":"vt_ce_FormControl_placementInlineStart__876f6d27","placement-inline-end":"vt_ce_FormControl_placementInlineEnd__876f6d27","inner-control":"vt_ce_FormControl_innerControl__876f6d27","help-label":"vt_ce_FormControl_helpLabel__876f6d27","error-label":"vt_ce_FormControl_errorLabel__876f6d27"};
|
|
2
2
|
|
|
3
3
|
export { modules_efc4e723 as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var modules_efc4e723 = {"input":"
|
|
1
|
+
var modules_efc4e723 = {"input":"vt_ce_Input_input__81e6382e","inner-input":"vt_ce_Input_innerInput__81e6382e","input-icon":"vt_ce_Input_inputIcon__81e6382e"};
|
|
2
2
|
|
|
3
3
|
export { modules_efc4e723 as default };
|
|
@@ -10,7 +10,7 @@ import '@mui/system';
|
|
|
10
10
|
import { PortalThemeRelay } from '../styles/portal.js';
|
|
11
11
|
import '../styles/styled.js';
|
|
12
12
|
import '../Box/index.js';
|
|
13
|
-
import { useListItem, useMergeRefs, useFloating, offset, flip, shift, size, autoUpdate, useRole, useDismiss, useListNavigation, useTypeahead, useInteractions, FloatingList, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
13
|
+
import { useListItem, useMergeRefs, useFloating, offset, flip, shift, size, autoUpdate, useRole, useDismiss, useListNavigation, useTypeahead, useInteractions, useTransitionStyles, FloatingList, FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
|
14
14
|
import modules_efc4e723 from './styles.module.scss.js';
|
|
15
15
|
import { resolvePopoverAnchor } from '../popover/utils.js';
|
|
16
16
|
|
|
@@ -85,7 +85,14 @@ function Menu({
|
|
|
85
85
|
listNavigation,
|
|
86
86
|
typeahead
|
|
87
87
|
]);
|
|
88
|
-
|
|
88
|
+
const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {
|
|
89
|
+
duration: 112,
|
|
90
|
+
initial: {
|
|
91
|
+
opacity: 0,
|
|
92
|
+
transform: `scale(95%)`
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return /* @__PURE__ */ jsx(FloatingList, { elementsRef, labelsRef, children: isMounted && /* @__PURE__ */ jsx(FloatingPortal, { root: props.portalEl, children: /* @__PURE__ */ jsx(
|
|
89
96
|
FloatingFocusManager,
|
|
90
97
|
{
|
|
91
98
|
context,
|
|
@@ -100,32 +107,41 @@ function Menu({
|
|
|
100
107
|
tabIndex: 0,
|
|
101
108
|
"aria-labelledby": anchor?.id || props.anchorId,
|
|
102
109
|
style: {
|
|
103
|
-
...floatingStyles
|
|
104
|
-
...props.style
|
|
110
|
+
...floatingStyles
|
|
105
111
|
},
|
|
106
112
|
...getFloatingProps(),
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
MenuItem,
|
|
113
|
+
children: /* @__PURE__ */ jsx(
|
|
114
|
+
"div",
|
|
110
115
|
{
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
116
|
+
style: {
|
|
117
|
+
...transitionStyles,
|
|
118
|
+
...props.style
|
|
119
|
+
},
|
|
120
|
+
className: cx(modules_efc4e723["menu"], className),
|
|
121
|
+
children: options.map((option, i) => /* @__PURE__ */ jsx(
|
|
122
|
+
MenuItem,
|
|
123
|
+
{
|
|
124
|
+
role: "menuitem",
|
|
125
|
+
isActive: i === activeIndex,
|
|
126
|
+
...getItemProps({
|
|
127
|
+
onClick(event) {
|
|
128
|
+
option.onSelect(event);
|
|
129
|
+
}
|
|
130
|
+
}),
|
|
131
|
+
render: option.render,
|
|
132
|
+
label: option.label,
|
|
133
|
+
icon: option.icon
|
|
134
|
+
},
|
|
135
|
+
i
|
|
136
|
+
))
|
|
137
|
+
}
|
|
138
|
+
)
|
|
123
139
|
}
|
|
124
140
|
) })
|
|
125
141
|
}
|
|
126
142
|
) }) });
|
|
127
143
|
}
|
|
128
|
-
const MenuItem = React__default.forwardRef(({ label, disabled, isActive, ...props }, forwardedRef) => {
|
|
144
|
+
const MenuItem = React__default.forwardRef(({ label, render, disabled, isActive, ...props }, forwardedRef) => {
|
|
129
145
|
const item = useListItem({ label: disabled ? null : label });
|
|
130
146
|
return /* @__PURE__ */ jsxs(
|
|
131
147
|
"button",
|
|
@@ -139,7 +155,7 @@ const MenuItem = React__default.forwardRef(({ label, disabled, isActive, ...prop
|
|
|
139
155
|
disabled,
|
|
140
156
|
children: [
|
|
141
157
|
props.icon && /* @__PURE__ */ jsx("span", { className: modules_efc4e723["option-icon"], children: props.icon }),
|
|
142
|
-
/* @__PURE__ */ jsx("span", { className: modules_efc4e723["option-label"], children: label })
|
|
158
|
+
/* @__PURE__ */ jsx("span", { className: modules_efc4e723["option-label"], children: render ?? label })
|
|
143
159
|
]
|
|
144
160
|
}
|
|
145
161
|
);
|
|
@@ -13,7 +13,16 @@ import '../Box/index.js';
|
|
|
13
13
|
import '../styles/styled.js';
|
|
14
14
|
|
|
15
15
|
const RadioButton = forwardRef(
|
|
16
|
-
({
|
|
16
|
+
({
|
|
17
|
+
defaultChecked,
|
|
18
|
+
checked,
|
|
19
|
+
label,
|
|
20
|
+
disabled = false,
|
|
21
|
+
"data-testid": dataTestId,
|
|
22
|
+
style,
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}, ref) => {
|
|
17
26
|
const inputRef = useRef(null);
|
|
18
27
|
const forkedRef = useForkRef(inputRef, ref);
|
|
19
28
|
const labelId = useId();
|
|
@@ -22,33 +31,33 @@ const RadioButton = forwardRef(
|
|
|
22
31
|
{
|
|
23
32
|
role: "radio",
|
|
24
33
|
"aria-labelledby": labelId,
|
|
25
|
-
"aria-checked": checked,
|
|
34
|
+
"aria-checked": checked ?? defaultChecked,
|
|
26
35
|
"aria-disabled": disabled,
|
|
27
36
|
onClick: (e) => {
|
|
28
37
|
inputRef.current?.click();
|
|
29
38
|
e.stopPropagation();
|
|
30
39
|
e.preventDefault();
|
|
31
40
|
},
|
|
32
|
-
"data-testid":
|
|
33
|
-
style
|
|
34
|
-
className: cx(modules_efc4e723["radio"],
|
|
41
|
+
"data-testid": dataTestId,
|
|
42
|
+
style,
|
|
43
|
+
className: cx(modules_efc4e723["radio"], className),
|
|
35
44
|
children: [
|
|
36
45
|
/* @__PURE__ */ jsxs("label", { className: modules_efc4e723["passthrough-label-container"], children: [
|
|
37
46
|
/* @__PURE__ */ jsx(
|
|
38
47
|
"input",
|
|
39
48
|
{
|
|
49
|
+
...props,
|
|
40
50
|
type: "radio",
|
|
41
|
-
name: props.name,
|
|
42
51
|
ref: forkedRef,
|
|
52
|
+
defaultChecked,
|
|
43
53
|
checked,
|
|
44
54
|
disabled,
|
|
45
|
-
onChange: props.onChange,
|
|
46
55
|
className: modules_efc4e723["invisible-radio"]
|
|
47
56
|
}
|
|
48
57
|
),
|
|
49
58
|
/* @__PURE__ */ jsx("span", { className: modules_efc4e723["icon-container"], children: /* @__PURE__ */ jsx(RadioIcon, {}) })
|
|
50
59
|
] }),
|
|
51
|
-
|
|
60
|
+
label && /* @__PURE__ */ jsx("span", { className: modules_efc4e723["visible-label"], id: labelId, children: label })
|
|
52
61
|
]
|
|
53
62
|
}
|
|
54
63
|
);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var modules_efc4e723 = {"radio":"
|
|
1
|
+
var modules_efc4e723 = {"radio":"vt_ce_RadioButton_radio__903bab82","radio-circle-outer":"vt_ce_RadioButton_radioCircleOuter__903bab82","radio-circle-inner":"vt_ce_RadioButton_radioCircleInner__903bab82","passthrough-label-container":"vt_ce_RadioButton_passthroughLabelContainer__903bab82","invisible-radio":"vt_ce_RadioButton_invisibleRadio__903bab82","visible-label":"vt_ce_RadioButton_visibleLabel__903bab82","icon-container":"vt_ce_RadioButton_iconContainer__903bab82"};
|
|
2
2
|
|
|
3
3
|
export { modules_efc4e723 as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var modules_efc4e723 = {"select":"
|
|
1
|
+
var modules_efc4e723 = {"select":"vt_ce_Select_select__839d0f7a","inner-input":"vt_ce_Select_innerInput__839d0f7a","select-icon":"vt_ce_Select_selectIcon__839d0f7a"};
|
|
2
2
|
|
|
3
3
|
export { modules_efc4e723 as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var modules_efc4e723 = {"textarea":"
|
|
1
|
+
var modules_efc4e723 = {"textarea":"vt_ce_Textarea_textarea__a749e5d6","inner-textarea":"vt_ce_Textarea_innerTextarea__a749e5d6"};
|
|
2
2
|
|
|
3
3
|
export { modules_efc4e723 as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
'use client';
|
|
3
3
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { useFloating, offset, inline, flip, shift, arrow, autoUpdate, useRole, useHover, safePolygon, useFocus, useDismiss, useInteractions, FloatingArrow } from '@floating-ui/react';
|
|
4
|
+
import { useFloating, offset, inline, flip, shift, arrow, autoUpdate, useRole, useHover, safePolygon, useFocus, useDismiss, useInteractions, useTransitionStyles, FloatingArrow } from '@floating-ui/react';
|
|
5
5
|
import React__default from 'react';
|
|
6
6
|
import modules_efc4e723 from './styles.module.scss.js';
|
|
7
7
|
import 'color2k';
|
|
@@ -51,6 +51,13 @@ function Tooltip({
|
|
|
51
51
|
hover,
|
|
52
52
|
dismiss
|
|
53
53
|
]);
|
|
54
|
+
const { isMounted, styles: transitionStyles } = useTransitionStyles(context, {
|
|
55
|
+
duration: 112,
|
|
56
|
+
initial: {
|
|
57
|
+
opacity: 0,
|
|
58
|
+
transform: `scale(95%)`
|
|
59
|
+
}
|
|
60
|
+
});
|
|
54
61
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
55
62
|
/* @__PURE__ */ jsx(
|
|
56
63
|
"span",
|
|
@@ -62,17 +69,16 @@ function Tooltip({
|
|
|
62
69
|
children: props.children
|
|
63
70
|
}
|
|
64
71
|
),
|
|
65
|
-
|
|
72
|
+
isMounted && /* @__PURE__ */ jsxs(
|
|
66
73
|
"div",
|
|
67
74
|
{
|
|
68
75
|
ref: refs.setFloating,
|
|
69
76
|
"data-testid": props["data-testid"],
|
|
70
77
|
style: {
|
|
71
|
-
...floatingStyles
|
|
72
|
-
...props.style
|
|
78
|
+
...floatingStyles
|
|
73
79
|
},
|
|
80
|
+
className: modules_efc4e723["tooltip-float"],
|
|
74
81
|
...getFloatingProps(),
|
|
75
|
-
className: modules_efc4e723["tooltip-body"],
|
|
76
82
|
children: [
|
|
77
83
|
showArrow && /* @__PURE__ */ jsx(
|
|
78
84
|
FloatingArrow,
|
|
@@ -81,10 +87,18 @@ function Tooltip({
|
|
|
81
87
|
context,
|
|
82
88
|
fill: defaultThemeCssVariableUsages.palette.background.primary,
|
|
83
89
|
stroke: defaultThemeCssVariableUsages.palette.background.secondary,
|
|
84
|
-
strokeWidth: 1
|
|
90
|
+
strokeWidth: 1,
|
|
91
|
+
style: { ...transitionStyles }
|
|
85
92
|
}
|
|
86
93
|
),
|
|
87
|
-
/* @__PURE__ */ jsx(
|
|
94
|
+
/* @__PURE__ */ jsx(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
style: { ...transitionStyles, ...props.style },
|
|
98
|
+
className: modules_efc4e723["tooltip-body"],
|
|
99
|
+
children: props.tooltip
|
|
100
|
+
}
|
|
101
|
+
)
|
|
88
102
|
]
|
|
89
103
|
}
|
|
90
104
|
)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var modules_efc4e723 = {"tooltip-anchor":"
|
|
1
|
+
var modules_efc4e723 = {"tooltip-anchor":"vt_ce_Tooltip_tooltipAnchor__eccca1a2","tooltip-float":"vt_ce_Tooltip_tooltipFloat__eccca1a2","tooltip-body":"vt_ce_Tooltip_tooltipBody__eccca1a2"};
|
|
2
2
|
|
|
3
3
|
export { modules_efc4e723 as default };
|
|
@@ -11,7 +11,7 @@ import '../styles/styled.js';
|
|
|
11
11
|
import modules_b5c3b63b from './variants.module.scss.js';
|
|
12
12
|
|
|
13
13
|
const Typography = forwardRef(
|
|
14
|
-
({ variant = "paragraph1", color = "
|
|
14
|
+
({ variant = "paragraph1", color = "primary", ...props }, ref) => {
|
|
15
15
|
const variantCn = modules_b5c3b63b[`t-${variant}`];
|
|
16
16
|
const VariantComponent = props.as ?? variantComponents[variant];
|
|
17
17
|
const colorCn = modules_b5c3b63b[`c-${color}`];
|
package/dist/esm/index.js
CHANGED
|
@@ -19,6 +19,8 @@ export { default as Button } from './Button/index.js';
|
|
|
19
19
|
export { default as Checkbox } from './Checkbox/index.js';
|
|
20
20
|
export { default as Chip } from './Chip/index.js';
|
|
21
21
|
export { default as CircularProgress } from './CircularProgress/index.js';
|
|
22
|
+
export { default as DatePicker } from './DatePicker/index.js';
|
|
23
|
+
export { default as DateRangePicker } from './DateRangePicker/index.js';
|
|
22
24
|
export { default as Dialog, DialogActions, DialogCloseButton, DialogCloseIconButton, DialogContent, DialogDescription, DialogEnd, DialogStart, DialogTitle, DialogTypography } from './Dialog/components.js';
|
|
23
25
|
export { createDialogComponent } from './Dialog/factory.js';
|
|
24
26
|
export { default as Drawer, DrawerActions, DrawerCloseButton, DrawerCloseIconButton, DrawerContent, DrawerDescription, DrawerEnd, DrawerStart, DrawerTitle, DrawerTypography } from './Drawer/components.js';
|