@opengovsg/oui 0.0.0-snapshot-20250919051751 → 0.0.0-snapshot-20250923040433
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/button/button.cjs +1 -1
- package/dist/cjs/calendar/calendar-bottom-content.cjs +10 -4
- package/dist/cjs/calendar/calendar.cjs +3 -1
- package/dist/cjs/combo-box/combo-box.cjs +1 -1
- package/dist/cjs/date-picker/date-picker.cjs +1 -1
- package/dist/cjs/date-range-picker/date-range-picker.cjs +2 -2
- package/dist/cjs/index.cjs +54 -54
- package/dist/cjs/menu/menu.cjs +1 -1
- package/dist/cjs/range-calendar/range-calendar.cjs +3 -1
- package/dist/cjs/select/select.cjs +1 -1
- package/dist/cjs/tag-field/tag-field.cjs +2 -2
- package/dist/esm/button/button.js +1 -1
- package/dist/esm/calendar/calendar-bottom-content.js +11 -5
- package/dist/esm/calendar/calendar.js +3 -1
- package/dist/esm/combo-box/combo-box.js +1 -1
- package/dist/esm/date-picker/date-picker.js +1 -1
- package/dist/esm/date-range-picker/date-range-picker.js +2 -2
- package/dist/esm/index.js +19 -19
- package/dist/esm/menu/menu.js +1 -1
- package/dist/esm/range-calendar/range-calendar.js +3 -1
- package/dist/esm/select/select.js +1 -1
- package/dist/esm/tag-field/tag-field.js +2 -2
- package/dist/types/calendar/calendar-bottom-content.d.ts +3 -1
- package/dist/types/calendar/calendar-bottom-content.d.ts.map +1 -1
- package/dist/types/calendar/calendar.d.ts.map +1 -1
- package/dist/types/calendar/types.d.ts +5 -0
- package/dist/types/calendar/types.d.ts.map +1 -1
- package/dist/types/range-calendar/range-calendar.d.ts +5 -0
- package/dist/types/range-calendar/range-calendar.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -7,9 +7,9 @@ var $670gB$react = require('react');
|
|
|
7
7
|
var utils = require('@react-aria/utils');
|
|
8
8
|
var reactAriaComponents = require('react-aria-components');
|
|
9
9
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
10
|
+
var ripple = require('../ripple/ripple.cjs');
|
|
10
11
|
var useRipple = require('../ripple/use-ripple.cjs');
|
|
11
12
|
var spinner = require('../spinner/spinner.cjs');
|
|
12
|
-
var ripple = require('../ripple/ripple.cjs');
|
|
13
13
|
|
|
14
14
|
const Button = $670gB$react.forwardRef(
|
|
15
15
|
({
|
|
@@ -12,11 +12,19 @@ var useCalendarI18n = require('./hooks/use-calendar-i18n.cjs');
|
|
|
12
12
|
|
|
13
13
|
const CalendarBottomContent = ({
|
|
14
14
|
bottomContent,
|
|
15
|
-
showTodayButton
|
|
15
|
+
showTodayButton,
|
|
16
|
+
shouldSetDateOnTodayButtonClick
|
|
16
17
|
}) => {
|
|
17
18
|
const state = $670gB$react.useContext(agnosticCalendarStateContext.AgnosticCalendarStateContext);
|
|
18
19
|
const { slots, classNames, size } = calendarStyleContext.useCalendarStyleContext();
|
|
19
20
|
const formatMessage = useCalendarI18n.useCalendarI18n();
|
|
21
|
+
const handleTodayClick = $670gB$react.useCallback(() => {
|
|
22
|
+
const todayDate = date.today(date.getLocalTimeZone());
|
|
23
|
+
state.setFocusedDate(todayDate);
|
|
24
|
+
if (shouldSetDateOnTodayButtonClick) {
|
|
25
|
+
state.selectDate(todayDate);
|
|
26
|
+
}
|
|
27
|
+
}, [shouldSetDateOnTodayButtonClick, state]);
|
|
20
28
|
if (bottomContent) {
|
|
21
29
|
return bottomContent;
|
|
22
30
|
}
|
|
@@ -38,9 +46,7 @@ const CalendarBottomContent = ({
|
|
|
38
46
|
size,
|
|
39
47
|
slot: null,
|
|
40
48
|
className: slots.todayButton({ className: classNames?.todayButton }),
|
|
41
|
-
onPress:
|
|
42
|
-
state.setFocusedDate(date.today(date.getLocalTimeZone()));
|
|
43
|
-
},
|
|
49
|
+
onPress: handleTodayClick,
|
|
44
50
|
children: formatMessage("today")
|
|
45
51
|
}
|
|
46
52
|
)
|
|
@@ -28,6 +28,7 @@ const Calendar = utils.forwardRefGeneric(function Calendar2(originalProps, ref)
|
|
|
28
28
|
maxValue = new date.CalendarDate(2100, 12, 31),
|
|
29
29
|
bottomContent,
|
|
30
30
|
showTodayButton = true,
|
|
31
|
+
shouldSetDateOnTodayButtonClick,
|
|
31
32
|
errorMessage,
|
|
32
33
|
...restProps
|
|
33
34
|
} = props;
|
|
@@ -126,7 +127,8 @@ const Calendar = utils.forwardRefGeneric(function Calendar2(originalProps, ref)
|
|
|
126
127
|
calendarBottomContent.CalendarBottomContent,
|
|
127
128
|
{
|
|
128
129
|
bottomContent,
|
|
129
|
-
showTodayButton
|
|
130
|
+
showTodayButton,
|
|
131
|
+
shouldSetDateOnTodayButtonClick
|
|
130
132
|
}
|
|
131
133
|
)
|
|
132
134
|
] }) }),
|
|
@@ -7,13 +7,13 @@ var $670gB$react = require('react');
|
|
|
7
7
|
var reactAria = require('react-aria');
|
|
8
8
|
var reactAriaComponents = require('react-aria-components');
|
|
9
9
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
10
|
+
var popover = require('../popover/popover.cjs');
|
|
10
11
|
var utils = require('../system/utils.cjs');
|
|
11
12
|
var comboBoxVariantContext = require('./combo-box-variant-context.cjs');
|
|
12
13
|
var field = require('../field/field.cjs');
|
|
13
14
|
var chevronUp = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs');
|
|
14
15
|
var chevronDown = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs');
|
|
15
16
|
var x = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.cjs');
|
|
16
|
-
var popover = require('../popover/popover.cjs');
|
|
17
17
|
|
|
18
18
|
const calculateEstimatedRowHeight = (size) => {
|
|
19
19
|
switch (size) {
|
|
@@ -6,13 +6,13 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
7
|
var reactAriaComponents = require('react-aria-components');
|
|
8
8
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
9
|
+
var popover = require('../popover/popover.cjs');
|
|
9
10
|
var utils = require('../system/utils.cjs');
|
|
10
11
|
var dateField = require('../date-field/date-field.cjs');
|
|
11
12
|
var calendar = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.cjs');
|
|
12
13
|
var calendar$1 = require('../calendar/calendar.cjs');
|
|
13
14
|
var field = require('../field/field.cjs');
|
|
14
15
|
var button = require('../button/button.cjs');
|
|
15
|
-
var popover = require('../popover/popover.cjs');
|
|
16
16
|
|
|
17
17
|
function DatePicker(originalProps) {
|
|
18
18
|
const [
|
|
@@ -7,13 +7,13 @@ var $670gB$react = require('react');
|
|
|
7
7
|
var date = require('@internationalized/date');
|
|
8
8
|
var reactAriaComponents = require('react-aria-components');
|
|
9
9
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
10
|
+
var popover = require('../popover/popover.cjs');
|
|
11
|
+
var rangeCalendar = require('../range-calendar/range-calendar.cjs');
|
|
10
12
|
var utils = require('../system/utils.cjs');
|
|
11
13
|
var calendar = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.cjs');
|
|
12
|
-
var rangeCalendar = require('../range-calendar/range-calendar.cjs');
|
|
13
14
|
var field = require('../field/field.cjs');
|
|
14
15
|
var dateField = require('../date-field/date-field.cjs');
|
|
15
16
|
var button = require('../button/button.cjs');
|
|
16
|
-
var popover = require('../popover/popover.cjs');
|
|
17
17
|
|
|
18
18
|
function DateRangePicker(originalProps) {
|
|
19
19
|
const [
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var textField = require('./text-field/text-field.cjs');
|
|
5
|
-
var select = require('./select/select.cjs');
|
|
6
|
-
var selectItem = require('./select/select-item.cjs');
|
|
7
|
-
var selectVariantContext = require('./select/select-variant-context.cjs');
|
|
8
|
-
var useControllableState = require('./hooks/use-controllable-state.cjs');
|
|
9
|
-
var button = require('./button/button.cjs');
|
|
10
|
-
var govtBanner = require('./govt-banner/govt-banner.cjs');
|
|
11
4
|
var ripple = require('./ripple/ripple.cjs');
|
|
12
5
|
var useRipple = require('./ripple/use-ripple.cjs');
|
|
13
6
|
var spinner = require('./spinner/spinner.cjs');
|
|
@@ -15,59 +8,92 @@ var useSpinner = require('./spinner/use-spinner.cjs');
|
|
|
15
8
|
var toggle = require('./toggle/toggle.cjs');
|
|
16
9
|
var skipNavLink = require('./skip-nav-link/skip-nav-link.cjs');
|
|
17
10
|
var input = require('./input/input.cjs');
|
|
18
|
-
var
|
|
11
|
+
var textField = require('./text-field/text-field.cjs');
|
|
19
12
|
var textArea = require('./text-area/text-area.cjs');
|
|
20
13
|
var textAreaField = require('./text-area-field/text-area-field.cjs');
|
|
14
|
+
var tagField = require('./tag-field/tag-field.cjs');
|
|
15
|
+
var tagFieldItem = require('./tag-field/tag-field-item.cjs');
|
|
16
|
+
var select = require('./select/select.cjs');
|
|
17
|
+
var selectItem = require('./select/select-item.cjs');
|
|
18
|
+
var selectVariantContext = require('./select/select-variant-context.cjs');
|
|
19
|
+
var rangeCalendar = require('./range-calendar/range-calendar.cjs');
|
|
20
|
+
var menu = require('./menu/menu.cjs');
|
|
21
|
+
var popover = require('./popover/popover.cjs');
|
|
22
|
+
var tabs = require('./tabs/tabs.cjs');
|
|
23
|
+
var pagination = require('./pagination/pagination.cjs');
|
|
24
|
+
var paginationCursor = require('./pagination/pagination-cursor.cjs');
|
|
25
|
+
var paginationItem = require('./pagination/pagination-item.cjs');
|
|
26
|
+
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
27
|
+
var usePagination$1 = require('./pagination/use-pagination.cjs');
|
|
28
|
+
var useControllableState = require('./hooks/use-controllable-state.cjs');
|
|
29
|
+
var button = require('./button/button.cjs');
|
|
30
|
+
var govtBanner = require('./govt-banner/govt-banner.cjs');
|
|
31
|
+
var field = require('./field/field.cjs');
|
|
21
32
|
var comboBox = require('./combo-box/combo-box.cjs');
|
|
22
33
|
var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
|
|
23
34
|
var comboBoxItem = require('./combo-box/combo-box-item.cjs');
|
|
24
35
|
var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
|
|
25
36
|
var banner = require('./banner/banner.cjs');
|
|
26
|
-
var tagField = require('./tag-field/tag-field.cjs');
|
|
27
|
-
var tagFieldItem = require('./tag-field/tag-field-item.cjs');
|
|
28
37
|
var badge = require('./badge/badge.cjs');
|
|
29
38
|
var date = require('@internationalized/date');
|
|
30
39
|
var calendar = require('./calendar/calendar.cjs');
|
|
31
40
|
var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
|
|
32
41
|
var utils = require('./calendar/utils.cjs');
|
|
33
|
-
var rangeCalendar = require('./range-calendar/range-calendar.cjs');
|
|
34
|
-
var menu = require('./menu/menu.cjs');
|
|
35
|
-
var popover = require('./popover/popover.cjs');
|
|
36
|
-
var tabs = require('./tabs/tabs.cjs');
|
|
37
42
|
var dateField = require('./date-field/date-field.cjs');
|
|
38
43
|
var datePicker = require('./date-picker/date-picker.cjs');
|
|
39
44
|
var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
|
|
40
45
|
var checkbox = require('./checkbox/checkbox.cjs');
|
|
41
46
|
var checkboxGroupStyleContext = require('./checkbox/checkbox-group-style-context.cjs');
|
|
42
|
-
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
43
|
-
var pagination = require('./pagination/pagination.cjs');
|
|
44
|
-
var paginationCursor = require('./pagination/pagination-cursor.cjs');
|
|
45
|
-
var paginationItem = require('./pagination/pagination-item.cjs');
|
|
46
|
-
var usePagination$1 = require('./pagination/use-pagination.cjs');
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
+
exports.Ripple = ripple.Ripple;
|
|
51
|
+
exports.useRipple = useRipple.useRipple;
|
|
52
|
+
exports.Spinner = spinner.Spinner;
|
|
53
|
+
exports.useSpinner = useSpinner.useSpinner;
|
|
54
|
+
exports.Toggle = toggle.Toggle;
|
|
55
|
+
exports.SkipNavLink = skipNavLink.SkipNavLink;
|
|
56
|
+
exports.Input = input.Input;
|
|
50
57
|
exports.TextField = textField.TextField;
|
|
58
|
+
exports.TextArea = textArea.TextArea;
|
|
59
|
+
exports.TextAreaField = textAreaField.TextAreaField;
|
|
60
|
+
exports.TagField = tagField.TagField;
|
|
61
|
+
exports.TagFieldItem = tagFieldItem.TagFieldItem;
|
|
51
62
|
exports.Select = select.Select;
|
|
52
63
|
exports.SelectItem = selectItem.SelectItem;
|
|
53
64
|
exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
|
|
54
65
|
exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
|
|
66
|
+
exports.RangeCalendar = rangeCalendar.RangeCalendar;
|
|
67
|
+
exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
|
|
68
|
+
exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
|
|
69
|
+
exports.Menu = menu.Menu;
|
|
70
|
+
exports.MenuItem = menu.MenuItem;
|
|
71
|
+
exports.MenuSection = menu.MenuSection;
|
|
72
|
+
exports.MenuSeparator = menu.MenuSeparator;
|
|
73
|
+
exports.MenuTrigger = menu.MenuTrigger;
|
|
74
|
+
exports.MenuVariantContext = menu.MenuVariantContext;
|
|
75
|
+
exports.SubmenuTrigger = menu.SubmenuTrigger;
|
|
76
|
+
exports.useMenuVariantContext = menu.useMenuVariantContext;
|
|
77
|
+
exports.Popover = popover.Popover;
|
|
78
|
+
exports.Tab = tabs.Tab;
|
|
79
|
+
exports.TabList = tabs.TabList;
|
|
80
|
+
exports.TabPanel = tabs.TabPanel;
|
|
81
|
+
exports.Tabs = tabs.Tabs;
|
|
82
|
+
exports.TabsVariantContext = tabs.TabsVariantContext;
|
|
83
|
+
exports.useTabsVariantContext = tabs.useTabsVariantContext;
|
|
84
|
+
exports.Pagination = pagination.Pagination;
|
|
85
|
+
exports.PaginationCursor = paginationCursor.PaginationCursor;
|
|
86
|
+
exports.PaginationItem = paginationItem.PaginationItem;
|
|
87
|
+
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
88
|
+
exports.CURSOR_TRANSITION_TIMEOUT = usePagination$1.CURSOR_TRANSITION_TIMEOUT;
|
|
89
|
+
exports.usePagination = usePagination$1.usePagination;
|
|
55
90
|
exports.useControllableState = useControllableState.useControllableState;
|
|
56
91
|
exports.Button = button.Button;
|
|
57
92
|
exports.GovtBanner = govtBanner.GovtBanner;
|
|
58
|
-
exports.Ripple = ripple.Ripple;
|
|
59
|
-
exports.useRipple = useRipple.useRipple;
|
|
60
|
-
exports.Spinner = spinner.Spinner;
|
|
61
|
-
exports.useSpinner = useSpinner.useSpinner;
|
|
62
|
-
exports.Toggle = toggle.Toggle;
|
|
63
|
-
exports.SkipNavLink = skipNavLink.SkipNavLink;
|
|
64
|
-
exports.Input = input.Input;
|
|
65
93
|
exports.Description = field.Description;
|
|
66
94
|
exports.FieldError = field.FieldError;
|
|
67
95
|
exports.FieldGroup = field.FieldGroup;
|
|
68
96
|
exports.Label = field.Label;
|
|
69
|
-
exports.TextArea = textArea.TextArea;
|
|
70
|
-
exports.TextAreaField = textAreaField.TextAreaField;
|
|
71
97
|
exports.ComboBox = comboBox.ComboBox;
|
|
72
98
|
exports.ComboBoxEmptyState = comboBox.ComboBoxEmptyState;
|
|
73
99
|
exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
|
|
@@ -75,8 +101,6 @@ exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
|
|
|
75
101
|
exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
|
|
76
102
|
exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
|
|
77
103
|
exports.Banner = banner.Banner;
|
|
78
|
-
exports.TagField = tagField.TagField;
|
|
79
|
-
exports.TagFieldItem = tagFieldItem.TagFieldItem;
|
|
80
104
|
exports.Badge = badge.Badge;
|
|
81
105
|
Object.defineProperty(exports, "CalendarDate", {
|
|
82
106
|
enumerable: true,
|
|
@@ -90,24 +114,6 @@ exports.getEraFormat = utils.getEraFormat;
|
|
|
90
114
|
exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
|
|
91
115
|
exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
|
|
92
116
|
exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
|
|
93
|
-
exports.RangeCalendar = rangeCalendar.RangeCalendar;
|
|
94
|
-
exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
|
|
95
|
-
exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
|
|
96
|
-
exports.Menu = menu.Menu;
|
|
97
|
-
exports.MenuItem = menu.MenuItem;
|
|
98
|
-
exports.MenuSection = menu.MenuSection;
|
|
99
|
-
exports.MenuSeparator = menu.MenuSeparator;
|
|
100
|
-
exports.MenuTrigger = menu.MenuTrigger;
|
|
101
|
-
exports.MenuVariantContext = menu.MenuVariantContext;
|
|
102
|
-
exports.SubmenuTrigger = menu.SubmenuTrigger;
|
|
103
|
-
exports.useMenuVariantContext = menu.useMenuVariantContext;
|
|
104
|
-
exports.Popover = popover.Popover;
|
|
105
|
-
exports.Tab = tabs.Tab;
|
|
106
|
-
exports.TabList = tabs.TabList;
|
|
107
|
-
exports.TabPanel = tabs.TabPanel;
|
|
108
|
-
exports.Tabs = tabs.Tabs;
|
|
109
|
-
exports.TabsVariantContext = tabs.TabsVariantContext;
|
|
110
|
-
exports.useTabsVariantContext = tabs.useTabsVariantContext;
|
|
111
117
|
exports.DateField = dateField.DateField;
|
|
112
118
|
exports.DateInput = dateField.DateInput;
|
|
113
119
|
exports.DatePicker = datePicker.DatePicker;
|
|
@@ -116,9 +122,3 @@ exports.Checkbox = checkbox.Checkbox;
|
|
|
116
122
|
exports.CheckboxGroup = checkbox.CheckboxGroup;
|
|
117
123
|
exports.CheckboxGroupStyleContext = checkboxGroupStyleContext.CheckboxGroupStyleContext;
|
|
118
124
|
exports.useCheckboxGroupStyleContext = checkboxGroupStyleContext.useCheckboxGroupStyleContext;
|
|
119
|
-
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
120
|
-
exports.Pagination = pagination.Pagination;
|
|
121
|
-
exports.PaginationCursor = paginationCursor.PaginationCursor;
|
|
122
|
-
exports.PaginationItem = paginationItem.PaginationItem;
|
|
123
|
-
exports.CURSOR_TRANSITION_TIMEOUT = usePagination$1.CURSOR_TRANSITION_TIMEOUT;
|
|
124
|
-
exports.usePagination = usePagination$1.usePagination;
|
package/dist/cjs/menu/menu.cjs
CHANGED
|
@@ -6,11 +6,11 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
7
|
var reactAriaComponents = require('react-aria-components');
|
|
8
8
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
9
|
+
var popover = require('../popover/popover.cjs');
|
|
9
10
|
var utils = require('../system/utils.cjs');
|
|
10
11
|
var check = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.cjs');
|
|
11
12
|
var chevronRight = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs');
|
|
12
13
|
var context = require('../system/react-utils/context.cjs');
|
|
13
|
-
var popover = require('../popover/popover.cjs');
|
|
14
14
|
|
|
15
15
|
const [MenuVariantContext, useMenuVariantContext] = context.createContext({
|
|
16
16
|
name: "MenuVariantContext",
|
|
@@ -28,6 +28,7 @@ const RangeCalendar = utils.forwardRefGeneric(function RangeCalendar2(originalPr
|
|
|
28
28
|
maxValue = new date.CalendarDate(2100, 12, 31),
|
|
29
29
|
bottomContent,
|
|
30
30
|
showTodayButton = true,
|
|
31
|
+
shouldSetDateOnTodayButtonClick,
|
|
31
32
|
errorMessage,
|
|
32
33
|
...restProps
|
|
33
34
|
} = props;
|
|
@@ -117,7 +118,8 @@ const RangeCalendar = utils.forwardRefGeneric(function RangeCalendar2(originalPr
|
|
|
117
118
|
calendarBottomContent.CalendarBottomContent,
|
|
118
119
|
{
|
|
119
120
|
bottomContent,
|
|
120
|
-
showTodayButton
|
|
121
|
+
showTodayButton,
|
|
122
|
+
shouldSetDateOnTodayButtonClick
|
|
121
123
|
}
|
|
122
124
|
)
|
|
123
125
|
] }) }),
|
|
@@ -6,11 +6,11 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
7
|
var reactAriaComponents = require('react-aria-components');
|
|
8
8
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
9
|
+
var popover = require('../popover/popover.cjs');
|
|
9
10
|
var utils = require('../system/utils.cjs');
|
|
10
11
|
var selectVariantContext = require('./select-variant-context.cjs');
|
|
11
12
|
var field = require('../field/field.cjs');
|
|
12
13
|
var chevronDown = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs');
|
|
13
|
-
var popover = require('../popover/popover.cjs');
|
|
14
14
|
var button = require('../button/button.cjs');
|
|
15
15
|
|
|
16
16
|
const calculateEstimatedRowHeight = (size) => {
|
|
@@ -6,6 +6,8 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
7
|
var reactAriaComponents = require('react-aria-components');
|
|
8
8
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
9
|
+
var input = require('../input/input.cjs');
|
|
10
|
+
var popover = require('../popover/popover.cjs');
|
|
9
11
|
var tagFieldItem = require('./tag-field-item.cjs');
|
|
10
12
|
var tagFieldList = require('./tag-field-list.cjs');
|
|
11
13
|
var tagFieldRoot = require('./tag-field-root.cjs');
|
|
@@ -13,8 +15,6 @@ var tagFieldTagList = require('./tag-field-tag-list.cjs');
|
|
|
13
15
|
var tagFieldTrigger = require('./tag-field-trigger.cjs');
|
|
14
16
|
var chevronDown = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs');
|
|
15
17
|
var field = require('../field/field.cjs');
|
|
16
|
-
var input = require('../input/input.cjs');
|
|
17
|
-
var popover = require('../popover/popover.cjs');
|
|
18
18
|
|
|
19
19
|
function TagField({
|
|
20
20
|
classNames,
|
|
@@ -5,9 +5,9 @@ import { forwardRef, useMemo } from 'react';
|
|
|
5
5
|
import { chain } from '@react-aria/utils';
|
|
6
6
|
import { Button as Button$1, composeRenderProps } from 'react-aria-components';
|
|
7
7
|
import { buttonStyles } from '@opengovsg/oui-theme';
|
|
8
|
+
import { Ripple } from '../ripple/ripple.js';
|
|
8
9
|
import { useRipple } from '../ripple/use-ripple.js';
|
|
9
10
|
import { Spinner } from '../spinner/spinner.js';
|
|
10
|
-
import { Ripple } from '../ripple/ripple.js';
|
|
11
11
|
|
|
12
12
|
const Button = forwardRef(
|
|
13
13
|
({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { useContext } from 'react';
|
|
4
|
+
import { useContext, useCallback } from 'react';
|
|
5
5
|
import { today, getLocalTimeZone } from '@internationalized/date';
|
|
6
6
|
import { Button } from '../button/button.js';
|
|
7
7
|
import { AgnosticCalendarStateContext } from './agnostic-calendar-state-context.js';
|
|
@@ -10,11 +10,19 @@ import { useCalendarI18n } from './hooks/use-calendar-i18n.js';
|
|
|
10
10
|
|
|
11
11
|
const CalendarBottomContent = ({
|
|
12
12
|
bottomContent,
|
|
13
|
-
showTodayButton
|
|
13
|
+
showTodayButton,
|
|
14
|
+
shouldSetDateOnTodayButtonClick
|
|
14
15
|
}) => {
|
|
15
16
|
const state = useContext(AgnosticCalendarStateContext);
|
|
16
17
|
const { slots, classNames, size } = useCalendarStyleContext();
|
|
17
18
|
const formatMessage = useCalendarI18n();
|
|
19
|
+
const handleTodayClick = useCallback(() => {
|
|
20
|
+
const todayDate = today(getLocalTimeZone());
|
|
21
|
+
state.setFocusedDate(todayDate);
|
|
22
|
+
if (shouldSetDateOnTodayButtonClick) {
|
|
23
|
+
state.selectDate(todayDate);
|
|
24
|
+
}
|
|
25
|
+
}, [shouldSetDateOnTodayButtonClick, state]);
|
|
18
26
|
if (bottomContent) {
|
|
19
27
|
return bottomContent;
|
|
20
28
|
}
|
|
@@ -36,9 +44,7 @@ const CalendarBottomContent = ({
|
|
|
36
44
|
size,
|
|
37
45
|
slot: null,
|
|
38
46
|
className: slots.todayButton({ className: classNames?.todayButton }),
|
|
39
|
-
onPress:
|
|
40
|
-
state.setFocusedDate(today(getLocalTimeZone()));
|
|
41
|
-
},
|
|
47
|
+
onPress: handleTodayClick,
|
|
42
48
|
children: formatMessage("today")
|
|
43
49
|
}
|
|
44
50
|
)
|
|
@@ -26,6 +26,7 @@ const Calendar = forwardRefGeneric(function Calendar2(originalProps, ref) {
|
|
|
26
26
|
maxValue = new CalendarDate(2100, 12, 31),
|
|
27
27
|
bottomContent,
|
|
28
28
|
showTodayButton = true,
|
|
29
|
+
shouldSetDateOnTodayButtonClick,
|
|
29
30
|
errorMessage,
|
|
30
31
|
...restProps
|
|
31
32
|
} = props;
|
|
@@ -124,7 +125,8 @@ const Calendar = forwardRefGeneric(function Calendar2(originalProps, ref) {
|
|
|
124
125
|
CalendarBottomContent,
|
|
125
126
|
{
|
|
126
127
|
bottomContent,
|
|
127
|
-
showTodayButton
|
|
128
|
+
showTodayButton,
|
|
129
|
+
shouldSetDateOnTodayButtonClick
|
|
128
130
|
}
|
|
129
131
|
)
|
|
130
132
|
] }) }),
|
|
@@ -5,13 +5,13 @@ import { useMemo, useCallback } from 'react';
|
|
|
5
5
|
import { useMessageFormatter } from 'react-aria';
|
|
6
6
|
import { ListLayout, Provider, ComboBox as ComboBox$1, Input, Button, Virtualizer, ListBox } from 'react-aria-components';
|
|
7
7
|
import { listBoxItemStyles, cn, comboBoxStyles, composeTailwindRenderProps, composeRenderProps, comboBoxClearButtonStyles } from '@opengovsg/oui-theme';
|
|
8
|
+
import { Popover } from '../popover/popover.js';
|
|
8
9
|
import { mapPropsVariants } from '../system/utils.js';
|
|
9
10
|
import { ComboBoxVariantContext } from './combo-box-variant-context.js';
|
|
10
11
|
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
11
12
|
import ChevronUp from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-up.js';
|
|
12
13
|
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
13
14
|
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
14
|
-
import { Popover } from '../popover/popover.js';
|
|
15
15
|
|
|
16
16
|
const calculateEstimatedRowHeight = (size) => {
|
|
17
17
|
switch (size) {
|
|
@@ -4,13 +4,13 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { DatePicker as DatePicker$1, Dialog } from 'react-aria-components';
|
|
6
6
|
import { datePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Popover } from '../popover/popover.js';
|
|
7
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
9
|
import { DateInput } from '../date-field/date-field.js';
|
|
9
10
|
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
10
11
|
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
11
12
|
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
13
|
import { Button } from '../button/button.js';
|
|
13
|
-
import { Popover } from '../popover/popover.js';
|
|
14
14
|
|
|
15
15
|
function DatePicker(originalProps) {
|
|
16
16
|
const [
|
|
@@ -5,13 +5,13 @@ import { useMemo } from 'react';
|
|
|
5
5
|
import { CalendarDate } from '@internationalized/date';
|
|
6
6
|
import { DateRangePicker as DateRangePicker$1, Dialog } from 'react-aria-components';
|
|
7
7
|
import { dateRangePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
8
|
+
import { Popover } from '../popover/popover.js';
|
|
9
|
+
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
8
10
|
import { mapPropsVariants } from '../system/utils.js';
|
|
9
11
|
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
10
|
-
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
11
12
|
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
13
|
import { DateInput } from '../date-field/date-field.js';
|
|
13
14
|
import { Button } from '../button/button.js';
|
|
14
|
-
import { Popover } from '../popover/popover.js';
|
|
15
15
|
|
|
16
16
|
function DateRangePicker(originalProps) {
|
|
17
17
|
const [
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
export { TextField } from './text-field/text-field.js';
|
|
3
|
-
export { Select } from './select/select.js';
|
|
4
|
-
export { SelectItem } from './select/select-item.js';
|
|
5
|
-
export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
|
|
6
|
-
export { useControllableState } from './hooks/use-controllable-state.js';
|
|
7
|
-
export { Button } from './button/button.js';
|
|
8
|
-
export { GovtBanner } from './govt-banner/govt-banner.js';
|
|
9
2
|
export { Ripple } from './ripple/ripple.js';
|
|
10
3
|
export { useRipple } from './ripple/use-ripple.js';
|
|
11
4
|
export { Spinner } from './spinner/spinner.js';
|
|
@@ -13,32 +6,39 @@ export { useSpinner } from './spinner/use-spinner.js';
|
|
|
13
6
|
export { Toggle } from './toggle/toggle.js';
|
|
14
7
|
export { SkipNavLink } from './skip-nav-link/skip-nav-link.js';
|
|
15
8
|
export { Input } from './input/input.js';
|
|
16
|
-
export {
|
|
9
|
+
export { TextField } from './text-field/text-field.js';
|
|
17
10
|
export { TextArea } from './text-area/text-area.js';
|
|
18
11
|
export { TextAreaField } from './text-area-field/text-area-field.js';
|
|
12
|
+
export { TagField } from './tag-field/tag-field.js';
|
|
13
|
+
export { TagFieldItem } from './tag-field/tag-field-item.js';
|
|
14
|
+
export { Select } from './select/select.js';
|
|
15
|
+
export { SelectItem } from './select/select-item.js';
|
|
16
|
+
export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
|
|
17
|
+
export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
|
|
18
|
+
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
|
|
19
|
+
export { Popover } from './popover/popover.js';
|
|
20
|
+
export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext } from './tabs/tabs.js';
|
|
21
|
+
export { Pagination } from './pagination/pagination.js';
|
|
22
|
+
export { PaginationCursor } from './pagination/pagination-cursor.js';
|
|
23
|
+
export { PaginationItem } from './pagination/pagination-item.js';
|
|
24
|
+
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
25
|
+
export { CURSOR_TRANSITION_TIMEOUT, usePagination } from './pagination/use-pagination.js';
|
|
26
|
+
export { useControllableState } from './hooks/use-controllable-state.js';
|
|
27
|
+
export { Button } from './button/button.js';
|
|
28
|
+
export { GovtBanner } from './govt-banner/govt-banner.js';
|
|
29
|
+
export { Description, FieldError, FieldGroup, Label } from './field/field.js';
|
|
19
30
|
export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
20
31
|
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
21
32
|
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
22
33
|
export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
|
|
23
34
|
export { Banner } from './banner/banner.js';
|
|
24
|
-
export { TagField } from './tag-field/tag-field.js';
|
|
25
|
-
export { TagFieldItem } from './tag-field/tag-field-item.js';
|
|
26
35
|
export { Badge } from './badge/badge.js';
|
|
27
36
|
export { CalendarDate } from '@internationalized/date';
|
|
28
37
|
export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
29
38
|
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
30
39
|
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
31
|
-
export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
|
|
32
|
-
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
|
|
33
|
-
export { Popover } from './popover/popover.js';
|
|
34
|
-
export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext } from './tabs/tabs.js';
|
|
35
40
|
export { DateField, DateInput } from './date-field/date-field.js';
|
|
36
41
|
export { DatePicker } from './date-picker/date-picker.js';
|
|
37
42
|
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
38
43
|
export { Checkbox, CheckboxGroup } from './checkbox/checkbox.js';
|
|
39
44
|
export { CheckboxGroupStyleContext, useCheckboxGroupStyleContext } from './checkbox/checkbox-group-style-context.js';
|
|
40
|
-
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
41
|
-
export { Pagination } from './pagination/pagination.js';
|
|
42
|
-
export { PaginationCursor } from './pagination/pagination-cursor.js';
|
|
43
|
-
export { PaginationItem } from './pagination/pagination-item.js';
|
|
44
|
-
export { CURSOR_TRANSITION_TIMEOUT, usePagination } from './pagination/use-pagination.js';
|
package/dist/esm/menu/menu.js
CHANGED
|
@@ -4,11 +4,11 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
4
4
|
import { forwardRef, useMemo, useCallback } from 'react';
|
|
5
5
|
import { useContextProps, MenuItem as MenuItem$1, composeRenderProps, Provider, Menu as Menu$1, MenuSection as MenuSection$1, Header, Collection, MenuTrigger as MenuTrigger$1, SubmenuTrigger as SubmenuTrigger$1, Separator } from 'react-aria-components';
|
|
6
6
|
import { listBoxItemStyles, menuItemStyles, menuStyles, menuSectionStyles, menuDividerStyles } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Popover } from '../popover/popover.js';
|
|
7
8
|
import { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
|
|
8
9
|
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.js';
|
|
9
10
|
import ChevronRight from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-right.js';
|
|
10
11
|
import { createContext } from '../system/react-utils/context.js';
|
|
11
|
-
import { Popover } from '../popover/popover.js';
|
|
12
12
|
|
|
13
13
|
const [MenuVariantContext, useMenuVariantContext] = createContext({
|
|
14
14
|
name: "MenuVariantContext",
|
|
@@ -26,6 +26,7 @@ const RangeCalendar = forwardRefGeneric(function RangeCalendar2(originalProps, r
|
|
|
26
26
|
maxValue = new CalendarDate(2100, 12, 31),
|
|
27
27
|
bottomContent,
|
|
28
28
|
showTodayButton = true,
|
|
29
|
+
shouldSetDateOnTodayButtonClick,
|
|
29
30
|
errorMessage,
|
|
30
31
|
...restProps
|
|
31
32
|
} = props;
|
|
@@ -115,7 +116,8 @@ const RangeCalendar = forwardRefGeneric(function RangeCalendar2(originalProps, r
|
|
|
115
116
|
CalendarBottomContent,
|
|
116
117
|
{
|
|
117
118
|
bottomContent,
|
|
118
|
-
showTodayButton
|
|
119
|
+
showTodayButton,
|
|
120
|
+
shouldSetDateOnTodayButtonClick
|
|
119
121
|
}
|
|
120
122
|
)
|
|
121
123
|
] }) }),
|
|
@@ -4,11 +4,11 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { Provider, Select as Select$1, SelectValue, Virtualizer, ListLayout, ListBox } from 'react-aria-components';
|
|
6
6
|
import { selectStyles, composeRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Popover } from '../popover/popover.js';
|
|
7
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
9
|
import { SelectVariantContext } from './select-variant-context.js';
|
|
9
10
|
import { Label, Description, FieldError } from '../field/field.js';
|
|
10
11
|
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
11
|
-
import { Popover } from '../popover/popover.js';
|
|
12
12
|
import { Button } from '../button/button.js';
|
|
13
13
|
|
|
14
14
|
const calculateEstimatedRowHeight = (size) => {
|
|
@@ -4,6 +4,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { createElement } from 'react';
|
|
5
5
|
import { composeRenderProps } from 'react-aria-components';
|
|
6
6
|
import { tagFieldStyles } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Input } from '../input/input.js';
|
|
8
|
+
import { Popover } from '../popover/popover.js';
|
|
7
9
|
import { TagFieldItem } from './tag-field-item.js';
|
|
8
10
|
import { TagFieldList } from './tag-field-list.js';
|
|
9
11
|
import { TagFieldRoot } from './tag-field-root.js';
|
|
@@ -11,8 +13,6 @@ import { TagFieldTagList } from './tag-field-tag-list.js';
|
|
|
11
13
|
import { TagFieldTrigger } from './tag-field-trigger.js';
|
|
12
14
|
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
13
15
|
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
14
|
-
import { Input } from '../input/input.js';
|
|
15
|
-
import { Popover } from '../popover/popover.js';
|
|
16
16
|
|
|
17
17
|
function TagField({
|
|
18
18
|
classNames,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { CalendarDate } from "@internationalized/date";
|
|
2
2
|
import type { CalendarProps } from "./types";
|
|
3
|
-
|
|
3
|
+
type CalendarBottomContentProps<T extends CalendarDate> = Pick<CalendarProps<T>, "bottomContent" | "showTodayButton" | "shouldSetDateOnTodayButtonClick">;
|
|
4
|
+
export declare const CalendarBottomContent: <T extends CalendarDate>({ bottomContent, showTodayButton, shouldSetDateOnTodayButtonClick, }: CalendarBottomContentProps<T>) => string | number | bigint | true | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
+
export {};
|
|
4
6
|
//# sourceMappingURL=calendar-bottom-content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-bottom-content.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar-bottom-content.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAI3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAM5C,
|
|
1
|
+
{"version":3,"file":"calendar-bottom-content.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar-bottom-content.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAI3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAM5C,KAAK,0BAA0B,CAAC,CAAC,SAAS,YAAY,IAAI,IAAI,CAC5D,aAAa,CAAC,CAAC,CAAC,EAChB,eAAe,GAAG,iBAAiB,GAAG,iCAAiC,CACxE,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,YAAY,wEAIzD,0BAA0B,CAAC,CAAC,CAAC,6VAwC/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAiBtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQ5C,eAAO,MAAM,QAAQ,GACnB,CAAC,SAAS,SAAS,
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAiBtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQ5C,eAAO,MAAM,QAAQ,GACnB,CAAC,SAAS,SAAS,8EAqCC,MAAO,SAyF3B,CAAA;AAEF,eAAO,MAAM,oBAAoB,kBAE9B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,4CAQA,CAAA"}
|
|
@@ -43,6 +43,11 @@ export interface CalendarProps<T extends DateValue> extends AriaCalendarProps<T>
|
|
|
43
43
|
* If `bottomContent is provided, this will be ignored.
|
|
44
44
|
*/
|
|
45
45
|
showTodayButton?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* If `true`, clicking on the "Today" button will set the selected date to today.
|
|
48
|
+
* If `false`, it will only move the focus to today's date without changing the selected date.
|
|
49
|
+
*/
|
|
50
|
+
shouldSetDateOnTodayButtonClick?: boolean;
|
|
46
51
|
bottomContent?: ReactNode;
|
|
47
52
|
}
|
|
48
53
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/calendar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,iBAAiB,EACjB,SAAS,EACV,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,SAAS,CAChD,SAAQ,iBAAiB,CAAC,CAAC,CAAC,EAC1B,oBAAoB,EACpB,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAE1C;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/calendar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,iBAAiB,EACjB,SAAS,EACV,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,SAAS,CAChD,SAAQ,iBAAiB,CAAC,CAAC,CAAC,EAC1B,oBAAoB,EACpB,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAE1C;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAA;IACzC,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B"}
|
|
@@ -42,6 +42,11 @@ export interface RangeCalendarProps<T extends DateValue> extends CalendarVariant
|
|
|
42
42
|
* If `bottomContent is provided, this will be ignored.
|
|
43
43
|
*/
|
|
44
44
|
showTodayButton?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* If `true`, clicking on the "Today" button will set the selected date to today.
|
|
47
|
+
* If `false`, it will only move the focus to today's date without changing the selected date.
|
|
48
|
+
*/
|
|
49
|
+
shouldSetDateOnTodayButtonClick?: boolean;
|
|
45
50
|
bottomContent?: React.ReactNode;
|
|
46
51
|
errorMessage?: string;
|
|
47
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-calendar.d.ts","sourceRoot":"","sources":["../../../src/range-calendar/range-calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,IAAI,sBAAsB,EAC5C,iBAAiB,EACjB,SAAS,EACV,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,YAAY,EAIb,MAAM,yBAAyB,CAAA;AAahC,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAe7B,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,SAAS,CACrD,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC,EACvC,sBAAsB,CAAC,CAAC,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAE1C;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE/B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,aAAa,GACxB,CAAC,SAAS,SAAS,
|
|
1
|
+
{"version":3,"file":"range-calendar.d.ts","sourceRoot":"","sources":["../../../src/range-calendar/range-calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,IAAI,sBAAsB,EAC5C,iBAAiB,EACjB,SAAS,EACV,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,YAAY,EAIb,MAAM,yBAAyB,CAAA;AAahC,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAe7B,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,SAAS,CACrD,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC,EACvC,sBAAsB,CAAC,CAAC,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAE1C;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAA;IACzC,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE/B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,aAAa,GACxB,CAAC,SAAS,SAAS,mFAlCE,MAAO,SAoJ5B,CAAA;AAEF,eAAO,MAAM,yBAAyB,kBAEnC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,4CAQA,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,YAAY,gEAKrD;IACD,IAAI,EAAE,YAAY,CAAA;IAClB,gBAAgB,EAAE,OAAO,CAAA;IACzB,eAAe,EAAE,SAAS,GAAG,IAAI,CAAA;IACjC,cAAc,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAA;CACzD,4CAuDA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengovsg/oui",
|
|
3
|
-
"version": "0.0.0-snapshot-
|
|
3
|
+
"version": "0.0.0-snapshot-20250923040433",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"storybook": "9.1.6",
|
|
50
50
|
"tsx": "^4.20.3",
|
|
51
51
|
"typescript": "5.7.3",
|
|
52
|
-
"@opengovsg/oui-theme": "0.0.0-snapshot-
|
|
52
|
+
"@opengovsg/oui-theme": "0.0.0-snapshot-20250923040433",
|
|
53
53
|
"@oui/chromatic": "0.0.0",
|
|
54
54
|
"@oui/eslint-config": "0.0.0",
|
|
55
55
|
"@oui/prettier-config": "0.0.0",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"motion": ">=11.12.0 || >=12.0.0-alpha.1",
|
|
84
84
|
"react": ">= 18",
|
|
85
85
|
"react-aria-components": "^1.12.2",
|
|
86
|
-
"@opengovsg/oui-theme": "0.0.0-snapshot-
|
|
86
|
+
"@opengovsg/oui-theme": "0.0.0-snapshot-20250923040433"
|
|
87
87
|
},
|
|
88
88
|
"scripts": {
|
|
89
89
|
"build": "tsx ../../tooling/build-scripts/main.ts --dts --clean",
|