@opengovsg/oui 0.0.0-snapshot-20250916091050 → 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/banner/banner.cjs +1 -1
- package/dist/cjs/calendar/calendar-bottom-content.cjs +10 -4
- package/dist/cjs/calendar/calendar.cjs +3 -1
- package/dist/cjs/checkbox/checkbox.cjs +1 -1
- package/dist/cjs/combo-box/combo-box.cjs +1 -1
- package/dist/cjs/date-field/date-field.cjs +1 -1
- package/dist/cjs/date-picker/date-picker.cjs +4 -5
- package/dist/cjs/date-range-picker/date-range-picker.cjs +3 -3
- package/dist/cjs/index.cjs +52 -52
- package/dist/cjs/range-calendar/range-calendar.cjs +4 -2
- package/dist/cjs/select/select.cjs +2 -2
- package/dist/cjs/tag-field/tag-field.cjs +1 -1
- package/dist/cjs/text-area-field/text-area-field.cjs +1 -1
- package/dist/cjs/text-field/text-field.cjs +1 -1
- package/dist/esm/banner/banner.js +1 -1
- package/dist/esm/calendar/calendar-bottom-content.js +11 -5
- package/dist/esm/calendar/calendar.js +3 -1
- package/dist/esm/checkbox/checkbox.js +1 -1
- package/dist/esm/combo-box/combo-box.js +1 -1
- package/dist/esm/date-field/date-field.js +1 -1
- package/dist/esm/date-picker/date-picker.js +4 -5
- package/dist/esm/date-range-picker/date-range-picker.js +3 -3
- package/dist/esm/index.js +19 -19
- package/dist/esm/range-calendar/range-calendar.js +4 -2
- package/dist/esm/select/select.js +2 -2
- package/dist/esm/tag-field/tag-field.js +1 -1
- package/dist/esm/text-area-field/text-area-field.js +1 -1
- package/dist/esm/text-field/text-field.js +1 -1
- 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 +5 -5
|
@@ -7,9 +7,9 @@ var $670gB$react = require('react');
|
|
|
7
7
|
var reactAria = require('react-aria');
|
|
8
8
|
var reactStately = require('react-stately');
|
|
9
9
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
10
|
-
var button = require('../button/button.cjs');
|
|
11
10
|
var circleAlert = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs');
|
|
12
11
|
var info = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/info.cjs');
|
|
12
|
+
var button = require('../button/button.cjs');
|
|
13
13
|
var x = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.cjs');
|
|
14
14
|
|
|
15
15
|
const i18nStrings = {
|
|
@@ -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
|
] }) }),
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var reactAriaComponents = require('react-aria-components');
|
|
7
7
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
8
|
-
var field = require('../field/field.cjs');
|
|
9
8
|
var utils = require('../system/utils.cjs');
|
|
10
9
|
var checkboxGroupStyleContext = require('./checkbox-group-style-context.cjs');
|
|
11
10
|
var minus = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.cjs');
|
|
12
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');
|
|
12
|
+
var field = require('../field/field.cjs');
|
|
13
13
|
|
|
14
14
|
const Checkbox = ({
|
|
15
15
|
classNames,
|
|
@@ -7,10 +7,10 @@ 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 field = require('../field/field.cjs');
|
|
11
10
|
var popover = require('../popover/popover.cjs');
|
|
12
11
|
var utils = require('../system/utils.cjs');
|
|
13
12
|
var comboBoxVariantContext = require('./combo-box-variant-context.cjs');
|
|
13
|
+
var field = require('../field/field.cjs');
|
|
14
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');
|
|
15
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');
|
|
16
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');
|
|
@@ -6,8 +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 field = require('../field/field.cjs');
|
|
10
9
|
var utils = require('../system/utils.cjs');
|
|
10
|
+
var field = require('../field/field.cjs');
|
|
11
11
|
|
|
12
12
|
function DateField(originalProps) {
|
|
13
13
|
const [
|
|
@@ -6,14 +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 button = require('../button/button.cjs');
|
|
10
|
-
var calendar$1 = require('../calendar/calendar.cjs');
|
|
11
|
-
require('@internationalized/date');
|
|
12
|
-
var dateField = require('../date-field/date-field.cjs');
|
|
13
|
-
var field = require('../field/field.cjs');
|
|
14
9
|
var popover = require('../popover/popover.cjs');
|
|
15
10
|
var utils = require('../system/utils.cjs');
|
|
11
|
+
var dateField = require('../date-field/date-field.cjs');
|
|
16
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');
|
|
13
|
+
var calendar$1 = require('../calendar/calendar.cjs');
|
|
14
|
+
var field = require('../field/field.cjs');
|
|
15
|
+
var button = require('../button/button.cjs');
|
|
17
16
|
|
|
18
17
|
function DatePicker(originalProps) {
|
|
19
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 button = require('../button/button.cjs');
|
|
11
|
-
var dateField = require('../date-field/date-field.cjs');
|
|
12
|
-
var field = require('../field/field.cjs');
|
|
13
10
|
var popover = require('../popover/popover.cjs');
|
|
14
11
|
var rangeCalendar = require('../range-calendar/range-calendar.cjs');
|
|
15
12
|
var utils = require('../system/utils.cjs');
|
|
16
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');
|
|
14
|
+
var field = require('../field/field.cjs');
|
|
15
|
+
var dateField = require('../date-field/date-field.cjs');
|
|
16
|
+
var button = require('../button/button.cjs');
|
|
17
17
|
|
|
18
18
|
function DateRangePicker(originalProps) {
|
|
19
19
|
const [
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var useControllableState = require('./hooks/use-controllable-state.cjs');
|
|
5
|
-
var button = require('./button/button.cjs');
|
|
6
|
-
var govtBanner = require('./govt-banner/govt-banner.cjs');
|
|
7
4
|
var ripple = require('./ripple/ripple.cjs');
|
|
8
5
|
var useRipple = require('./ripple/use-ripple.cjs');
|
|
9
6
|
var spinner = require('./spinner/spinner.cjs');
|
|
@@ -12,44 +9,44 @@ var toggle = require('./toggle/toggle.cjs');
|
|
|
12
9
|
var skipNavLink = require('./skip-nav-link/skip-nav-link.cjs');
|
|
13
10
|
var input = require('./input/input.cjs');
|
|
14
11
|
var textField = require('./text-field/text-field.cjs');
|
|
15
|
-
var field = require('./field/field.cjs');
|
|
16
12
|
var textArea = require('./text-area/text-area.cjs');
|
|
17
13
|
var textAreaField = require('./text-area-field/text-area-field.cjs');
|
|
18
|
-
var comboBox = require('./combo-box/combo-box.cjs');
|
|
19
|
-
var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
|
|
20
|
-
var comboBoxItem = require('./combo-box/combo-box-item.cjs');
|
|
21
|
-
var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
|
|
22
|
-
var banner = require('./banner/banner.cjs');
|
|
23
14
|
var tagField = require('./tag-field/tag-field.cjs');
|
|
24
15
|
var tagFieldItem = require('./tag-field/tag-field-item.cjs');
|
|
25
16
|
var select = require('./select/select.cjs');
|
|
26
17
|
var selectItem = require('./select/select-item.cjs');
|
|
27
18
|
var selectVariantContext = require('./select/select-variant-context.cjs');
|
|
28
|
-
var badge = require('./badge/badge.cjs');
|
|
29
|
-
var calendar = require('./calendar/calendar.cjs');
|
|
30
|
-
var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
|
|
31
|
-
var utils = require('./calendar/utils.cjs');
|
|
32
|
-
var date = require('@internationalized/date');
|
|
33
19
|
var rangeCalendar = require('./range-calendar/range-calendar.cjs');
|
|
34
20
|
var menu = require('./menu/menu.cjs');
|
|
35
21
|
var popover = require('./popover/popover.cjs');
|
|
36
22
|
var tabs = require('./tabs/tabs.cjs');
|
|
37
|
-
var dateField = require('./date-field/date-field.cjs');
|
|
38
|
-
var datePicker = require('./date-picker/date-picker.cjs');
|
|
39
|
-
var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
|
|
40
|
-
var checkbox = require('./checkbox/checkbox.cjs');
|
|
41
|
-
var checkboxGroupStyleContext = require('./checkbox/checkbox-group-style-context.cjs');
|
|
42
23
|
var pagination = require('./pagination/pagination.cjs');
|
|
43
24
|
var paginationCursor = require('./pagination/pagination-cursor.cjs');
|
|
44
25
|
var paginationItem = require('./pagination/pagination-item.cjs');
|
|
45
26
|
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
46
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');
|
|
32
|
+
var comboBox = require('./combo-box/combo-box.cjs');
|
|
33
|
+
var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
|
|
34
|
+
var comboBoxItem = require('./combo-box/combo-box-item.cjs');
|
|
35
|
+
var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
|
|
36
|
+
var banner = require('./banner/banner.cjs');
|
|
37
|
+
var badge = require('./badge/badge.cjs');
|
|
38
|
+
var date = require('@internationalized/date');
|
|
39
|
+
var calendar = require('./calendar/calendar.cjs');
|
|
40
|
+
var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
|
|
41
|
+
var utils = require('./calendar/utils.cjs');
|
|
42
|
+
var dateField = require('./date-field/date-field.cjs');
|
|
43
|
+
var datePicker = require('./date-picker/date-picker.cjs');
|
|
44
|
+
var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
|
|
45
|
+
var checkbox = require('./checkbox/checkbox.cjs');
|
|
46
|
+
var checkboxGroupStyleContext = require('./checkbox/checkbox-group-style-context.cjs');
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
exports.useControllableState = useControllableState.useControllableState;
|
|
51
|
-
exports.Button = button.Button;
|
|
52
|
-
exports.GovtBanner = govtBanner.GovtBanner;
|
|
53
50
|
exports.Ripple = ripple.Ripple;
|
|
54
51
|
exports.useRipple = useRipple.useRipple;
|
|
55
52
|
exports.Spinner = spinner.Spinner;
|
|
@@ -58,38 +55,14 @@ exports.Toggle = toggle.Toggle;
|
|
|
58
55
|
exports.SkipNavLink = skipNavLink.SkipNavLink;
|
|
59
56
|
exports.Input = input.Input;
|
|
60
57
|
exports.TextField = textField.TextField;
|
|
61
|
-
exports.Description = field.Description;
|
|
62
|
-
exports.FieldError = field.FieldError;
|
|
63
|
-
exports.FieldGroup = field.FieldGroup;
|
|
64
|
-
exports.Label = field.Label;
|
|
65
58
|
exports.TextArea = textArea.TextArea;
|
|
66
59
|
exports.TextAreaField = textAreaField.TextAreaField;
|
|
67
|
-
exports.ComboBox = comboBox.ComboBox;
|
|
68
|
-
exports.ComboBoxEmptyState = comboBox.ComboBoxEmptyState;
|
|
69
|
-
exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
|
|
70
|
-
exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
|
|
71
|
-
exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
|
|
72
|
-
exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
|
|
73
|
-
exports.Banner = banner.Banner;
|
|
74
60
|
exports.TagField = tagField.TagField;
|
|
75
61
|
exports.TagFieldItem = tagFieldItem.TagFieldItem;
|
|
76
62
|
exports.Select = select.Select;
|
|
77
63
|
exports.SelectItem = selectItem.SelectItem;
|
|
78
64
|
exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
|
|
79
65
|
exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
|
|
80
|
-
exports.Badge = badge.Badge;
|
|
81
|
-
exports.Calendar = calendar.Calendar;
|
|
82
|
-
exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
|
|
83
|
-
exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
|
|
84
|
-
exports.useCalendarStyleContext = calendarStyleContext.useCalendarStyleContext;
|
|
85
|
-
exports.getEraFormat = utils.getEraFormat;
|
|
86
|
-
exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
|
|
87
|
-
exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
|
|
88
|
-
exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
|
|
89
|
-
Object.defineProperty(exports, "CalendarDate", {
|
|
90
|
-
enumerable: true,
|
|
91
|
-
get: function () { return date.CalendarDate; }
|
|
92
|
-
});
|
|
93
66
|
exports.RangeCalendar = rangeCalendar.RangeCalendar;
|
|
94
67
|
exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
|
|
95
68
|
exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
|
|
@@ -108,6 +81,39 @@ exports.TabPanel = tabs.TabPanel;
|
|
|
108
81
|
exports.Tabs = tabs.Tabs;
|
|
109
82
|
exports.TabsVariantContext = tabs.TabsVariantContext;
|
|
110
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;
|
|
90
|
+
exports.useControllableState = useControllableState.useControllableState;
|
|
91
|
+
exports.Button = button.Button;
|
|
92
|
+
exports.GovtBanner = govtBanner.GovtBanner;
|
|
93
|
+
exports.Description = field.Description;
|
|
94
|
+
exports.FieldError = field.FieldError;
|
|
95
|
+
exports.FieldGroup = field.FieldGroup;
|
|
96
|
+
exports.Label = field.Label;
|
|
97
|
+
exports.ComboBox = comboBox.ComboBox;
|
|
98
|
+
exports.ComboBoxEmptyState = comboBox.ComboBoxEmptyState;
|
|
99
|
+
exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
|
|
100
|
+
exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
|
|
101
|
+
exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
|
|
102
|
+
exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
|
|
103
|
+
exports.Banner = banner.Banner;
|
|
104
|
+
exports.Badge = badge.Badge;
|
|
105
|
+
Object.defineProperty(exports, "CalendarDate", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () { return date.CalendarDate; }
|
|
108
|
+
});
|
|
109
|
+
exports.Calendar = calendar.Calendar;
|
|
110
|
+
exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
|
|
111
|
+
exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
|
|
112
|
+
exports.useCalendarStyleContext = calendarStyleContext.useCalendarStyleContext;
|
|
113
|
+
exports.getEraFormat = utils.getEraFormat;
|
|
114
|
+
exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
|
|
115
|
+
exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
|
|
116
|
+
exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
|
|
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.Pagination = pagination.Pagination;
|
|
120
|
-
exports.PaginationCursor = paginationCursor.PaginationCursor;
|
|
121
|
-
exports.PaginationItem = paginationItem.PaginationItem;
|
|
122
|
-
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
123
|
-
exports.CURSOR_TRANSITION_TIMEOUT = usePagination$1.CURSOR_TRANSITION_TIMEOUT;
|
|
124
|
-
exports.usePagination = usePagination$1.usePagination;
|
|
@@ -8,12 +8,12 @@ var date = require('@internationalized/date');
|
|
|
8
8
|
var reactAriaComponents = require('react-aria-components');
|
|
9
9
|
var useDeepCompare = require('use-deep-compare');
|
|
10
10
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
11
|
-
var calendarStyleContext = require('../calendar/calendar-style-context.cjs');
|
|
12
11
|
var agnosticCalendarStateContext = require('../calendar/agnostic-calendar-state-context.cjs');
|
|
13
12
|
var calendarBottomContent = require('../calendar/calendar-bottom-content.cjs');
|
|
14
13
|
var calendarGridHeader = require('../calendar/calendar-grid-header.cjs');
|
|
15
14
|
var calendarHeader = require('../calendar/calendar-header.cjs');
|
|
16
15
|
var utils = require('../system/utils.cjs');
|
|
16
|
+
var calendarStyleContext = require('../calendar/calendar-style-context.cjs');
|
|
17
17
|
|
|
18
18
|
const RangeCalendar = utils.forwardRefGeneric(function RangeCalendar2(originalProps, ref) {
|
|
19
19
|
const [props, variantProps] = utils.mapPropsVariants(
|
|
@@ -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,12 +6,12 @@ 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 button = require('../button/button.cjs');
|
|
10
|
-
var field = require('../field/field.cjs');
|
|
11
9
|
var popover = require('../popover/popover.cjs');
|
|
12
10
|
var utils = require('../system/utils.cjs');
|
|
13
11
|
var selectVariantContext = require('./select-variant-context.cjs');
|
|
12
|
+
var field = require('../field/field.cjs');
|
|
14
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');
|
|
14
|
+
var button = require('../button/button.cjs');
|
|
15
15
|
|
|
16
16
|
const calculateEstimatedRowHeight = (size) => {
|
|
17
17
|
switch (size) {
|
|
@@ -6,7 +6,6 @@ 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 field = require('../field/field.cjs');
|
|
10
9
|
var input = require('../input/input.cjs');
|
|
11
10
|
var popover = require('../popover/popover.cjs');
|
|
12
11
|
var tagFieldItem = require('./tag-field-item.cjs');
|
|
@@ -15,6 +14,7 @@ var tagFieldRoot = require('./tag-field-root.cjs');
|
|
|
15
14
|
var tagFieldTagList = require('./tag-field-tag-list.cjs');
|
|
16
15
|
var tagFieldTrigger = require('./tag-field-trigger.cjs');
|
|
17
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');
|
|
17
|
+
var field = require('../field/field.cjs');
|
|
18
18
|
|
|
19
19
|
function TagField({
|
|
20
20
|
classNames,
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var reactAriaComponents = require('react-aria-components');
|
|
7
7
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
8
|
-
var field = require('../field/field.cjs');
|
|
9
8
|
var textArea = require('../text-area/text-area.cjs');
|
|
9
|
+
var field = require('../field/field.cjs');
|
|
10
10
|
|
|
11
11
|
function TextAreaField({
|
|
12
12
|
label,
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var reactAriaComponents = require('react-aria-components');
|
|
7
7
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
8
|
-
var field = require('../field/field.cjs');
|
|
9
8
|
var input = require('../input/input.cjs');
|
|
9
|
+
var field = require('../field/field.cjs');
|
|
10
10
|
|
|
11
11
|
function TextField({
|
|
12
12
|
label,
|
|
@@ -5,9 +5,9 @@ import { useMemo, useRef } from 'react';
|
|
|
5
5
|
import { useMessageFormatter, useDisclosure } from 'react-aria';
|
|
6
6
|
import { useDisclosureState } from 'react-stately';
|
|
7
7
|
import { bannerStyles } from '@opengovsg/oui-theme';
|
|
8
|
-
import { Button } from '../button/button.js';
|
|
9
8
|
import CircleAlert from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/circle-alert.js';
|
|
10
9
|
import Info from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/info.js';
|
|
10
|
+
import { Button } from '../button/button.js';
|
|
11
11
|
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
12
12
|
|
|
13
13
|
const i18nStrings = {
|
|
@@ -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
|
] }) }),
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { Checkbox as Checkbox$1, composeRenderProps, Provider, CheckboxGroup as CheckboxGroup$1 } from 'react-aria-components';
|
|
5
5
|
import { checkboxStyles, checkboxGroupStyles } from '@opengovsg/oui-theme';
|
|
6
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
7
6
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
7
|
import { useCheckboxGroupStyleContext, CheckboxGroupStyleContext } from './checkbox-group-style-context.js';
|
|
9
8
|
import Minus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.js';
|
|
10
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';
|
|
10
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
11
11
|
|
|
12
12
|
const Checkbox = ({
|
|
13
13
|
classNames,
|
|
@@ -5,10 +5,10 @@ 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 { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
9
8
|
import { Popover } from '../popover/popover.js';
|
|
10
9
|
import { mapPropsVariants } from '../system/utils.js';
|
|
11
10
|
import { ComboBoxVariantContext } from './combo-box-variant-context.js';
|
|
11
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
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';
|
|
13
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';
|
|
14
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';
|
|
@@ -4,8 +4,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { DateField as DateField$1, DateInput as DateInput$1, DateSegment } from 'react-aria-components';
|
|
6
6
|
import { dateFieldStyles, composeTailwindRenderProps, dateInputStyles, composeRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
7
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
9
9
|
|
|
10
10
|
function DateField(originalProps) {
|
|
11
11
|
const [
|
|
@@ -4,14 +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 { Button } from '../button/button.js';
|
|
8
|
-
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
9
|
-
import '@internationalized/date';
|
|
10
|
-
import { DateInput } from '../date-field/date-field.js';
|
|
11
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
7
|
import { Popover } from '../popover/popover.js';
|
|
13
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
9
|
+
import { DateInput } from '../date-field/date-field.js';
|
|
14
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';
|
|
11
|
+
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
12
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
13
|
+
import { Button } from '../button/button.js';
|
|
15
14
|
|
|
16
15
|
function DatePicker(originalProps) {
|
|
17
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 { Button } from '../button/button.js';
|
|
9
|
-
import { DateInput } from '../date-field/date-field.js';
|
|
10
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
11
8
|
import { Popover } from '../popover/popover.js';
|
|
12
9
|
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
13
10
|
import { mapPropsVariants } from '../system/utils.js';
|
|
14
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';
|
|
12
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
13
|
+
import { DateInput } from '../date-field/date-field.js';
|
|
14
|
+
import { Button } from '../button/button.js';
|
|
15
15
|
|
|
16
16
|
function DateRangePicker(originalProps) {
|
|
17
17
|
const [
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
export { useControllableState } from './hooks/use-controllable-state.js';
|
|
3
|
-
export { Button } from './button/button.js';
|
|
4
|
-
export { GovtBanner } from './govt-banner/govt-banner.js';
|
|
5
2
|
export { Ripple } from './ripple/ripple.js';
|
|
6
3
|
export { useRipple } from './ripple/use-ripple.js';
|
|
7
4
|
export { Spinner } from './spinner/spinner.js';
|
|
@@ -10,35 +7,38 @@ export { Toggle } from './toggle/toggle.js';
|
|
|
10
7
|
export { SkipNavLink } from './skip-nav-link/skip-nav-link.js';
|
|
11
8
|
export { Input } from './input/input.js';
|
|
12
9
|
export { TextField } from './text-field/text-field.js';
|
|
13
|
-
export { Description, FieldError, FieldGroup, Label } from './field/field.js';
|
|
14
10
|
export { TextArea } from './text-area/text-area.js';
|
|
15
11
|
export { TextAreaField } from './text-area-field/text-area-field.js';
|
|
16
|
-
export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
17
|
-
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
18
|
-
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
19
|
-
export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
|
|
20
|
-
export { Banner } from './banner/banner.js';
|
|
21
12
|
export { TagField } from './tag-field/tag-field.js';
|
|
22
13
|
export { TagFieldItem } from './tag-field/tag-field-item.js';
|
|
23
14
|
export { Select } from './select/select.js';
|
|
24
15
|
export { SelectItem } from './select/select-item.js';
|
|
25
16
|
export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
|
|
26
|
-
export { Badge } from './badge/badge.js';
|
|
27
|
-
export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
28
|
-
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
29
|
-
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
30
|
-
export { CalendarDate } from '@internationalized/date';
|
|
31
17
|
export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
|
|
32
18
|
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
|
|
33
19
|
export { Popover } from './popover/popover.js';
|
|
34
20
|
export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext } from './tabs/tabs.js';
|
|
35
|
-
export { DateField, DateInput } from './date-field/date-field.js';
|
|
36
|
-
export { DatePicker } from './date-picker/date-picker.js';
|
|
37
|
-
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
38
|
-
export { Checkbox, CheckboxGroup } from './checkbox/checkbox.js';
|
|
39
|
-
export { CheckboxGroupStyleContext, useCheckboxGroupStyleContext } from './checkbox/checkbox-group-style-context.js';
|
|
40
21
|
export { Pagination } from './pagination/pagination.js';
|
|
41
22
|
export { PaginationCursor } from './pagination/pagination-cursor.js';
|
|
42
23
|
export { PaginationItem } from './pagination/pagination-item.js';
|
|
43
24
|
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
44
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';
|
|
30
|
+
export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
31
|
+
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
32
|
+
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
33
|
+
export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
|
|
34
|
+
export { Banner } from './banner/banner.js';
|
|
35
|
+
export { Badge } from './badge/badge.js';
|
|
36
|
+
export { CalendarDate } from '@internationalized/date';
|
|
37
|
+
export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
38
|
+
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
39
|
+
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
40
|
+
export { DateField, DateInput } from './date-field/date-field.js';
|
|
41
|
+
export { DatePicker } from './date-picker/date-picker.js';
|
|
42
|
+
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
43
|
+
export { Checkbox, CheckboxGroup } from './checkbox/checkbox.js';
|
|
44
|
+
export { CheckboxGroupStyleContext, useCheckboxGroupStyleContext } from './checkbox/checkbox-group-style-context.js';
|
|
@@ -6,12 +6,12 @@ import { CalendarDate, today, getLocalTimeZone, getDayOfWeek } from '@internatio
|
|
|
6
6
|
import { RangeCalendar as RangeCalendar$1, Provider, CalendarGrid, CalendarGridBody, Text, RangeCalendarStateContext, useLocale, CalendarCell } from 'react-aria-components';
|
|
7
7
|
import { useDeepCompareMemo } from 'use-deep-compare';
|
|
8
8
|
import { calendarStyles, composeRenderProps, cn, dataAttr } from '@opengovsg/oui-theme';
|
|
9
|
-
import { CalendarStyleContext, useCalendarStyleContext } from '../calendar/calendar-style-context.js';
|
|
10
9
|
import { AgnosticCalendarStateContext } from '../calendar/agnostic-calendar-state-context.js';
|
|
11
10
|
import { CalendarBottomContent } from '../calendar/calendar-bottom-content.js';
|
|
12
11
|
import { CalendarGridHeader } from '../calendar/calendar-grid-header.js';
|
|
13
12
|
import { CalendarHeader } from '../calendar/calendar-header.js';
|
|
14
13
|
import { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
|
|
14
|
+
import { CalendarStyleContext, useCalendarStyleContext } from '../calendar/calendar-style-context.js';
|
|
15
15
|
|
|
16
16
|
const RangeCalendar = forwardRefGeneric(function RangeCalendar2(originalProps, ref) {
|
|
17
17
|
const [props, variantProps] = mapPropsVariants(
|
|
@@ -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,12 +4,12 @@ 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 { Button } from '../button/button.js';
|
|
8
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
9
7
|
import { Popover } from '../popover/popover.js';
|
|
10
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
11
9
|
import { SelectVariantContext } from './select-variant-context.js';
|
|
10
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
12
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';
|
|
12
|
+
import { Button } from '../button/button.js';
|
|
13
13
|
|
|
14
14
|
const calculateEstimatedRowHeight = (size) => {
|
|
15
15
|
switch (size) {
|
|
@@ -4,7 +4,6 @@ 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 { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
8
7
|
import { Input } from '../input/input.js';
|
|
9
8
|
import { Popover } from '../popover/popover.js';
|
|
10
9
|
import { TagFieldItem } from './tag-field-item.js';
|
|
@@ -13,6 +12,7 @@ import { TagFieldRoot } from './tag-field-root.js';
|
|
|
13
12
|
import { TagFieldTagList } from './tag-field-tag-list.js';
|
|
14
13
|
import { TagFieldTrigger } from './tag-field-trigger.js';
|
|
15
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';
|
|
15
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
16
16
|
|
|
17
17
|
function TagField({
|
|
18
18
|
classNames,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { TextField } from 'react-aria-components';
|
|
5
5
|
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
7
6
|
import { TextArea } from '../text-area/text-area.js';
|
|
7
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
8
|
|
|
9
9
|
function TextAreaField({
|
|
10
10
|
label,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { TextField as TextField$1 } from 'react-aria-components';
|
|
5
5
|
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
7
6
|
import { Input } from '../input/input.js';
|
|
7
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
8
|
|
|
9
9
|
function TextField({
|
|
10
10
|
label,
|
|
@@ -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,11 +49,11 @@
|
|
|
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
|
-
"@oui/
|
|
56
|
-
"@oui/
|
|
55
|
+
"@oui/prettier-config": "0.0.0",
|
|
56
|
+
"@oui/typescript-config": "0.0.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@internationalized/date": "^3.9.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",
|