@opengovsg/oui 0.0.31 → 0.0.32
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/button/button.cjs +1 -1
- package/dist/cjs/calendar/calendar-month-day-selector.cjs +2 -2
- 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 +5 -5
- package/dist/cjs/file-dropzone/file-dropzone.cjs +2 -2
- package/dist/cjs/file-dropzone/file-info.cjs +1 -1
- package/dist/cjs/index.cjs +18 -18
- package/dist/cjs/menu/menu.cjs +1 -1
- package/dist/cjs/modal/modal-content.cjs +1 -1
- package/dist/cjs/number-field/number-field.cjs +3 -3
- package/dist/cjs/range-calendar/range-calendar.cjs +1 -1
- package/dist/cjs/select/select.cjs +89 -17
- 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/cjs/toast/toast.cjs +1 -1
- package/dist/esm/banner/banner.js +1 -1
- package/dist/esm/button/button.js +1 -1
- package/dist/esm/calendar/calendar-month-day-selector.js +2 -2
- 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 +5 -5
- package/dist/esm/file-dropzone/file-dropzone.js +2 -2
- package/dist/esm/file-dropzone/file-info.js +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/menu/menu.js +1 -1
- package/dist/esm/modal/modal-content.js +1 -1
- package/dist/esm/number-field/number-field.js +3 -3
- package/dist/esm/range-calendar/range-calendar.js +1 -1
- package/dist/esm/select/select.js +92 -20
- 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/esm/toast/toast.js +1 -1
- package/dist/types/select/select.d.ts +14 -0
- package/dist/types/select/select.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.2.3/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.2.3/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.2.3/node_modules/lucide-react/dist/esm/icons/x.cjs');
|
|
14
14
|
|
|
15
15
|
const i18nStrings = {
|
|
@@ -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
|
({
|
|
@@ -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 = () => {
|
|
@@ -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.2.3/node_modules/lucide-react/dist/esm/icons/minus.cjs');
|
|
12
11
|
var check = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/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.2.3/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.2.3/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.2.3/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
|
|
10
|
-
var calendar$1 = require('../calendar/calendar.cjs');
|
|
11
|
-
require('@internationalized/date');
|
|
9
|
+
var utils = require('../system/utils.cjs');
|
|
12
10
|
var dateField = require('../date-field/date-field.cjs');
|
|
11
|
+
var calendar = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/calendar.cjs');
|
|
12
|
+
var calendar$1 = require('../calendar/calendar.cjs');
|
|
13
13
|
var field = require('../field/field.cjs');
|
|
14
|
+
var button = require('../button/button.cjs');
|
|
14
15
|
var popover = require('../popover/popover.cjs');
|
|
15
|
-
var utils = require('../system/utils.cjs');
|
|
16
|
-
var calendar = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/calendar.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
|
-
var popover = require('../popover/popover.cjs');
|
|
14
|
-
var rangeCalendar = require('../range-calendar/range-calendar.cjs');
|
|
15
10
|
var utils = require('../system/utils.cjs');
|
|
16
11
|
var calendar = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/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');
|
|
15
|
+
var button = require('../button/button.cjs');
|
|
16
|
+
var popover = require('../popover/popover.cjs');
|
|
17
17
|
|
|
18
18
|
function DateRangePicker(originalProps) {
|
|
19
19
|
const [
|
|
@@ -9,13 +9,13 @@ var reactAria = require('react-aria');
|
|
|
9
9
|
var reactAriaComponents = require('react-aria-components');
|
|
10
10
|
var reactDropzone = require('react-dropzone');
|
|
11
11
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
12
|
-
var field = require('../field/field.cjs');
|
|
13
|
-
var useControllableState = require('../hooks/use-controllable-state.cjs');
|
|
14
12
|
var utils = require('../system/utils.cjs');
|
|
15
13
|
var contexts = require('./contexts.cjs');
|
|
16
14
|
var fileInfo = require('./file-info.cjs');
|
|
17
15
|
var utils$1 = require('./utils.cjs');
|
|
16
|
+
var useControllableState = require('../hooks/use-controllable-state.cjs');
|
|
18
17
|
var upload = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/upload.cjs');
|
|
18
|
+
var field = require('../field/field.cjs');
|
|
19
19
|
|
|
20
20
|
const FileDropzone = (originalProps) => {
|
|
21
21
|
const [props, variantProps] = utils.mapPropsVariants(
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
7
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
8
|
-
var button = require('../button/button.cjs');
|
|
9
8
|
var contexts = require('./contexts.cjs');
|
|
10
9
|
var utils = require('./utils.cjs');
|
|
11
10
|
var trash2 = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/trash-2.cjs');
|
|
11
|
+
var button = require('../button/button.cjs');
|
|
12
12
|
|
|
13
13
|
const FileInfo = ({ file, imagePreview, classNames }) => {
|
|
14
14
|
const {
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var index = require('./avatar/index.cjs');
|
|
4
5
|
var useControllableState = require('./hooks/use-controllable-state.cjs');
|
|
5
6
|
var useDraggable = require('./hooks/use-draggable.cjs');
|
|
6
7
|
var button = require('./button/button.cjs');
|
|
@@ -20,15 +21,17 @@ var comboBox = require('./combo-box/combo-box.cjs');
|
|
|
20
21
|
var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
|
|
21
22
|
var comboBoxItem = require('./combo-box/combo-box-item.cjs');
|
|
22
23
|
var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
|
|
24
|
+
var banner = require('./banner/banner.cjs');
|
|
23
25
|
var tagField = require('./tag-field/tag-field.cjs');
|
|
24
26
|
var tagFieldItem = require('./tag-field/tag-field-item.cjs');
|
|
25
27
|
var select = require('./select/select.cjs');
|
|
26
28
|
var selectItem = require('./select/select-item.cjs');
|
|
27
29
|
var selectVariantContext = require('./select/select-variant-context.cjs');
|
|
30
|
+
var badge = require('./badge/badge.cjs');
|
|
31
|
+
var date = require('@internationalized/date');
|
|
28
32
|
var calendar = require('./calendar/calendar.cjs');
|
|
29
33
|
var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
|
|
30
34
|
var utils = require('./calendar/utils.cjs');
|
|
31
|
-
var date = require('@internationalized/date');
|
|
32
35
|
var rangeCalendar = require('./range-calendar/range-calendar.cjs');
|
|
33
36
|
var menu = require('./menu/menu.cjs');
|
|
34
37
|
var popover = require('./popover/popover.cjs');
|
|
@@ -38,10 +41,10 @@ var datePicker = require('./date-picker/date-picker.cjs');
|
|
|
38
41
|
var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
|
|
39
42
|
var checkbox = require('./checkbox/checkbox.cjs');
|
|
40
43
|
var checkboxGroupStyleContext = require('./checkbox/checkbox-group-style-context.cjs');
|
|
44
|
+
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
41
45
|
var pagination = require('./pagination/pagination.cjs');
|
|
42
46
|
var paginationCursor = require('./pagination/pagination-cursor.cjs');
|
|
43
47
|
var paginationItem = require('./pagination/pagination-item.cjs');
|
|
44
|
-
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
45
48
|
var usePagination$1 = require('./pagination/use-pagination.cjs');
|
|
46
49
|
var fileDropzone = require('./file-dropzone/file-dropzone.cjs');
|
|
47
50
|
var fileInfo = require('./file-dropzone/file-info.cjs');
|
|
@@ -54,6 +57,7 @@ var modalBody = require('./modal/modal-body.cjs');
|
|
|
54
57
|
var modalHeader = require('./modal/modal-header.cjs');
|
|
55
58
|
var modalVariantContext = require('./modal/modal-variant-context.cjs');
|
|
56
59
|
var toast = require('./toast/toast.cjs');
|
|
60
|
+
var sonner = require('sonner');
|
|
57
61
|
var navbar = require('./navbar/navbar.cjs');
|
|
58
62
|
var navbarBrand = require('./navbar/navbar-brand.cjs');
|
|
59
63
|
var navbarContent = require('./navbar/navbar-content.cjs');
|
|
@@ -63,10 +67,6 @@ var toggle$1 = require('./navbar/navbar-menu/toggle.cjs');
|
|
|
63
67
|
var navbarItem = require('./navbar/navbar-item.cjs');
|
|
64
68
|
var useNavbar = require('./navbar/use-navbar.cjs');
|
|
65
69
|
var navbarContext = require('./navbar/navbar-context.cjs');
|
|
66
|
-
var index = require('./avatar/index.cjs');
|
|
67
|
-
var banner = require('./banner/banner.cjs');
|
|
68
|
-
var badge = require('./badge/badge.cjs');
|
|
69
|
-
var sonner = require('sonner');
|
|
70
70
|
var avatarContext = require('./avatar/avatar-context.cjs');
|
|
71
71
|
var avatarGroup = require('./avatar/avatar-group.cjs');
|
|
72
72
|
var avatarGroupContext = require('./avatar/avatar-group-context.cjs');
|
|
@@ -74,6 +74,7 @@ var avatar = require('./avatar/avatar.cjs');
|
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
|
|
77
|
+
exports.Avatar = index.Avatar;
|
|
77
78
|
exports.useControllableState = useControllableState.useControllableState;
|
|
78
79
|
exports.useDraggable = useDraggable.useDraggable;
|
|
79
80
|
exports.Button = button.Button;
|
|
@@ -99,12 +100,18 @@ exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
|
|
|
99
100
|
exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
|
|
100
101
|
exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
|
|
101
102
|
exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
|
|
103
|
+
exports.Banner = banner.Banner;
|
|
102
104
|
exports.TagField = tagField.TagField;
|
|
103
105
|
exports.TagFieldItem = tagFieldItem.TagFieldItem;
|
|
104
106
|
exports.Select = select.Select;
|
|
105
107
|
exports.SelectItem = selectItem.SelectItem;
|
|
106
108
|
exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
|
|
107
109
|
exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
|
|
110
|
+
exports.Badge = badge.Badge;
|
|
111
|
+
Object.defineProperty(exports, "CalendarDate", {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: function () { return date.CalendarDate; }
|
|
114
|
+
});
|
|
108
115
|
exports.Calendar = calendar.Calendar;
|
|
109
116
|
exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
|
|
110
117
|
exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
|
|
@@ -113,10 +120,6 @@ exports.getEraFormat = utils.getEraFormat;
|
|
|
113
120
|
exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
|
|
114
121
|
exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
|
|
115
122
|
exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
|
|
116
|
-
Object.defineProperty(exports, "CalendarDate", {
|
|
117
|
-
enumerable: true,
|
|
118
|
-
get: function () { return date.CalendarDate; }
|
|
119
|
-
});
|
|
120
123
|
exports.RangeCalendar = rangeCalendar.RangeCalendar;
|
|
121
124
|
exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
|
|
122
125
|
exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
|
|
@@ -143,10 +146,10 @@ exports.Checkbox = checkbox.Checkbox;
|
|
|
143
146
|
exports.CheckboxGroup = checkbox.CheckboxGroup;
|
|
144
147
|
exports.CheckboxGroupStyleContext = checkboxGroupStyleContext.CheckboxGroupStyleContext;
|
|
145
148
|
exports.useCheckboxGroupStyleContext = checkboxGroupStyleContext.useCheckboxGroupStyleContext;
|
|
149
|
+
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
146
150
|
exports.Pagination = pagination.Pagination;
|
|
147
151
|
exports.PaginationCursor = paginationCursor.PaginationCursor;
|
|
148
152
|
exports.PaginationItem = paginationItem.PaginationItem;
|
|
149
|
-
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
150
153
|
exports.CURSOR_TRANSITION_TIMEOUT = usePagination$1.CURSOR_TRANSITION_TIMEOUT;
|
|
151
154
|
exports.usePagination = usePagination$1.usePagination;
|
|
152
155
|
exports.FileDropzone = fileDropzone.FileDropzone;
|
|
@@ -162,6 +165,10 @@ exports.ModalHeader = modalHeader.ModalHeader;
|
|
|
162
165
|
exports.ModalVariantContext = modalVariantContext.ModalVariantContext;
|
|
163
166
|
exports.useModalVariantContext = modalVariantContext.useModalVariantContext;
|
|
164
167
|
exports.Toaster = toast.Toaster;
|
|
168
|
+
Object.defineProperty(exports, "toast", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () { return sonner.toast; }
|
|
171
|
+
});
|
|
165
172
|
exports.Navbar = navbar.Navbar;
|
|
166
173
|
exports.NavbarBrand = navbarBrand.NavbarBrand;
|
|
167
174
|
exports.NavbarContent = navbarContent.NavbarContent;
|
|
@@ -172,13 +179,6 @@ exports.NavbarItem = navbarItem.NavbarItem;
|
|
|
172
179
|
exports.useNavbar = useNavbar.useNavbar;
|
|
173
180
|
exports.NavbarProvider = navbarContext.NavbarProvider;
|
|
174
181
|
exports.useNavbarContext = navbarContext.useNavbarContext;
|
|
175
|
-
exports.Avatar = index.Avatar;
|
|
176
|
-
exports.Banner = banner.Banner;
|
|
177
|
-
exports.Badge = badge.Badge;
|
|
178
|
-
Object.defineProperty(exports, "toast", {
|
|
179
|
-
enumerable: true,
|
|
180
|
-
get: function () { return sonner.toast; }
|
|
181
|
-
});
|
|
182
182
|
exports.AvatarContext = avatarContext.AvatarContext;
|
|
183
183
|
exports.useAvatarContext = avatarContext.useAvatarContext;
|
|
184
184
|
exports.AvatarGroup = avatarGroup.AvatarGroup;
|
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 context = require('../system/react-utils/context.cjs');
|
|
12
11
|
var check = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/check.cjs');
|
|
13
12
|
var chevronRight = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs');
|
|
13
|
+
var popover = require('../popover/popover.cjs');
|
|
14
14
|
|
|
15
15
|
const [MenuVariantContext, useMenuVariantContext] = context.createContext({
|
|
16
16
|
name: "MenuVariantContext",
|
|
@@ -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 button = require('../button/button.cjs');
|
|
11
10
|
var i18n = require('./i18n.cjs');
|
|
12
11
|
var modalVariantContext = require('./modal-variant-context.cjs');
|
|
13
12
|
var x = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.cjs');
|
|
13
|
+
var button = require('../button/button.cjs');
|
|
14
14
|
|
|
15
15
|
function ModalContent({
|
|
16
16
|
closeButtonContent: closeButtonContentProp,
|
|
@@ -5,12 +5,12 @@
|
|
|
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 button = require('../button/button.cjs');
|
|
9
|
-
var field = require('../field/field.cjs');
|
|
10
|
-
var input = require('../input/input.cjs');
|
|
11
8
|
var utils = require('../system/utils.cjs');
|
|
12
9
|
var minus = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/minus.cjs');
|
|
13
10
|
var plus = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/plus.cjs');
|
|
11
|
+
var field = require('../field/field.cjs');
|
|
12
|
+
var input = require('../input/input.cjs');
|
|
13
|
+
var button = require('../button/button.cjs');
|
|
14
14
|
|
|
15
15
|
function NumberField(originalProps) {
|
|
16
16
|
const [
|
|
@@ -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(
|
|
@@ -4,15 +4,34 @@
|
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
|
+
var reactAria = require('react-aria');
|
|
7
8
|
var reactAriaComponents = require('react-aria-components');
|
|
8
9
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
9
|
-
var button = require('../button/button.cjs');
|
|
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 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.2.3/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs');
|
|
14
|
+
var popover = require('../popover/popover.cjs');
|
|
15
|
+
var button = require('../button/button.cjs');
|
|
15
16
|
|
|
17
|
+
const i18nStrings = {
|
|
18
|
+
"en-SG": {
|
|
19
|
+
searchPlaceholder: "Search...",
|
|
20
|
+
searchAriaLabel: "Search options"
|
|
21
|
+
},
|
|
22
|
+
"zh-SG": {
|
|
23
|
+
searchPlaceholder: "\u641C\u7D22...",
|
|
24
|
+
searchAriaLabel: "\u641C\u7D22\u9009\u9879"
|
|
25
|
+
},
|
|
26
|
+
"ms-SG": {
|
|
27
|
+
searchPlaceholder: "Cari...",
|
|
28
|
+
searchAriaLabel: "Cari pilihan"
|
|
29
|
+
},
|
|
30
|
+
"ta-SG": {
|
|
31
|
+
searchPlaceholder: "\u0BA4\u0BC7\u0B9F\u0BC1...",
|
|
32
|
+
searchAriaLabel: "\u0BA4\u0BC7\u0B9F\u0BB2\u0BCD \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0B99\u0BCD\u0B95\u0BB3\u0BCD"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
16
35
|
const calculateEstimatedRowHeight = (size) => {
|
|
17
36
|
switch (size) {
|
|
18
37
|
case "xs":
|
|
@@ -30,12 +49,22 @@ function Select({
|
|
|
30
49
|
errorMessage,
|
|
31
50
|
...originalProps
|
|
32
51
|
}) {
|
|
52
|
+
const formatter = reactAria.useLocalizedStringFormatter(i18nStrings);
|
|
33
53
|
const [_props, variantProps] = utils.mapPropsVariants(
|
|
34
54
|
originalProps,
|
|
35
55
|
ouiTheme.selectStyles.variantKeys
|
|
36
56
|
);
|
|
37
|
-
const {
|
|
57
|
+
const {
|
|
58
|
+
items,
|
|
59
|
+
children,
|
|
60
|
+
listLayoutOptions,
|
|
61
|
+
enableSearch = false,
|
|
62
|
+
searchPlaceholder,
|
|
63
|
+
searchIcon,
|
|
64
|
+
...props
|
|
65
|
+
} = _props;
|
|
38
66
|
const styles = ouiTheme.selectStyles(variantProps);
|
|
67
|
+
const { contains } = reactAriaComponents.useFilter({ sensitivity: "base" });
|
|
39
68
|
const layoutOptions = $670gB$react.useMemo(() => {
|
|
40
69
|
return {
|
|
41
70
|
estimatedRowHeight: calculateEstimatedRowHeight(
|
|
@@ -44,6 +73,37 @@ function Select({
|
|
|
44
73
|
...listLayoutOptions
|
|
45
74
|
};
|
|
46
75
|
}, [listLayoutOptions, variantProps.size]);
|
|
76
|
+
const renderedSearchIcon = $670gB$react.useMemo(() => {
|
|
77
|
+
if (!enableSearch || !searchIcon) return null;
|
|
78
|
+
if ($670gB$react.isValidElement(searchIcon)) {
|
|
79
|
+
const iconElement = searchIcon;
|
|
80
|
+
return $670gB$react.cloneElement(iconElement, {
|
|
81
|
+
className: styles.searchIcon({
|
|
82
|
+
className: ouiTheme.cn(classNames?.searchIcon, iconElement.props.className)
|
|
83
|
+
})
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
+
"span",
|
|
88
|
+
{
|
|
89
|
+
className: styles.searchIcon({ className: classNames?.searchIcon }),
|
|
90
|
+
children: searchIcon
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
}, [classNames?.searchIcon, enableSearch, searchIcon, styles]);
|
|
94
|
+
const listContent = /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Virtualizer, { layout: reactAriaComponents.ListLayout, layoutOptions, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
95
|
+
reactAriaComponents.ListBox,
|
|
96
|
+
{
|
|
97
|
+
autoFocus: !enableSearch,
|
|
98
|
+
items,
|
|
99
|
+
shouldFocusWrap: true,
|
|
100
|
+
className: ouiTheme.composeRenderProps(
|
|
101
|
+
classNames?.list,
|
|
102
|
+
(className, renderProps) => styles.list({ className, ...renderProps })
|
|
103
|
+
),
|
|
104
|
+
children
|
|
105
|
+
}
|
|
106
|
+
) });
|
|
47
107
|
return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Provider, { values: [[selectVariantContext.SelectVariantContext, variantProps]], children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
48
108
|
reactAriaComponents.Select,
|
|
49
109
|
{
|
|
@@ -93,19 +153,31 @@ function Select({
|
|
|
93
153
|
}
|
|
94
154
|
),
|
|
95
155
|
/* @__PURE__ */ jsxRuntime.jsx(field.FieldError, { size: variantProps.size, className: classNames?.error, children: errorMessage }),
|
|
96
|
-
/* @__PURE__ */ jsxRuntime.jsx(popover.Popover, { className: styles.popover({ className: classNames?.popover }), children: /* @__PURE__ */ jsxRuntime.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx(popover.Popover, { className: styles.popover({ className: classNames?.popover }), children: enableSearch ? /* @__PURE__ */ jsxRuntime.jsxs(reactAriaComponents.Autocomplete, { filter: contains, children: [
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
158
|
+
reactAriaComponents.SearchField,
|
|
159
|
+
{
|
|
160
|
+
autoFocus: true,
|
|
161
|
+
"aria-label": formatter.format("searchAriaLabel"),
|
|
162
|
+
className: styles.searchField({
|
|
163
|
+
className: classNames?.searchField
|
|
164
|
+
}),
|
|
165
|
+
children: [
|
|
166
|
+
renderedSearchIcon,
|
|
167
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
168
|
+
reactAriaComponents.Input,
|
|
169
|
+
{
|
|
170
|
+
placeholder: searchPlaceholder ?? formatter.format("searchPlaceholder"),
|
|
171
|
+
className: styles.searchInput({
|
|
172
|
+
className: classNames?.searchInput
|
|
173
|
+
})
|
|
174
|
+
}
|
|
175
|
+
)
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
listContent
|
|
180
|
+
] }) : listContent })
|
|
109
181
|
]
|
|
110
182
|
}
|
|
111
183
|
) });
|
|
@@ -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.2.3/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,
|
package/dist/cjs/toast/toast.cjs
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var sonner = require('sonner');
|
|
7
7
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
8
|
-
var spinner = require('../spinner/spinner.cjs');
|
|
9
8
|
var utils = require('../system/utils.cjs');
|
|
10
9
|
var x = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.cjs');
|
|
10
|
+
var spinner = require('../spinner/spinner.cjs');
|
|
11
11
|
|
|
12
12
|
function Toaster(originalProps) {
|
|
13
13
|
const [{ toastOptions, closeButton = true, ...props }, variantProps] = utils.mapPropsVariants(originalProps, ouiTheme.toastStyles.variantKeys);
|
|
@@ -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.2.3/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.2.3/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.2.3/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
12
12
|
|
|
13
13
|
const i18nStrings = {
|
|
@@ -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
|
({
|
|
@@ -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 = () => {
|
|
@@ -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.2.3/node_modules/lucide-react/dist/esm/icons/minus.js';
|
|
10
9
|
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/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.2.3/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.2.3/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.2.3/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 {
|
|
8
|
-
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
9
|
-
import '@internationalized/date';
|
|
7
|
+
import { mapPropsVariants } from '../system/utils.js';
|
|
10
8
|
import { DateInput } from '../date-field/date-field.js';
|
|
9
|
+
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
10
|
+
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
11
11
|
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
|
+
import { Button } from '../button/button.js';
|
|
12
13
|
import { Popover } from '../popover/popover.js';
|
|
13
|
-
import { mapPropsVariants } from '../system/utils.js';
|
|
14
|
-
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/calendar.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
|
-
import { Popover } from '../popover/popover.js';
|
|
12
|
-
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
13
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
14
9
|
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/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';
|
|
13
|
+
import { Button } from '../button/button.js';
|
|
14
|
+
import { Popover } from '../popover/popover.js';
|
|
15
15
|
|
|
16
16
|
function DateRangePicker(originalProps) {
|
|
17
17
|
const [
|
|
@@ -7,13 +7,13 @@ import { useField, useId } from 'react-aria';
|
|
|
7
7
|
import { Provider, LabelContext, GroupContext, TextContext, FieldErrorContext, Group } from 'react-aria-components';
|
|
8
8
|
import { useDropzone } from 'react-dropzone';
|
|
9
9
|
import { fileDropzoneStyles, dataAttr } from '@opengovsg/oui-theme';
|
|
10
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
11
|
-
import { useControllableState } from '../hooks/use-controllable-state.js';
|
|
12
10
|
import { mapPropsVariants } from '../system/utils.js';
|
|
13
11
|
import { FileDropzoneStyleContext, FileDropzoneStateContext, useFileDropzoneStateContext, useFileDropzoneStyleContext } from './contexts.js';
|
|
14
12
|
import { FileInfo } from './file-info.js';
|
|
15
13
|
import { formatErrorMessage, formatBytes } from './utils.js';
|
|
14
|
+
import { useControllableState } from '../hooks/use-controllable-state.js';
|
|
16
15
|
import Upload from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/upload.js';
|
|
16
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
17
17
|
|
|
18
18
|
const FileDropzone = (originalProps) => {
|
|
19
19
|
const [props, variantProps] = mapPropsVariants(
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, useEffect } from 'react';
|
|
5
5
|
import { fileInfoDropzoneStyles, cn } from '@opengovsg/oui-theme';
|
|
6
|
-
import { Button } from '../button/button.js';
|
|
7
6
|
import { useFileDropzoneStateContext, useFileDropzoneStyleContext } from './contexts.js';
|
|
8
7
|
import { formatBytes } from './utils.js';
|
|
9
8
|
import Trash2 from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/trash-2.js';
|
|
9
|
+
import { Button } from '../button/button.js';
|
|
10
10
|
|
|
11
11
|
const FileInfo = ({ file, imagePreview, classNames }) => {
|
|
12
12
|
const {
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
export { Avatar } from './avatar/index.js';
|
|
2
3
|
export { useControllableState } from './hooks/use-controllable-state.js';
|
|
3
4
|
export { useDraggable } from './hooks/use-draggable.js';
|
|
4
5
|
export { Button } from './button/button.js';
|
|
@@ -18,15 +19,17 @@ export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
|
18
19
|
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
19
20
|
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
20
21
|
export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
|
|
22
|
+
export { Banner } from './banner/banner.js';
|
|
21
23
|
export { TagField } from './tag-field/tag-field.js';
|
|
22
24
|
export { TagFieldItem } from './tag-field/tag-field-item.js';
|
|
23
25
|
export { Select } from './select/select.js';
|
|
24
26
|
export { SelectItem } from './select/select-item.js';
|
|
25
27
|
export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
|
|
28
|
+
export { Badge } from './badge/badge.js';
|
|
29
|
+
export { CalendarDate } from '@internationalized/date';
|
|
26
30
|
export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
27
31
|
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
28
32
|
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
29
|
-
export { CalendarDate } from '@internationalized/date';
|
|
30
33
|
export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
|
|
31
34
|
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
|
|
32
35
|
export { Popover } from './popover/popover.js';
|
|
@@ -36,10 +39,10 @@ export { DatePicker } from './date-picker/date-picker.js';
|
|
|
36
39
|
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
37
40
|
export { Checkbox, CheckboxGroup } from './checkbox/checkbox.js';
|
|
38
41
|
export { CheckboxGroupStyleContext, useCheckboxGroupStyleContext } from './checkbox/checkbox-group-style-context.js';
|
|
42
|
+
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
39
43
|
export { Pagination } from './pagination/pagination.js';
|
|
40
44
|
export { PaginationCursor } from './pagination/pagination-cursor.js';
|
|
41
45
|
export { PaginationItem } from './pagination/pagination-item.js';
|
|
42
|
-
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
43
46
|
export { CURSOR_TRANSITION_TIMEOUT, usePagination } from './pagination/use-pagination.js';
|
|
44
47
|
export { FileDropzone } from './file-dropzone/file-dropzone.js';
|
|
45
48
|
export { FileInfo } from './file-dropzone/file-info.js';
|
|
@@ -52,6 +55,7 @@ export { ModalBody } from './modal/modal-body.js';
|
|
|
52
55
|
export { ModalHeader } from './modal/modal-header.js';
|
|
53
56
|
export { ModalVariantContext, useModalVariantContext } from './modal/modal-variant-context.js';
|
|
54
57
|
export { Toaster } from './toast/toast.js';
|
|
58
|
+
export { toast } from 'sonner';
|
|
55
59
|
export { Navbar } from './navbar/navbar.js';
|
|
56
60
|
export { NavbarBrand } from './navbar/navbar-brand.js';
|
|
57
61
|
export { NavbarContent } from './navbar/navbar-content.js';
|
|
@@ -61,10 +65,6 @@ export { NavbarMenuToggle } from './navbar/navbar-menu/toggle.js';
|
|
|
61
65
|
export { NavbarItem } from './navbar/navbar-item.js';
|
|
62
66
|
export { useNavbar } from './navbar/use-navbar.js';
|
|
63
67
|
export { NavbarProvider, useNavbarContext } from './navbar/navbar-context.js';
|
|
64
|
-
export { Avatar } from './avatar/index.js';
|
|
65
|
-
export { Banner } from './banner/banner.js';
|
|
66
|
-
export { Badge } from './badge/badge.js';
|
|
67
|
-
export { toast } from 'sonner';
|
|
68
68
|
export { AvatarContext, useAvatarContext } from './avatar/avatar-context.js';
|
|
69
69
|
export { AvatarGroup } from './avatar/avatar-group.js';
|
|
70
70
|
export { AvatarGroupProvider, useAvatarGroup } from './avatar/avatar-group-context.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 { createContext } from '../system/react-utils/context.js';
|
|
10
9
|
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/check.js';
|
|
11
10
|
import ChevronRight from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/chevron-right.js';
|
|
11
|
+
import { Popover } from '../popover/popover.js';
|
|
12
12
|
|
|
13
13
|
const [MenuVariantContext, useMenuVariantContext] = createContext({
|
|
14
14
|
name: "MenuVariantContext",
|
|
@@ -5,10 +5,10 @@ import { useContext, isValidElement } from 'react';
|
|
|
5
5
|
import { useMessageFormatter } from 'react-aria';
|
|
6
6
|
import { Dialog } from 'react-aria-components';
|
|
7
7
|
import { cn } from '@opengovsg/oui-theme';
|
|
8
|
-
import { Button } from '../button/button.js';
|
|
9
8
|
import { i18nStrings } from './i18n.js';
|
|
10
9
|
import { ModalVariantContext } from './modal-variant-context.js';
|
|
11
10
|
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
11
|
+
import { Button } from '../button/button.js';
|
|
12
12
|
|
|
13
13
|
function ModalContent({
|
|
14
14
|
closeButtonContent: closeButtonContentProp,
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { NumberField as NumberField$1 } from 'react-aria-components';
|
|
5
5
|
import { numberFieldStyles, composeTailwindRenderProps, dataAttr, fieldBorderStyles, cn } from '@opengovsg/oui-theme';
|
|
6
|
-
import { Button } from '../button/button.js';
|
|
7
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
8
|
-
import { Input } from '../input/input.js';
|
|
9
6
|
import { mapPropsVariants } from '../system/utils.js';
|
|
10
7
|
import Minus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/minus.js';
|
|
11
8
|
import Plus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/plus.js';
|
|
9
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
10
|
+
import { Input } from '../input/input.js';
|
|
11
|
+
import { Button } from '../button/button.js';
|
|
12
12
|
|
|
13
13
|
function NumberField(originalProps) {
|
|
14
14
|
const [
|
|
@@ -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(
|
|
@@ -1,16 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
9
|
-
import { Popover } from '../popover/popover.js';
|
|
4
|
+
import { useMemo, isValidElement, cloneElement } from 'react';
|
|
5
|
+
import { useLocalizedStringFormatter } from 'react-aria';
|
|
6
|
+
import { useFilter, Virtualizer, ListLayout, ListBox, Provider, Select as Select$1, SelectValue, Autocomplete, SearchField, Input } from 'react-aria-components';
|
|
7
|
+
import { selectStyles, cn, composeRenderProps } from '@opengovsg/oui-theme';
|
|
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.2.3/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
12
|
+
import { Popover } from '../popover/popover.js';
|
|
13
|
+
import { Button } from '../button/button.js';
|
|
13
14
|
|
|
15
|
+
const i18nStrings = {
|
|
16
|
+
"en-SG": {
|
|
17
|
+
searchPlaceholder: "Search...",
|
|
18
|
+
searchAriaLabel: "Search options"
|
|
19
|
+
},
|
|
20
|
+
"zh-SG": {
|
|
21
|
+
searchPlaceholder: "\u641C\u7D22...",
|
|
22
|
+
searchAriaLabel: "\u641C\u7D22\u9009\u9879"
|
|
23
|
+
},
|
|
24
|
+
"ms-SG": {
|
|
25
|
+
searchPlaceholder: "Cari...",
|
|
26
|
+
searchAriaLabel: "Cari pilihan"
|
|
27
|
+
},
|
|
28
|
+
"ta-SG": {
|
|
29
|
+
searchPlaceholder: "\u0BA4\u0BC7\u0B9F\u0BC1...",
|
|
30
|
+
searchAriaLabel: "\u0BA4\u0BC7\u0B9F\u0BB2\u0BCD \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0B99\u0BCD\u0B95\u0BB3\u0BCD"
|
|
31
|
+
}
|
|
32
|
+
};
|
|
14
33
|
const calculateEstimatedRowHeight = (size) => {
|
|
15
34
|
switch (size) {
|
|
16
35
|
case "xs":
|
|
@@ -28,12 +47,22 @@ function Select({
|
|
|
28
47
|
errorMessage,
|
|
29
48
|
...originalProps
|
|
30
49
|
}) {
|
|
50
|
+
const formatter = useLocalizedStringFormatter(i18nStrings);
|
|
31
51
|
const [_props, variantProps] = mapPropsVariants(
|
|
32
52
|
originalProps,
|
|
33
53
|
selectStyles.variantKeys
|
|
34
54
|
);
|
|
35
|
-
const {
|
|
55
|
+
const {
|
|
56
|
+
items,
|
|
57
|
+
children,
|
|
58
|
+
listLayoutOptions,
|
|
59
|
+
enableSearch = false,
|
|
60
|
+
searchPlaceholder,
|
|
61
|
+
searchIcon,
|
|
62
|
+
...props
|
|
63
|
+
} = _props;
|
|
36
64
|
const styles = selectStyles(variantProps);
|
|
65
|
+
const { contains } = useFilter({ sensitivity: "base" });
|
|
37
66
|
const layoutOptions = useMemo(() => {
|
|
38
67
|
return {
|
|
39
68
|
estimatedRowHeight: calculateEstimatedRowHeight(
|
|
@@ -42,6 +71,37 @@ function Select({
|
|
|
42
71
|
...listLayoutOptions
|
|
43
72
|
};
|
|
44
73
|
}, [listLayoutOptions, variantProps.size]);
|
|
74
|
+
const renderedSearchIcon = useMemo(() => {
|
|
75
|
+
if (!enableSearch || !searchIcon) return null;
|
|
76
|
+
if (isValidElement(searchIcon)) {
|
|
77
|
+
const iconElement = searchIcon;
|
|
78
|
+
return cloneElement(iconElement, {
|
|
79
|
+
className: styles.searchIcon({
|
|
80
|
+
className: cn(classNames?.searchIcon, iconElement.props.className)
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
return /* @__PURE__ */ jsx(
|
|
85
|
+
"span",
|
|
86
|
+
{
|
|
87
|
+
className: styles.searchIcon({ className: classNames?.searchIcon }),
|
|
88
|
+
children: searchIcon
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}, [classNames?.searchIcon, enableSearch, searchIcon, styles]);
|
|
92
|
+
const listContent = /* @__PURE__ */ jsx(Virtualizer, { layout: ListLayout, layoutOptions, children: /* @__PURE__ */ jsx(
|
|
93
|
+
ListBox,
|
|
94
|
+
{
|
|
95
|
+
autoFocus: !enableSearch,
|
|
96
|
+
items,
|
|
97
|
+
shouldFocusWrap: true,
|
|
98
|
+
className: composeRenderProps(
|
|
99
|
+
classNames?.list,
|
|
100
|
+
(className, renderProps) => styles.list({ className, ...renderProps })
|
|
101
|
+
),
|
|
102
|
+
children
|
|
103
|
+
}
|
|
104
|
+
) });
|
|
45
105
|
return /* @__PURE__ */ jsx(Provider, { values: [[SelectVariantContext, variantProps]], children: /* @__PURE__ */ jsxs(
|
|
46
106
|
Select$1,
|
|
47
107
|
{
|
|
@@ -91,19 +151,31 @@ function Select({
|
|
|
91
151
|
}
|
|
92
152
|
),
|
|
93
153
|
/* @__PURE__ */ jsx(FieldError, { size: variantProps.size, className: classNames?.error, children: errorMessage }),
|
|
94
|
-
/* @__PURE__ */ jsx(Popover, { className: styles.popover({ className: classNames?.popover }), children: /* @__PURE__ */
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
154
|
+
/* @__PURE__ */ jsx(Popover, { className: styles.popover({ className: classNames?.popover }), children: enableSearch ? /* @__PURE__ */ jsxs(Autocomplete, { filter: contains, children: [
|
|
155
|
+
/* @__PURE__ */ jsxs(
|
|
156
|
+
SearchField,
|
|
157
|
+
{
|
|
158
|
+
autoFocus: true,
|
|
159
|
+
"aria-label": formatter.format("searchAriaLabel"),
|
|
160
|
+
className: styles.searchField({
|
|
161
|
+
className: classNames?.searchField
|
|
162
|
+
}),
|
|
163
|
+
children: [
|
|
164
|
+
renderedSearchIcon,
|
|
165
|
+
/* @__PURE__ */ jsx(
|
|
166
|
+
Input,
|
|
167
|
+
{
|
|
168
|
+
placeholder: searchPlaceholder ?? formatter.format("searchPlaceholder"),
|
|
169
|
+
className: styles.searchInput({
|
|
170
|
+
className: classNames?.searchInput
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
)
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
listContent
|
|
178
|
+
] }) : listContent })
|
|
107
179
|
]
|
|
108
180
|
}
|
|
109
181
|
) });
|
|
@@ -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.2.3/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,
|
package/dist/esm/toast/toast.js
CHANGED
|
@@ -4,9 +4,9 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { Toaster as Toaster$1 } from 'sonner';
|
|
5
5
|
export { toast } from 'sonner';
|
|
6
6
|
import { toastStyles } from '@opengovsg/oui-theme';
|
|
7
|
-
import { Spinner } from '../spinner/spinner.js';
|
|
8
7
|
import { mapPropsVariants } from '../system/utils.js';
|
|
9
8
|
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
9
|
+
import { Spinner } from '../spinner/spinner.js';
|
|
10
10
|
|
|
11
11
|
function Toaster(originalProps) {
|
|
12
12
|
const [{ toastOptions, closeButton = true, ...props }, variantProps] = mapPropsVariants(originalProps, toastStyles.variantKeys);
|
|
@@ -13,6 +13,20 @@ export interface SelectProps<T> extends Omit<AriaSelectProps, "children">, Varia
|
|
|
13
13
|
/** The list of Select options to render */
|
|
14
14
|
items?: NonNullable<ListBoxProps<T>["items"]>;
|
|
15
15
|
children?: ListBoxProps<T>["children"];
|
|
16
|
+
/**
|
|
17
|
+
* Enable search/autocomplete functionality with a search field
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
enableSearch?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Placeholder text for the search field.
|
|
23
|
+
* If not provided, a localized default will be used.
|
|
24
|
+
*/
|
|
25
|
+
searchPlaceholder?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Icon to display in the search field. If not provided, no icon will be displayed.
|
|
28
|
+
*/
|
|
29
|
+
searchIcon?: React.ReactNode;
|
|
16
30
|
}
|
|
17
31
|
export declare function Select<T extends object>({ label, description, classNames, errorMessage, ...originalProps }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
18
32
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAiB9B,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAA0B,YAAY,EAAE,MAAM,sBAAsB,CAAA;AA2B3E,MAAM,WAAW,WAAW,CAAC,CAAC,CAC5B,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EACvC,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,UAAU,CAAC,EAAE,cAAc,CAAC,kBAAkB,GAAG,OAAO,CAAC,CAAA;IAEzD;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAEpC,YAAY,CAAC,EACT,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAEvD,2CAA2C;IAC3C,KAAK,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IAE7C,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;IAEtC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC7B;AAeD,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,EACvC,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,GAAG,aAAa,EACjB,EAAE,WAAW,CAAC,CAAC,CAAC,2CA+IhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengovsg/oui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"./package.json": "./package.json"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@storybook/react-vite": "10.1.
|
|
38
|
+
"@storybook/react-vite": "10.1.10",
|
|
39
39
|
"@types/lodash-es": "^4.17.12",
|
|
40
40
|
"@types/prop-types": "^15.7.15",
|
|
41
41
|
"@types/react": "^19.2.7",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"prettier": "^3.5.3",
|
|
48
48
|
"react": "^19.2.3",
|
|
49
49
|
"react-aria-components": "^1.13.0",
|
|
50
|
-
"storybook": "10.1.
|
|
50
|
+
"storybook": "10.1.10",
|
|
51
51
|
"tsx": "^4.21.0",
|
|
52
52
|
"typescript": "5.7.3",
|
|
53
|
-
"@opengovsg/oui-theme": "0.0.31",
|
|
54
53
|
"@oui/chromatic": "0.0.0",
|
|
54
|
+
"@opengovsg/oui-theme": "0.0.32",
|
|
55
55
|
"@oui/eslint-config": "0.0.0",
|
|
56
56
|
"@oui/prettier-config": "0.0.0",
|
|
57
57
|
"@oui/typescript-config": "0.0.0"
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"motion": ">=11.12.0 || >=12.0.0-alpha.1",
|
|
89
89
|
"react": ">= 18",
|
|
90
90
|
"react-aria-components": "^1.13.0",
|
|
91
|
-
"@opengovsg/oui-theme": "0.0.
|
|
91
|
+
"@opengovsg/oui-theme": "0.0.32"
|
|
92
92
|
},
|
|
93
93
|
"scripts": {
|
|
94
94
|
"build": "tsx ../../tooling/build-scripts/main.ts --dts --clean",
|