@opengovsg/oui 0.0.17 → 0.0.18
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-month-day-selector.cjs +2 -2
- package/dist/cjs/calendar/calendar.cjs +3 -1
- package/dist/cjs/checkbox/checkbox.cjs +1 -1
- package/dist/cjs/combo-box/combo-box.cjs +2 -2
- 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 +4 -4
- package/dist/cjs/index.cjs +13 -13
- package/dist/cjs/menu/menu.cjs +1 -1
- 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 +3 -3
- 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/button/button.js +1 -1
- package/dist/esm/calendar/calendar-bottom-content.js +11 -5
- package/dist/esm/calendar/calendar-month-day-selector.js +2 -2
- package/dist/esm/calendar/calendar.js +3 -1
- package/dist/esm/checkbox/checkbox.js +1 -1
- package/dist/esm/combo-box/combo-box.js +2 -2
- 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 +4 -4
- package/dist/esm/index.js +5 -5
- package/dist/esm/menu/menu.js +1 -1
- 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 +3 -3
- 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 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');
|
|
11
10
|
var useRipple = require('../ripple/use-ripple.cjs');
|
|
12
11
|
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
|
)
|
|
@@ -6,11 +6,11 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
7
|
var date = require('@internationalized/date');
|
|
8
8
|
var reactAriaComponents = require('react-aria-components');
|
|
9
|
-
var select = require('../select/select.cjs');
|
|
10
|
-
var selectItem = require('../select/select-item.cjs');
|
|
11
9
|
var agnosticCalendarStateContext = require('./agnostic-calendar-state-context.cjs');
|
|
12
10
|
var calendarStyleContext = require('./calendar-style-context.cjs');
|
|
13
11
|
var useCalendarSelectors = require('./hooks/use-calendar-selectors.cjs');
|
|
12
|
+
var select = require('../select/select.cjs');
|
|
13
|
+
var selectItem = require('../select/select-item.cjs');
|
|
14
14
|
var useCalendarI18n = require('./hooks/use-calendar-i18n.cjs');
|
|
15
15
|
|
|
16
16
|
const CalendarMonthDaySelector = () => {
|
|
@@ -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,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 field = require('../field/field.cjs');
|
|
11
|
-
var popover = require('../popover/popover.cjs');
|
|
12
10
|
var utils = require('../system/utils.cjs');
|
|
13
11
|
var comboBoxVariantContext = require('./combo-box-variant-context.cjs');
|
|
12
|
+
var field = require('../field/field.cjs');
|
|
14
13
|
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
14
|
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
15
|
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,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 calendar$1 = require('../calendar/calendar.cjs');
|
|
10
|
-
require('@internationalized/date');
|
|
11
|
-
var dateField = require('../date-field/date-field.cjs');
|
|
12
|
-
var field = require('../field/field.cjs');
|
|
13
|
-
var popover = require('../popover/popover.cjs');
|
|
14
9
|
var utils = require('../system/utils.cjs');
|
|
10
|
+
var dateField = require('../date-field/date-field.cjs');
|
|
15
11
|
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 calendar$1 = require('../calendar/calendar.cjs');
|
|
13
|
+
var field = require('../field/field.cjs');
|
|
16
14
|
var button = require('../button/button.cjs');
|
|
15
|
+
var popover = require('../popover/popover.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 dateField = require('../date-field/date-field.cjs');
|
|
11
|
-
var field = require('../field/field.cjs');
|
|
12
|
-
var popover = require('../popover/popover.cjs');
|
|
13
|
-
var rangeCalendar = require('../range-calendar/range-calendar.cjs');
|
|
14
10
|
var utils = require('../system/utils.cjs');
|
|
15
11
|
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
|
+
var field = require('../field/field.cjs');
|
|
14
|
+
var dateField = require('../date-field/date-field.cjs');
|
|
16
15
|
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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var useControllableState = require('./hooks/use-controllable-state.cjs');
|
|
5
|
+
var button = require('./button/button.cjs');
|
|
5
6
|
var govtBanner = require('./govt-banner/govt-banner.cjs');
|
|
6
7
|
var ripple = require('./ripple/ripple.cjs');
|
|
7
8
|
var useRipple = require('./ripple/use-ripple.cjs');
|
|
@@ -18,15 +19,17 @@ var comboBox = require('./combo-box/combo-box.cjs');
|
|
|
18
19
|
var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
|
|
19
20
|
var comboBoxItem = require('./combo-box/combo-box-item.cjs');
|
|
20
21
|
var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
|
|
22
|
+
var banner = require('./banner/banner.cjs');
|
|
21
23
|
var tagField = require('./tag-field/tag-field.cjs');
|
|
22
24
|
var tagFieldItem = require('./tag-field/tag-field-item.cjs');
|
|
23
25
|
var select = require('./select/select.cjs');
|
|
24
26
|
var selectItem = require('./select/select-item.cjs');
|
|
25
27
|
var selectVariantContext = require('./select/select-variant-context.cjs');
|
|
28
|
+
var badge = require('./badge/badge.cjs');
|
|
29
|
+
var date = require('@internationalized/date');
|
|
26
30
|
var calendar = require('./calendar/calendar.cjs');
|
|
27
31
|
var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
|
|
28
32
|
var utils = require('./calendar/utils.cjs');
|
|
29
|
-
var date = require('@internationalized/date');
|
|
30
33
|
var rangeCalendar = require('./range-calendar/range-calendar.cjs');
|
|
31
34
|
var menu = require('./menu/menu.cjs');
|
|
32
35
|
var popover = require('./popover/popover.cjs');
|
|
@@ -36,18 +39,16 @@ var datePicker = require('./date-picker/date-picker.cjs');
|
|
|
36
39
|
var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
|
|
37
40
|
var checkbox = require('./checkbox/checkbox.cjs');
|
|
38
41
|
var checkboxGroupStyleContext = require('./checkbox/checkbox-group-style-context.cjs');
|
|
42
|
+
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
39
43
|
var pagination = require('./pagination/pagination.cjs');
|
|
40
44
|
var paginationCursor = require('./pagination/pagination-cursor.cjs');
|
|
41
45
|
var paginationItem = require('./pagination/pagination-item.cjs');
|
|
42
|
-
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
43
46
|
var usePagination$1 = require('./pagination/use-pagination.cjs');
|
|
44
|
-
var button = require('./button/button.cjs');
|
|
45
|
-
var banner = require('./banner/banner.cjs');
|
|
46
|
-
var badge = require('./badge/badge.cjs');
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
exports.useControllableState = useControllableState.useControllableState;
|
|
51
|
+
exports.Button = button.Button;
|
|
51
52
|
exports.GovtBanner = govtBanner.GovtBanner;
|
|
52
53
|
exports.Ripple = ripple.Ripple;
|
|
53
54
|
exports.useRipple = useRipple.useRipple;
|
|
@@ -69,12 +70,18 @@ exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
|
|
|
69
70
|
exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
|
|
70
71
|
exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
|
|
71
72
|
exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
|
|
73
|
+
exports.Banner = banner.Banner;
|
|
72
74
|
exports.TagField = tagField.TagField;
|
|
73
75
|
exports.TagFieldItem = tagFieldItem.TagFieldItem;
|
|
74
76
|
exports.Select = select.Select;
|
|
75
77
|
exports.SelectItem = selectItem.SelectItem;
|
|
76
78
|
exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
|
|
77
79
|
exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
|
|
80
|
+
exports.Badge = badge.Badge;
|
|
81
|
+
Object.defineProperty(exports, "CalendarDate", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function () { return date.CalendarDate; }
|
|
84
|
+
});
|
|
78
85
|
exports.Calendar = calendar.Calendar;
|
|
79
86
|
exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
|
|
80
87
|
exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
|
|
@@ -83,10 +90,6 @@ exports.getEraFormat = utils.getEraFormat;
|
|
|
83
90
|
exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
|
|
84
91
|
exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
|
|
85
92
|
exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
|
|
86
|
-
Object.defineProperty(exports, "CalendarDate", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
get: function () { return date.CalendarDate; }
|
|
89
|
-
});
|
|
90
93
|
exports.RangeCalendar = rangeCalendar.RangeCalendar;
|
|
91
94
|
exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
|
|
92
95
|
exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
|
|
@@ -113,12 +116,9 @@ exports.Checkbox = checkbox.Checkbox;
|
|
|
113
116
|
exports.CheckboxGroup = checkbox.CheckboxGroup;
|
|
114
117
|
exports.CheckboxGroupStyleContext = checkboxGroupStyleContext.CheckboxGroupStyleContext;
|
|
115
118
|
exports.useCheckboxGroupStyleContext = checkboxGroupStyleContext.useCheckboxGroupStyleContext;
|
|
119
|
+
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
116
120
|
exports.Pagination = pagination.Pagination;
|
|
117
121
|
exports.PaginationCursor = paginationCursor.PaginationCursor;
|
|
118
122
|
exports.PaginationItem = paginationItem.PaginationItem;
|
|
119
|
-
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
120
123
|
exports.CURSOR_TRANSITION_TIMEOUT = usePagination$1.CURSOR_TRANSITION_TIMEOUT;
|
|
121
124
|
exports.usePagination = usePagination$1.usePagination;
|
|
122
|
-
exports.Button = button.Button;
|
|
123
|
-
exports.Banner = banner.Banner;
|
|
124
|
-
exports.Badge = badge.Badge;
|
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');
|
|
10
9
|
var utils = require('../system/utils.cjs');
|
|
11
10
|
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
11
|
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');
|
|
13
12
|
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",
|
|
@@ -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,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 field = require('../field/field.cjs');
|
|
10
|
-
var popover = require('../popover/popover.cjs');
|
|
11
9
|
var utils = require('../system/utils.cjs');
|
|
12
10
|
var selectVariantContext = require('./select-variant-context.cjs');
|
|
11
|
+
var field = require('../field/field.cjs');
|
|
13
12
|
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,15 +6,15 @@ 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
|
-
var input = require('../input/input.cjs');
|
|
11
|
-
var popover = require('../popover/popover.cjs');
|
|
12
9
|
var tagFieldItem = require('./tag-field-item.cjs');
|
|
13
10
|
var tagFieldList = require('./tag-field-list.cjs');
|
|
14
11
|
var tagFieldRoot = require('./tag-field-root.cjs');
|
|
15
12
|
var tagFieldTagList = require('./tag-field-tag-list.cjs');
|
|
16
13
|
var tagFieldTrigger = require('./tag-field-trigger.cjs');
|
|
17
14
|
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
|
+
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,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 { 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';
|
|
9
8
|
import { useRipple } from '../ripple/use-ripple.js';
|
|
10
9
|
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
|
)
|
|
@@ -4,11 +4,11 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useContext } from 'react';
|
|
5
5
|
import { CalendarDate } from '@internationalized/date';
|
|
6
6
|
import { Group } from 'react-aria-components';
|
|
7
|
-
import { Select } from '../select/select.js';
|
|
8
|
-
import { SelectItem } from '../select/select-item.js';
|
|
9
7
|
import { AgnosticCalendarStateContext } from './agnostic-calendar-state-context.js';
|
|
10
8
|
import { useCalendarStyleContext } from './calendar-style-context.js';
|
|
11
9
|
import { useCalendarSelectors } from './hooks/use-calendar-selectors.js';
|
|
10
|
+
import { Select } from '../select/select.js';
|
|
11
|
+
import { SelectItem } from '../select/select-item.js';
|
|
12
12
|
import { useCalendarI18n } from './hooks/use-calendar-i18n.js';
|
|
13
13
|
|
|
14
14
|
const CalendarMonthDaySelector = () => {
|
|
@@ -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,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 { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
9
|
-
import { Popover } from '../popover/popover.js';
|
|
10
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
11
9
|
import { ComboBoxVariantContext } from './combo-box-variant-context.js';
|
|
10
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
11
|
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
12
|
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
13
|
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,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 { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
8
|
-
import '@internationalized/date';
|
|
9
|
-
import { DateInput } from '../date-field/date-field.js';
|
|
10
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
11
|
-
import { Popover } from '../popover/popover.js';
|
|
12
7
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
|
+
import { DateInput } from '../date-field/date-field.js';
|
|
13
9
|
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 { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
11
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
14
12
|
import { Button } from '../button/button.js';
|
|
13
|
+
import { Popover } from '../popover/popover.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 { DateInput } from '../date-field/date-field.js';
|
|
9
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
10
|
-
import { Popover } from '../popover/popover.js';
|
|
11
|
-
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
12
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
13
9
|
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
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
|
+
import { DateInput } from '../date-field/date-field.js';
|
|
14
13
|
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,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
export { useControllableState } from './hooks/use-controllable-state.js';
|
|
3
|
+
export { Button } from './button/button.js';
|
|
3
4
|
export { GovtBanner } from './govt-banner/govt-banner.js';
|
|
4
5
|
export { Ripple } from './ripple/ripple.js';
|
|
5
6
|
export { useRipple } from './ripple/use-ripple.js';
|
|
@@ -16,15 +17,17 @@ export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
|
16
17
|
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
17
18
|
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
18
19
|
export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
|
|
20
|
+
export { Banner } from './banner/banner.js';
|
|
19
21
|
export { TagField } from './tag-field/tag-field.js';
|
|
20
22
|
export { TagFieldItem } from './tag-field/tag-field-item.js';
|
|
21
23
|
export { Select } from './select/select.js';
|
|
22
24
|
export { SelectItem } from './select/select-item.js';
|
|
23
25
|
export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
|
|
26
|
+
export { Badge } from './badge/badge.js';
|
|
27
|
+
export { CalendarDate } from '@internationalized/date';
|
|
24
28
|
export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
25
29
|
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
26
30
|
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
27
|
-
export { CalendarDate } from '@internationalized/date';
|
|
28
31
|
export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
|
|
29
32
|
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
|
|
30
33
|
export { Popover } from './popover/popover.js';
|
|
@@ -34,11 +37,8 @@ export { DatePicker } from './date-picker/date-picker.js';
|
|
|
34
37
|
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
35
38
|
export { Checkbox, CheckboxGroup } from './checkbox/checkbox.js';
|
|
36
39
|
export { CheckboxGroupStyleContext, useCheckboxGroupStyleContext } from './checkbox/checkbox-group-style-context.js';
|
|
40
|
+
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
37
41
|
export { Pagination } from './pagination/pagination.js';
|
|
38
42
|
export { PaginationCursor } from './pagination/pagination-cursor.js';
|
|
39
43
|
export { PaginationItem } from './pagination/pagination-item.js';
|
|
40
|
-
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
41
44
|
export { CURSOR_TRANSITION_TIMEOUT, usePagination } from './pagination/use-pagination.js';
|
|
42
|
-
export { Button } from './button/button.js';
|
|
43
|
-
export { Banner } from './banner/banner.js';
|
|
44
|
-
export { Badge } from './badge/badge.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';
|
|
8
7
|
import { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
|
|
9
8
|
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
9
|
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';
|
|
11
10
|
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",
|
|
@@ -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,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 { Label, Description, FieldError } from '../field/field.js';
|
|
8
|
-
import { Popover } from '../popover/popover.js';
|
|
9
7
|
import { mapPropsVariants } from '../system/utils.js';
|
|
10
8
|
import { SelectVariantContext } from './select-variant-context.js';
|
|
9
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
11
10
|
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,15 +4,15 @@ 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
|
-
import { Input } from '../input/input.js';
|
|
9
|
-
import { Popover } from '../popover/popover.js';
|
|
10
7
|
import { TagFieldItem } from './tag-field-item.js';
|
|
11
8
|
import { TagFieldList } from './tag-field-list.js';
|
|
12
9
|
import { TagFieldRoot } from './tag-field-root.js';
|
|
13
10
|
import { TagFieldTagList } from './tag-field-tag-list.js';
|
|
14
11
|
import { TagFieldTrigger } from './tag-field-trigger.js';
|
|
15
12
|
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
|
+
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,
|
|
@@ -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.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"storybook": "9.1.6",
|
|
50
50
|
"tsx": "^4.20.3",
|
|
51
51
|
"typescript": "5.7.3",
|
|
52
|
-
"@opengovsg/oui-theme": "0.0.
|
|
53
|
-
"@oui/chromatic": "0.0.0",
|
|
54
|
-
"@oui/eslint-config": "0.0.0",
|
|
52
|
+
"@opengovsg/oui-theme": "0.0.18",
|
|
55
53
|
"@oui/prettier-config": "0.0.0",
|
|
54
|
+
"@oui/eslint-config": "0.0.0",
|
|
55
|
+
"@oui/chromatic": "0.0.0",
|
|
56
56
|
"@oui/typescript-config": "0.0.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
@@ -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.
|
|
86
|
+
"@opengovsg/oui-theme": "0.0.18"
|
|
87
87
|
},
|
|
88
88
|
"scripts": {
|
|
89
89
|
"build": "tsx ../../tooling/build-scripts/main.ts --dts --clean",
|