@opengovsg/oui 0.0.0-snapshot-20251103063040 → 0.0.0-snapshot-20251201075851
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/badge/badge.cjs +4 -4
- package/dist/cjs/badge/use-badge.cjs +6 -6
- package/dist/cjs/banner/banner.cjs +3 -3
- package/dist/cjs/button/button.cjs +4 -4
- package/dist/cjs/calendar/calendar-bottom-content.cjs +3 -3
- package/dist/cjs/calendar/calendar-header.cjs +2 -2
- package/dist/cjs/calendar/calendar-month-day-selector.cjs +6 -5
- package/dist/cjs/calendar/calendar.cjs +4 -4
- package/dist/cjs/calendar/hooks/use-calendar-selectors.cjs +4 -4
- package/dist/cjs/calendar/utils.cjs +3 -3
- package/dist/cjs/checkbox/checkbox.cjs +1 -1
- package/dist/cjs/combo-box/combo-box-fuzzy.cjs +6 -6
- package/dist/cjs/combo-box/combo-box-item.cjs +2 -2
- package/dist/cjs/combo-box/combo-box.cjs +5 -5
- package/dist/cjs/date-field/date-field.cjs +16 -7
- package/dist/cjs/date-picker/date-picker.cjs +39 -14
- package/dist/cjs/date-range-picker/date-range-picker.cjs +7 -7
- package/dist/cjs/field/field.cjs +20 -6
- package/dist/cjs/field/index.cjs +1 -0
- package/dist/cjs/file-dropzone/contexts.cjs +18 -0
- package/dist/cjs/file-dropzone/file-dropzone.cjs +311 -0
- package/dist/cjs/file-dropzone/file-info.cjs +146 -0
- package/dist/cjs/file-dropzone/index.cjs +13 -0
- package/dist/cjs/file-dropzone/types.cjs +3 -0
- package/dist/cjs/file-dropzone/utils.cjs +31 -0
- package/dist/cjs/govt-banner/govt-banner.cjs +3 -3
- package/dist/cjs/hooks/use-callback-ref.cjs +4 -4
- package/dist/cjs/hooks/use-controllable-state.cjs +2 -2
- package/dist/cjs/index.cjs +34 -24
- package/dist/cjs/input/input.cjs +2 -2
- package/dist/cjs/menu/menu.cjs +7 -7
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/Icon.cjs +4 -4
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +3 -3
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/plus.cjs +22 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/trash-2.cjs +25 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/upload.cjs +23 -0
- package/dist/cjs/number-field/index.cjs +8 -0
- package/dist/cjs/number-field/number-field.cjs +136 -0
- package/dist/cjs/pagination/hooks/use-pagination.cjs +7 -7
- package/dist/cjs/pagination/pagination.cjs +6 -6
- package/dist/cjs/pagination/use-pagination-item.cjs +7 -8
- package/dist/cjs/pagination/use-pagination.cjs +8 -8
- package/dist/cjs/range-calendar/range-calendar.cjs +6 -6
- package/dist/cjs/ripple/use-ripple.cjs +4 -4
- package/dist/cjs/select/select.cjs +4 -4
- package/dist/cjs/spinner/use-spinner.cjs +3 -3
- package/dist/cjs/system/react-utils/context.cjs +3 -3
- package/dist/cjs/system/react-utils/refs.cjs +3 -3
- package/dist/cjs/system/utils.cjs +3 -3
- package/dist/cjs/tabs/tabs.cjs +2 -2
- package/dist/cjs/tag-field/tag-field-item.cjs +2 -2
- package/dist/cjs/tag-field/tag-field-list.cjs +4 -4
- package/dist/cjs/tag-field/tag-field-root.cjs +14 -14
- package/dist/cjs/tag-field/tag-field-state-context.cjs +2 -2
- package/dist/cjs/tag-field/tag-field-tag-list.cjs +3 -3
- package/dist/cjs/tag-field/tag-field-trigger.cjs +2 -2
- package/dist/cjs/tag-field/tag-field.cjs +5 -5
- package/dist/cjs/tag-field/use-tag-field-state.cjs +6 -6
- package/dist/cjs/tag-field/use-tag-field.cjs +4 -4
- package/dist/cjs/text-area/text-area.cjs +2 -2
- 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/toggle/toggle.cjs +3 -3
- package/dist/esm/button/button.js +1 -1
- package/dist/esm/calendar/calendar-month-day-selector.js +4 -3
- 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 +13 -4
- package/dist/esm/date-picker/date-picker.js +37 -12
- package/dist/esm/date-range-picker/date-range-picker.js +4 -4
- package/dist/esm/field/field.js +20 -7
- package/dist/esm/field/index.js +1 -1
- package/dist/esm/file-dropzone/contexts.js +13 -0
- package/dist/esm/file-dropzone/file-dropzone.js +309 -0
- package/dist/esm/file-dropzone/file-info.js +144 -0
- package/dist/esm/file-dropzone/index.js +4 -0
- package/dist/esm/file-dropzone/types.js +1 -0
- package/dist/esm/file-dropzone/utils.js +28 -0
- package/dist/esm/index.js +13 -9
- package/dist/esm/menu/menu.js +1 -1
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/plus.js +17 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/trash-2.js +20 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/upload.js +18 -0
- package/dist/esm/number-field/index.js +2 -0
- package/dist/esm/number-field/number-field.js +134 -0
- package/dist/esm/pagination/use-pagination-item.js +5 -6
- 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-month-day-selector.d.ts.map +1 -1
- package/dist/types/date-field/date-field.d.ts +1 -0
- package/dist/types/date-field/date-field.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.d.ts +5 -2
- package/dist/types/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/field/field.d.ts +4 -1
- package/dist/types/field/field.d.ts.map +1 -1
- package/dist/types/file-dropzone/contexts.d.ts +4 -0
- package/dist/types/file-dropzone/contexts.d.ts.map +1 -0
- package/dist/types/file-dropzone/file-dropzone.d.ts +82 -0
- package/dist/types/file-dropzone/file-dropzone.d.ts.map +1 -0
- package/dist/types/file-dropzone/file-info.d.ts +9 -0
- package/dist/types/file-dropzone/file-info.d.ts.map +1 -0
- package/dist/types/file-dropzone/index.d.ts +7 -0
- package/dist/types/file-dropzone/index.d.ts.map +1 -0
- package/dist/types/file-dropzone/types.d.ts +24 -0
- package/dist/types/file-dropzone/types.d.ts.map +1 -0
- package/dist/types/file-dropzone/utils.d.ts +8 -0
- package/dist/types/file-dropzone/utils.d.ts.map +1 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/menu/menu.d.ts.map +1 -1
- package/dist/types/number-field/index.d.ts +3 -0
- package/dist/types/number-field/index.d.ts.map +1 -0
- package/dist/types/number-field/number-field.d.ts +24 -0
- package/dist/types/number-field/number-field.d.ts.map +1 -0
- package/package.json +12 -8
- package/dist/cjs/node_modules/.pnpm/@react-aria_focus@3.20.5_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/focus/dist/useFocusRing.cjs +0 -45
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/context.cjs +0 -21
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/textSelection.cjs +0 -72
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocus.cjs +0 -60
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocusVisible.cjs +0 -210
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocusWithin.cjs +0 -100
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useHover.cjs +0 -152
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/usePress.cjs +0 -676
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/utils.cjs +0 -160
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_check_private_redeclaration.cjs +0 -9
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.cjs +0 -9
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.cjs +0 -16
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.cjs +0 -9
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_get.cjs +0 -11
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_init.cjs +0 -10
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_set.cjs +0 -12
- package/dist/esm/node_modules/.pnpm/@react-aria_focus@3.20.5_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/focus/dist/useFocusRing.js +0 -43
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/context.js +0 -19
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/textSelection.js +0 -69
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocus.js +0 -58
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocusVisible.js +0 -205
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocusWithin.js +0 -98
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useHover.js +0 -150
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/usePress.js +0 -674
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/utils.js +0 -155
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +0 -7
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js +0 -7
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js +0 -14
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js +0 -7
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_get.js +0 -9
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_init.js +0 -8
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_set.js +0 -10
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,11 +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');
|
|
30
|
+
var calendar = require('./calendar/calendar.cjs');
|
|
31
|
+
var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
|
|
32
|
+
var utils = require('./calendar/utils.cjs');
|
|
26
33
|
var rangeCalendar = require('./range-calendar/range-calendar.cjs');
|
|
27
34
|
var menu = require('./menu/menu.cjs');
|
|
28
35
|
var popover = require('./popover/popover.cjs');
|
|
@@ -32,22 +39,20 @@ var datePicker = require('./date-picker/date-picker.cjs');
|
|
|
32
39
|
var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
|
|
33
40
|
var checkbox = require('./checkbox/checkbox.cjs');
|
|
34
41
|
var checkboxGroupStyleContext = require('./checkbox/checkbox-group-style-context.cjs');
|
|
42
|
+
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
35
43
|
var pagination = require('./pagination/pagination.cjs');
|
|
36
44
|
var paginationCursor = require('./pagination/pagination-cursor.cjs');
|
|
37
45
|
var paginationItem = require('./pagination/pagination-item.cjs');
|
|
38
|
-
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
39
46
|
var usePagination$1 = require('./pagination/use-pagination.cjs');
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
var calendar = require('./calendar/calendar.cjs');
|
|
45
|
-
var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
|
|
46
|
-
var utils = require('./calendar/utils.cjs');
|
|
47
|
+
var fileDropzone = require('./file-dropzone/file-dropzone.cjs');
|
|
48
|
+
var fileInfo = require('./file-dropzone/file-info.cjs');
|
|
49
|
+
var utils$1 = require('./file-dropzone/utils.cjs');
|
|
50
|
+
var numberField = require('./number-field/number-field.cjs');
|
|
47
51
|
|
|
48
52
|
|
|
49
53
|
|
|
50
54
|
exports.useControllableState = useControllableState.useControllableState;
|
|
55
|
+
exports.Button = button.Button;
|
|
51
56
|
exports.GovtBanner = govtBanner.GovtBanner;
|
|
52
57
|
exports.Ripple = ripple.Ripple;
|
|
53
58
|
exports.useRipple = useRipple.useRipple;
|
|
@@ -59,6 +64,7 @@ exports.Input = input.Input;
|
|
|
59
64
|
exports.TextField = textField.TextField;
|
|
60
65
|
exports.Description = field.Description;
|
|
61
66
|
exports.FieldError = field.FieldError;
|
|
67
|
+
exports.FieldErrorIcon = field.FieldErrorIcon;
|
|
62
68
|
exports.FieldGroup = field.FieldGroup;
|
|
63
69
|
exports.Label = field.Label;
|
|
64
70
|
exports.TextArea = textArea.TextArea;
|
|
@@ -69,12 +75,26 @@ exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
|
|
|
69
75
|
exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
|
|
70
76
|
exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
|
|
71
77
|
exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
|
|
78
|
+
exports.Banner = banner.Banner;
|
|
72
79
|
exports.TagField = tagField.TagField;
|
|
73
80
|
exports.TagFieldItem = tagFieldItem.TagFieldItem;
|
|
74
81
|
exports.Select = select.Select;
|
|
75
82
|
exports.SelectItem = selectItem.SelectItem;
|
|
76
83
|
exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
|
|
77
84
|
exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
|
|
85
|
+
exports.Badge = badge.Badge;
|
|
86
|
+
Object.defineProperty(exports, "CalendarDate", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function () { return date.CalendarDate; }
|
|
89
|
+
});
|
|
90
|
+
exports.Calendar = calendar.Calendar;
|
|
91
|
+
exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
|
|
92
|
+
exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
|
|
93
|
+
exports.useCalendarStyleContext = calendarStyleContext.useCalendarStyleContext;
|
|
94
|
+
exports.getEraFormat = utils.getEraFormat;
|
|
95
|
+
exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
|
|
96
|
+
exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
|
|
97
|
+
exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
|
|
78
98
|
exports.RangeCalendar = rangeCalendar.RangeCalendar;
|
|
79
99
|
exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
|
|
80
100
|
exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
|
|
@@ -101,24 +121,14 @@ exports.Checkbox = checkbox.Checkbox;
|
|
|
101
121
|
exports.CheckboxGroup = checkbox.CheckboxGroup;
|
|
102
122
|
exports.CheckboxGroupStyleContext = checkboxGroupStyleContext.CheckboxGroupStyleContext;
|
|
103
123
|
exports.useCheckboxGroupStyleContext = checkboxGroupStyleContext.useCheckboxGroupStyleContext;
|
|
124
|
+
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
104
125
|
exports.Pagination = pagination.Pagination;
|
|
105
126
|
exports.PaginationCursor = paginationCursor.PaginationCursor;
|
|
106
127
|
exports.PaginationItem = paginationItem.PaginationItem;
|
|
107
|
-
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
108
128
|
exports.CURSOR_TRANSITION_TIMEOUT = usePagination$1.CURSOR_TRANSITION_TIMEOUT;
|
|
109
129
|
exports.usePagination = usePagination$1.usePagination;
|
|
110
|
-
exports.
|
|
111
|
-
exports.
|
|
112
|
-
exports.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
get: function () { return date.CalendarDate; }
|
|
116
|
-
});
|
|
117
|
-
exports.Calendar = calendar.Calendar;
|
|
118
|
-
exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
|
|
119
|
-
exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
|
|
120
|
-
exports.useCalendarStyleContext = calendarStyleContext.useCalendarStyleContext;
|
|
121
|
-
exports.getEraFormat = utils.getEraFormat;
|
|
122
|
-
exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
|
|
123
|
-
exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
|
|
124
|
-
exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
|
|
130
|
+
exports.FileDropzone = fileDropzone.FileDropzone;
|
|
131
|
+
exports.FileInfo = fileInfo.FileInfo;
|
|
132
|
+
exports.formatBytes = utils$1.formatBytes;
|
|
133
|
+
exports.formatErrorMessage = utils$1.formatErrorMessage;
|
|
134
|
+
exports.NumberField = numberField.NumberField;
|
package/dist/cjs/input/input.cjs
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var
|
|
6
|
+
var react = require('react');
|
|
7
7
|
var reactAriaComponents = require('react-aria-components');
|
|
8
8
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
9
9
|
|
|
10
|
-
const Input =
|
|
10
|
+
const Input = react.forwardRef(
|
|
11
11
|
({ size, variant, isDisabled, ...props }, ref) => {
|
|
12
12
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
13
13
|
reactAriaComponents.Input,
|
package/dist/cjs/menu/menu.cjs
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var
|
|
6
|
+
var 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",
|
|
@@ -51,7 +51,7 @@ function MenuInner(originalProps, ref) {
|
|
|
51
51
|
) });
|
|
52
52
|
}
|
|
53
53
|
const Menu = utils.forwardRefGeneric(MenuInner);
|
|
54
|
-
const MenuItem =
|
|
54
|
+
const MenuItem = react.forwardRef(function MenuItem2(originalProps, ref) {
|
|
55
55
|
[originalProps, ref] = reactAriaComponents.useContextProps(
|
|
56
56
|
originalProps,
|
|
57
57
|
ref,
|
|
@@ -70,7 +70,7 @@ const MenuItem = $670gB$react.forwardRef(function MenuItem2(originalProps, ref)
|
|
|
70
70
|
variantProps
|
|
71
71
|
] = utils.mapPropsVariants(originalProps, ouiTheme.listBoxItemStyles.variantKeys);
|
|
72
72
|
const styles = ouiTheme.menuItemStyles(variantProps);
|
|
73
|
-
const multipleSelectionIcon =
|
|
73
|
+
const multipleSelectionIcon = react.useMemo(() => {
|
|
74
74
|
if (multipleSelectionIconProp !== void 0) {
|
|
75
75
|
return multipleSelectionIconProp;
|
|
76
76
|
}
|
|
@@ -82,7 +82,7 @@ const MenuItem = $670gB$react.forwardRef(function MenuItem2(originalProps, ref)
|
|
|
82
82
|
}
|
|
83
83
|
);
|
|
84
84
|
}, [classNames?.icon, multipleSelectionIconProp, styles]);
|
|
85
|
-
const singleSelectionIcon =
|
|
85
|
+
const singleSelectionIcon = react.useMemo(() => {
|
|
86
86
|
if (singleSelectionIconProp !== void 0) {
|
|
87
87
|
return singleSelectionIconProp;
|
|
88
88
|
}
|
|
@@ -94,7 +94,7 @@ const MenuItem = $670gB$react.forwardRef(function MenuItem2(originalProps, ref)
|
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
96
|
}, [classNames?.icon, singleSelectionIconProp, styles]);
|
|
97
|
-
const showIconContainer =
|
|
97
|
+
const showIconContainer = react.useCallback(
|
|
98
98
|
(selectionMode) => {
|
|
99
99
|
switch (selectionMode) {
|
|
100
100
|
case "none":
|
|
@@ -107,7 +107,7 @@ const MenuItem = $670gB$react.forwardRef(function MenuItem2(originalProps, ref)
|
|
|
107
107
|
},
|
|
108
108
|
[multipleSelectionIcon, singleSelectionIcon]
|
|
109
109
|
);
|
|
110
|
-
const defaultTextValue =
|
|
110
|
+
const defaultTextValue = react.useMemo(() => {
|
|
111
111
|
if (props.textValue) {
|
|
112
112
|
return props.textValue;
|
|
113
113
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var react = require('react');
|
|
6
6
|
var defaultAttributes = require('./defaultAttributes.cjs');
|
|
7
7
|
var utils = require('./shared/src/utils.cjs');
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ var utils = require('./shared/src/utils.cjs');
|
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
const Icon =
|
|
17
|
+
const Icon = react.forwardRef(
|
|
18
18
|
({
|
|
19
19
|
color = "currentColor",
|
|
20
20
|
size = 24,
|
|
@@ -25,7 +25,7 @@ const Icon = $670gB$react.forwardRef(
|
|
|
25
25
|
iconNode,
|
|
26
26
|
...rest
|
|
27
27
|
}, ref) => {
|
|
28
|
-
return
|
|
28
|
+
return react.createElement(
|
|
29
29
|
"svg",
|
|
30
30
|
{
|
|
31
31
|
ref,
|
|
@@ -38,7 +38,7 @@ const Icon = $670gB$react.forwardRef(
|
|
|
38
38
|
...rest
|
|
39
39
|
},
|
|
40
40
|
[
|
|
41
|
-
...iconNode.map(([tag, attrs]) =>
|
|
41
|
+
...iconNode.map(([tag, attrs]) => react.createElement(tag, attrs)),
|
|
42
42
|
...Array.isArray(children) ? children : [children]
|
|
43
43
|
]
|
|
44
44
|
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var react = require('react');
|
|
6
6
|
var utils = require('./shared/src/utils.cjs');
|
|
7
7
|
var Icon = require('./Icon.cjs');
|
|
8
8
|
|
|
@@ -15,8 +15,8 @@ var Icon = require('./Icon.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
const createLucideIcon = (iconName, iconNode) => {
|
|
18
|
-
const Component =
|
|
19
|
-
({ className, ...props }, ref) =>
|
|
18
|
+
const Component = react.forwardRef(
|
|
19
|
+
({ className, ...props }, ref) => react.createElement(Icon.default, {
|
|
20
20
|
ref,
|
|
21
21
|
iconNode,
|
|
22
22
|
className: utils.mergeClasses(`lucide-${utils.toKebabCase(iconName)}`, className),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var createLucideIcon = require('../createLucideIcon.cjs');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @license lucide-react v0.475.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const __iconNode = [
|
|
16
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
17
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
18
|
+
];
|
|
19
|
+
const Plus = createLucideIcon.default("Plus", __iconNode);
|
|
20
|
+
|
|
21
|
+
exports.__iconNode = __iconNode;
|
|
22
|
+
exports.default = Plus;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var createLucideIcon = require('../createLucideIcon.cjs');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @license lucide-react v0.475.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const __iconNode = [
|
|
16
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
17
|
+
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
18
|
+
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
|
|
19
|
+
["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
|
|
20
|
+
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
|
|
21
|
+
];
|
|
22
|
+
const Trash2 = createLucideIcon.default("Trash2", __iconNode);
|
|
23
|
+
|
|
24
|
+
exports.__iconNode = __iconNode;
|
|
25
|
+
exports.default = Trash2;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var createLucideIcon = require('../createLucideIcon.cjs');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @license lucide-react v0.475.0 - ISC
|
|
9
|
+
*
|
|
10
|
+
* This source code is licensed under the ISC license.
|
|
11
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const __iconNode = [
|
|
16
|
+
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
17
|
+
["polyline", { points: "17 8 12 3 7 8", key: "t8dd8p" }],
|
|
18
|
+
["line", { x1: "12", x2: "12", y1: "3", y2: "15", key: "widbto" }]
|
|
19
|
+
];
|
|
20
|
+
const Upload = createLucideIcon.default("Upload", __iconNode);
|
|
21
|
+
|
|
22
|
+
exports.__iconNode = __iconNode;
|
|
23
|
+
exports.default = Upload;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var reactAriaComponents = require('react-aria-components');
|
|
7
|
+
var ouiTheme = require('@opengovsg/oui-theme');
|
|
8
|
+
var utils = require('../system/utils.cjs');
|
|
9
|
+
var minus = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.cjs');
|
|
10
|
+
var plus = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/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
|
+
|
|
15
|
+
function NumberField(originalProps) {
|
|
16
|
+
const [
|
|
17
|
+
{
|
|
18
|
+
label,
|
|
19
|
+
description,
|
|
20
|
+
errorMessage,
|
|
21
|
+
classNames,
|
|
22
|
+
inputProps,
|
|
23
|
+
startContent,
|
|
24
|
+
endContent,
|
|
25
|
+
hideSteppers,
|
|
26
|
+
...props
|
|
27
|
+
},
|
|
28
|
+
variantProps
|
|
29
|
+
] = utils.mapPropsVariants(originalProps, ouiTheme.numberFieldStyles.variantKeys);
|
|
30
|
+
const styles = ouiTheme.numberFieldStyles(variantProps);
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
32
|
+
reactAriaComponents.NumberField,
|
|
33
|
+
{
|
|
34
|
+
...props,
|
|
35
|
+
"data-hide-steppers": ouiTheme.dataAttr(!!hideSteppers),
|
|
36
|
+
"data-has-start-content": ouiTheme.dataAttr(!!startContent),
|
|
37
|
+
"data-has-end-content": ouiTheme.dataAttr(!!endContent),
|
|
38
|
+
className: ouiTheme.composeTailwindRenderProps(
|
|
39
|
+
props.className,
|
|
40
|
+
styles.base({
|
|
41
|
+
className: classNames?.base
|
|
42
|
+
})
|
|
43
|
+
),
|
|
44
|
+
children: [
|
|
45
|
+
label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
46
|
+
field.Label,
|
|
47
|
+
{
|
|
48
|
+
className: styles.label({ className: classNames?.label }),
|
|
49
|
+
size: variantProps.size,
|
|
50
|
+
children: label
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsx(field.FieldGroup, { className: styles.field({ className: classNames?.field }), children: (renderProps) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
54
|
+
startContent,
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
56
|
+
input.Input,
|
|
57
|
+
{
|
|
58
|
+
size: variantProps.size,
|
|
59
|
+
variant: "unstyled",
|
|
60
|
+
className: styles.input({
|
|
61
|
+
className: classNames?.input
|
|
62
|
+
}),
|
|
63
|
+
...inputProps
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
endContent,
|
|
67
|
+
!hideSteppers && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
className: ouiTheme.fieldBorderStyles({
|
|
71
|
+
...renderProps,
|
|
72
|
+
className: ouiTheme.cn(
|
|
73
|
+
styles.stepperContainer({
|
|
74
|
+
className: classNames?.stepperContainer
|
|
75
|
+
})
|
|
76
|
+
)
|
|
77
|
+
}),
|
|
78
|
+
children: [
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
80
|
+
button.Button,
|
|
81
|
+
{
|
|
82
|
+
className: styles.decrement({
|
|
83
|
+
className: classNames?.decrement
|
|
84
|
+
}),
|
|
85
|
+
size: variantProps.size,
|
|
86
|
+
isIconOnly: true,
|
|
87
|
+
variant: "clear",
|
|
88
|
+
color: "neutral",
|
|
89
|
+
slot: "decrement",
|
|
90
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(minus.default, { "aria-hidden": true })
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
94
|
+
button.Button,
|
|
95
|
+
{
|
|
96
|
+
className: styles.increment({
|
|
97
|
+
className: classNames?.increment
|
|
98
|
+
}),
|
|
99
|
+
size: variantProps.size,
|
|
100
|
+
isIconOnly: true,
|
|
101
|
+
variant: "clear",
|
|
102
|
+
color: "neutral",
|
|
103
|
+
slot: "increment",
|
|
104
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(plus.default, { "aria-hidden": true })
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] }) }),
|
|
111
|
+
description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
112
|
+
field.Description,
|
|
113
|
+
{
|
|
114
|
+
className: styles.description({
|
|
115
|
+
className: classNames?.description
|
|
116
|
+
}),
|
|
117
|
+
size: variantProps.size,
|
|
118
|
+
children: description
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
122
|
+
field.FieldError,
|
|
123
|
+
{
|
|
124
|
+
className: styles.error({
|
|
125
|
+
className: classNames?.error
|
|
126
|
+
}),
|
|
127
|
+
size: variantProps.size,
|
|
128
|
+
children: errorMessage
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
exports.NumberField = NumberField;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var react = require('react');
|
|
6
6
|
var i18n = require('@react-aria/i18n');
|
|
7
7
|
|
|
8
8
|
var PaginationItemType = /* @__PURE__ */ ((PaginationItemType2) => {
|
|
@@ -25,22 +25,22 @@ function usePagination(props) {
|
|
|
25
25
|
showControls = false,
|
|
26
26
|
onChange
|
|
27
27
|
} = props;
|
|
28
|
-
const [activePage, setActivePage] =
|
|
28
|
+
const [activePage, setActivePage] = react.useState(page || initialPage);
|
|
29
29
|
const { direction } = i18n.useLocale();
|
|
30
30
|
const isRTL = direction === "rtl";
|
|
31
|
-
const onChangeActivePage =
|
|
31
|
+
const onChangeActivePage = react.useCallback(
|
|
32
32
|
(newPage) => {
|
|
33
33
|
setActivePage(newPage);
|
|
34
34
|
onChange?.(newPage);
|
|
35
35
|
},
|
|
36
36
|
[onChange]
|
|
37
37
|
);
|
|
38
|
-
|
|
38
|
+
react.useEffect(() => {
|
|
39
39
|
if (page && page !== activePage) {
|
|
40
40
|
setActivePage(page);
|
|
41
41
|
}
|
|
42
42
|
}, [activePage, page]);
|
|
43
|
-
const setPage =
|
|
43
|
+
const setPage = react.useCallback(
|
|
44
44
|
(pageNumber) => {
|
|
45
45
|
if (pageNumber <= 0) {
|
|
46
46
|
onChangeActivePage(1);
|
|
@@ -56,7 +56,7 @@ function usePagination(props) {
|
|
|
56
56
|
const previous = () => setPage(activePage - 1);
|
|
57
57
|
const first = () => setPage(1);
|
|
58
58
|
const last = () => setPage(total);
|
|
59
|
-
const formatRange =
|
|
59
|
+
const formatRange = react.useCallback(
|
|
60
60
|
(range2) => {
|
|
61
61
|
if (showControls) {
|
|
62
62
|
return ["prev" /* PREV */, ...range2, "next" /* NEXT */];
|
|
@@ -66,7 +66,7 @@ function usePagination(props) {
|
|
|
66
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
67
67
|
[isRTL, showControls]
|
|
68
68
|
);
|
|
69
|
-
const paginationRange =
|
|
69
|
+
const paginationRange = react.useMemo(() => {
|
|
70
70
|
const totalPageNumbers = siblings * 2 + 3 + boundaries * 2;
|
|
71
71
|
if (totalPageNumbers >= total) {
|
|
72
72
|
return formatRange(range(1, total));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
-
var
|
|
6
|
+
var react = require('react');
|
|
7
7
|
var i18n = require('@react-aria/i18n');
|
|
8
8
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
9
9
|
var utils = require('../system/utils.cjs');
|
|
@@ -40,7 +40,7 @@ const Pagination = utils.forwardRef((props, ref) => {
|
|
|
40
40
|
} = usePagination.usePagination({ ...props, ref });
|
|
41
41
|
const { direction } = i18n.useLocale();
|
|
42
42
|
const isRTL = direction === "rtl";
|
|
43
|
-
const renderChevronIcon =
|
|
43
|
+
const renderChevronIcon = react.useCallback(
|
|
44
44
|
(key) => {
|
|
45
45
|
if (key === usePagination$1.PaginationItemType.PREV && !isRTL || key === usePagination$1.PaginationItemType.NEXT && isRTL) {
|
|
46
46
|
return /* @__PURE__ */ jsxRuntime.jsx(chevronLeft.default, {});
|
|
@@ -56,7 +56,7 @@ const Pagination = utils.forwardRef((props, ref) => {
|
|
|
56
56
|
},
|
|
57
57
|
[isRTL, slots, classNames?.chevronNext]
|
|
58
58
|
);
|
|
59
|
-
const renderPrevItem =
|
|
59
|
+
const renderPrevItem = react.useCallback(() => {
|
|
60
60
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
61
61
|
paginationItem.PaginationItem,
|
|
62
62
|
{
|
|
@@ -82,7 +82,7 @@ const Pagination = utils.forwardRef((props, ref) => {
|
|
|
82
82
|
onPrevious,
|
|
83
83
|
renderChevronIcon
|
|
84
84
|
]);
|
|
85
|
-
const renderNextItem =
|
|
85
|
+
const renderNextItem = react.useCallback(() => {
|
|
86
86
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
87
87
|
paginationItem.PaginationItem,
|
|
88
88
|
{
|
|
@@ -109,7 +109,7 @@ const Pagination = utils.forwardRef((props, ref) => {
|
|
|
109
109
|
onNext,
|
|
110
110
|
renderChevronIcon
|
|
111
111
|
]);
|
|
112
|
-
const renderItem =
|
|
112
|
+
const renderItem = react.useCallback(
|
|
113
113
|
(value, index) => {
|
|
114
114
|
const isBefore = index < range.indexOf(activePage);
|
|
115
115
|
if (renderItemProp && typeof renderItemProp === "function") {
|
|
@@ -209,7 +209,7 @@ const Pagination = utils.forwardRef((props, ref) => {
|
|
|
209
209
|
usePagination$1.PaginationItemType.DOTS + isBefore
|
|
210
210
|
);
|
|
211
211
|
}
|
|
212
|
-
return /* @__PURE__ */
|
|
212
|
+
return /* @__PURE__ */ react.createElement(
|
|
213
213
|
paginationItem.PaginationItem,
|
|
214
214
|
{
|
|
215
215
|
...getItemProps({ value }),
|
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var focus = require('@react-aria/focus');
|
|
7
|
+
var interactions = require('@react-aria/interactions');
|
|
7
8
|
var utils = require('@react-aria/utils');
|
|
8
|
-
var useHover = require('../node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useHover.cjs');
|
|
9
|
-
var usePress = require('../node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/usePress.cjs');
|
|
10
9
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
11
10
|
var filterDomProps = require('../system/react-utils/filter-dom-props.cjs');
|
|
12
11
|
var refs = require('../system/react-utils/refs.cjs');
|
|
@@ -30,16 +29,16 @@ function usePaginationItem(props) {
|
|
|
30
29
|
const shouldFilterDOMProps = typeof Component === "string";
|
|
31
30
|
const domRef = refs.useDomRef(ref);
|
|
32
31
|
const router = utils.useRouter();
|
|
33
|
-
const ariaLabel =
|
|
32
|
+
const ariaLabel = react.useMemo(
|
|
34
33
|
() => isActive ? `${getAriaLabel?.(value)} active` : getAriaLabel?.(value),
|
|
35
34
|
[isActive, getAriaLabel, value]
|
|
36
35
|
);
|
|
37
|
-
const { isPressed, pressProps } =
|
|
36
|
+
const { isPressed, pressProps } = interactions.usePress({
|
|
38
37
|
isDisabled,
|
|
39
38
|
onPress
|
|
40
39
|
});
|
|
41
|
-
const { focusProps, isFocused, isFocusVisible } =
|
|
42
|
-
const { isHovered, hoverProps } =
|
|
40
|
+
const { focusProps, isFocused, isFocusVisible } = focus.useFocusRing({});
|
|
41
|
+
const { isHovered, hoverProps } = interactions.useHover({ isDisabled });
|
|
43
42
|
const getItemProps = (props2 = {}) => {
|
|
44
43
|
return {
|
|
45
44
|
ref: domRef,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var react = require('react');
|
|
6
6
|
var scrollIntoView = require('scroll-into-view-if-needed');
|
|
7
7
|
var useDeepCompare = require('use-deep-compare');
|
|
8
8
|
var usehooksTs = require('usehooks-ts');
|
|
@@ -37,9 +37,9 @@ function usePagination(originalProps) {
|
|
|
37
37
|
} = props;
|
|
38
38
|
const Component = as || "nav";
|
|
39
39
|
const domRef = refs.useDomRef(ref);
|
|
40
|
-
const cursorRef =
|
|
41
|
-
const itemsRef =
|
|
42
|
-
const cursorTimer =
|
|
40
|
+
const cursorRef = react.useRef(null);
|
|
41
|
+
const itemsRef = react.useRef(null);
|
|
42
|
+
const cursorTimer = react.useRef(null);
|
|
43
43
|
const disableAnimation = originalProps?.disableAnimation ?? false;
|
|
44
44
|
const disableCursorAnimation = originalProps?.disableCursorAnimation ?? disableAnimation ?? false;
|
|
45
45
|
function getItemsRefMap() {
|
|
@@ -56,7 +56,7 @@ function usePagination(originalProps) {
|
|
|
56
56
|
map.delete(value);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
const scrollTo =
|
|
59
|
+
const scrollTo = react.useCallback(
|
|
60
60
|
(value, skipAnimation) => {
|
|
61
61
|
const map = getItemsRefMap();
|
|
62
62
|
const node = map.get(value);
|
|
@@ -103,13 +103,13 @@ function usePagination(originalProps) {
|
|
|
103
103
|
onChange
|
|
104
104
|
});
|
|
105
105
|
const [setRef, isVisible] = usehooksTs.useIntersectionObserver();
|
|
106
|
-
|
|
106
|
+
react.useEffect(() => {
|
|
107
107
|
if (domRef.current) {
|
|
108
108
|
setRef(domRef.current);
|
|
109
109
|
}
|
|
110
110
|
}, [domRef, setRef]);
|
|
111
|
-
const activePageRef =
|
|
112
|
-
|
|
111
|
+
const activePageRef = react.useRef(activePage);
|
|
112
|
+
react.useEffect(() => {
|
|
113
113
|
if (activePage && !disableAnimation && isVisible) {
|
|
114
114
|
scrollTo(activePage, activePage === activePageRef.current);
|
|
115
115
|
}
|