@opengovsg/oui 0.0.23 → 0.0.25

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.
Files changed (148) hide show
  1. package/dist/cjs/badge/badge.cjs +4 -4
  2. package/dist/cjs/badge/use-badge.cjs +6 -6
  3. package/dist/cjs/banner/banner.cjs +3 -3
  4. package/dist/cjs/button/button.cjs +3 -3
  5. package/dist/cjs/calendar/calendar-bottom-content.cjs +3 -3
  6. package/dist/cjs/calendar/calendar-header.cjs +2 -2
  7. package/dist/cjs/calendar/calendar-month-day-selector.cjs +2 -2
  8. package/dist/cjs/calendar/calendar.cjs +4 -4
  9. package/dist/cjs/calendar/hooks/use-calendar-selectors.cjs +4 -4
  10. package/dist/cjs/calendar/utils.cjs +3 -3
  11. package/dist/cjs/checkbox/checkbox.cjs +1 -1
  12. package/dist/cjs/combo-box/combo-box-fuzzy.cjs +6 -6
  13. package/dist/cjs/combo-box/combo-box-item.cjs +2 -2
  14. package/dist/cjs/combo-box/combo-box.cjs +5 -5
  15. package/dist/cjs/date-field/date-field.cjs +4 -4
  16. package/dist/cjs/date-picker/date-picker.cjs +7 -6
  17. package/dist/cjs/date-range-picker/date-range-picker.cjs +7 -7
  18. package/dist/cjs/field/field.cjs +2 -2
  19. package/dist/cjs/file-dropzone/file-dropzone.cjs +12 -12
  20. package/dist/cjs/file-dropzone/file-info.cjs +3 -3
  21. package/dist/cjs/govt-banner/govt-banner.cjs +3 -3
  22. package/dist/cjs/hooks/index.cjs +2 -0
  23. package/dist/cjs/hooks/use-callback-ref.cjs +4 -4
  24. package/dist/cjs/hooks/use-controllable-state.cjs +2 -2
  25. package/dist/cjs/hooks/use-draggable.cjs +88 -0
  26. package/dist/cjs/index.cjs +54 -39
  27. package/dist/cjs/input/input.cjs +2 -2
  28. package/dist/cjs/menu/menu.cjs +7 -7
  29. package/dist/cjs/modal/i18n.cjs +19 -0
  30. package/dist/cjs/modal/index.cjs +19 -0
  31. package/dist/cjs/modal/modal-body.cjs +26 -0
  32. package/dist/cjs/modal/modal-content.cjs +54 -0
  33. package/dist/cjs/modal/modal-footer.cjs +27 -0
  34. package/dist/cjs/modal/modal-header.cjs +25 -0
  35. package/dist/cjs/modal/modal-variant-context.cjs +13 -0
  36. package/dist/cjs/modal/modal.cjs +66 -0
  37. 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
  38. 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
  39. package/dist/cjs/number-field/number-field.cjs +2 -2
  40. package/dist/cjs/pagination/hooks/use-pagination.cjs +7 -7
  41. package/dist/cjs/pagination/pagination.cjs +6 -6
  42. package/dist/cjs/pagination/use-pagination-item.cjs +7 -8
  43. package/dist/cjs/pagination/use-pagination.cjs +8 -8
  44. package/dist/cjs/range-calendar/range-calendar.cjs +7 -7
  45. package/dist/cjs/ripple/use-ripple.cjs +4 -4
  46. package/dist/cjs/select/select.cjs +4 -4
  47. package/dist/cjs/spinner/use-spinner.cjs +3 -3
  48. package/dist/cjs/system/react-utils/context.cjs +3 -3
  49. package/dist/cjs/system/react-utils/refs.cjs +3 -3
  50. package/dist/cjs/system/utils.cjs +3 -3
  51. package/dist/cjs/tabs/tabs.cjs +2 -2
  52. package/dist/cjs/tag-field/tag-field-item.cjs +2 -2
  53. package/dist/cjs/tag-field/tag-field-list.cjs +4 -4
  54. package/dist/cjs/tag-field/tag-field-root.cjs +14 -14
  55. package/dist/cjs/tag-field/tag-field-state-context.cjs +2 -2
  56. package/dist/cjs/tag-field/tag-field-tag-list.cjs +3 -3
  57. package/dist/cjs/tag-field/tag-field-trigger.cjs +2 -2
  58. package/dist/cjs/tag-field/tag-field.cjs +5 -5
  59. package/dist/cjs/tag-field/use-tag-field-state.cjs +6 -6
  60. package/dist/cjs/tag-field/use-tag-field.cjs +4 -4
  61. package/dist/cjs/text-area/text-area.cjs +2 -2
  62. package/dist/cjs/text-area-field/text-area-field.cjs +1 -1
  63. package/dist/cjs/text-field/text-field.cjs +1 -1
  64. package/dist/cjs/toggle/toggle.cjs +3 -3
  65. package/dist/esm/checkbox/checkbox.js +1 -1
  66. package/dist/esm/combo-box/combo-box.js +2 -2
  67. package/dist/esm/date-field/date-field.js +1 -1
  68. package/dist/esm/date-picker/date-picker.js +5 -4
  69. package/dist/esm/date-range-picker/date-range-picker.js +4 -4
  70. package/dist/esm/file-dropzone/file-dropzone.js +2 -2
  71. package/dist/esm/hooks/index.js +1 -0
  72. package/dist/esm/hooks/use-draggable.js +86 -0
  73. package/dist/esm/index.js +18 -11
  74. package/dist/esm/menu/menu.js +1 -1
  75. package/dist/esm/modal/i18n.js +17 -0
  76. package/dist/esm/modal/index.js +7 -0
  77. package/dist/esm/modal/modal-body.js +24 -0
  78. package/dist/esm/modal/modal-content.js +52 -0
  79. package/dist/esm/modal/modal-footer.js +25 -0
  80. package/dist/esm/modal/modal-header.js +23 -0
  81. package/dist/esm/modal/modal-variant-context.js +10 -0
  82. package/dist/esm/modal/modal.js +64 -0
  83. package/dist/esm/number-field/number-field.js +2 -2
  84. package/dist/esm/pagination/use-pagination-item.js +5 -6
  85. package/dist/esm/range-calendar/range-calendar.js +1 -1
  86. package/dist/esm/select/select.js +2 -2
  87. package/dist/esm/tag-field/tag-field.js +3 -3
  88. package/dist/esm/text-area-field/text-area-field.js +1 -1
  89. package/dist/esm/text-field/text-field.js +1 -1
  90. package/dist/types/badge/use-badge.d.ts +12 -12
  91. package/dist/types/hooks/index.d.ts +4 -1
  92. package/dist/types/hooks/index.d.ts.map +1 -1
  93. package/dist/types/hooks/use-draggable.d.ts +24 -0
  94. package/dist/types/hooks/use-draggable.d.ts.map +1 -0
  95. package/dist/types/index.d.mts +1 -0
  96. package/dist/types/index.d.ts +1 -0
  97. package/dist/types/index.d.ts.map +1 -1
  98. package/dist/types/menu/menu.d.ts.map +1 -1
  99. package/dist/types/modal/i18n.d.ts +3 -0
  100. package/dist/types/modal/i18n.d.ts.map +1 -0
  101. package/dist/types/modal/index.d.ts +12 -0
  102. package/dist/types/modal/index.d.ts.map +1 -0
  103. package/dist/types/modal/modal-body.d.ts +5 -0
  104. package/dist/types/modal/modal-body.d.ts.map +1 -0
  105. package/dist/types/modal/modal-content.d.ts +10 -0
  106. package/dist/types/modal/modal-content.d.ts.map +1 -0
  107. package/dist/types/modal/modal-footer.d.ts +5 -0
  108. package/dist/types/modal/modal-footer.d.ts.map +1 -0
  109. package/dist/types/modal/modal-header.d.ts +5 -0
  110. package/dist/types/modal/modal-header.d.ts.map +1 -0
  111. package/dist/types/modal/modal-variant-context.d.ts +8 -0
  112. package/dist/types/modal/modal-variant-context.d.ts.map +1 -0
  113. package/dist/types/modal/modal.d.ts +8 -0
  114. package/dist/types/modal/modal.d.ts.map +1 -0
  115. package/dist/types/pagination/use-pagination.d.ts +36 -36
  116. package/package.json +13 -10
  117. 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
  118. 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
  119. 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
  120. 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
  121. 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
  122. 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
  123. 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
  124. 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
  125. 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
  126. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_check_private_redeclaration.cjs +0 -9
  127. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.cjs +0 -9
  128. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.cjs +0 -16
  129. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.cjs +0 -9
  130. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_get.cjs +0 -11
  131. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_init.cjs +0 -10
  132. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_set.cjs +0 -12
  133. 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
  134. 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
  135. 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
  136. 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
  137. 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
  138. 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
  139. 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
  140. 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
  141. 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
  142. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +0 -7
  143. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js +0 -7
  144. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js +0 -14
  145. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js +0 -7
  146. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_get.js +0 -9
  147. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_init.js +0 -8
  148. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_set.js +0 -10
@@ -149,182 +149,182 @@ export declare function usePagination(originalProps: UsePaginationProps): {
149
149
  dotsJump: number;
150
150
  slots: {
151
151
  base: (slotProps?: ({
152
+ isDisabled?: boolean | undefined;
152
153
  size?: "lg" | "md" | "sm" | undefined;
153
154
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
154
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
155
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
155
156
  variant?: "light" | undefined;
156
- isDisabled?: boolean | undefined;
157
157
  isCompact?: boolean | undefined;
158
158
  disableCursorAnimation?: boolean | undefined;
159
159
  disableAnimation?: boolean | undefined;
160
160
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
161
161
  wrapper: (slotProps?: ({
162
+ isDisabled?: boolean | undefined;
162
163
  size?: "lg" | "md" | "sm" | undefined;
163
164
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
164
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
165
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
165
166
  variant?: "light" | undefined;
166
- isDisabled?: boolean | undefined;
167
167
  isCompact?: boolean | undefined;
168
168
  disableCursorAnimation?: boolean | undefined;
169
169
  disableAnimation?: boolean | undefined;
170
170
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
171
171
  item: (slotProps?: ({
172
+ isDisabled?: boolean | undefined;
172
173
  size?: "lg" | "md" | "sm" | undefined;
173
174
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
174
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
175
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
175
176
  variant?: "light" | undefined;
176
- isDisabled?: boolean | undefined;
177
177
  isCompact?: boolean | undefined;
178
178
  disableCursorAnimation?: boolean | undefined;
179
179
  disableAnimation?: boolean | undefined;
180
180
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
181
181
  prev: (slotProps?: ({
182
+ isDisabled?: boolean | undefined;
182
183
  size?: "lg" | "md" | "sm" | undefined;
183
184
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
184
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
185
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
185
186
  variant?: "light" | undefined;
186
- isDisabled?: boolean | undefined;
187
187
  isCompact?: boolean | undefined;
188
188
  disableCursorAnimation?: boolean | undefined;
189
189
  disableAnimation?: boolean | undefined;
190
190
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
191
191
  next: (slotProps?: ({
192
+ isDisabled?: boolean | undefined;
192
193
  size?: "lg" | "md" | "sm" | undefined;
193
194
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
194
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
195
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
195
196
  variant?: "light" | undefined;
196
- isDisabled?: boolean | undefined;
197
197
  isCompact?: boolean | undefined;
198
198
  disableCursorAnimation?: boolean | undefined;
199
199
  disableAnimation?: boolean | undefined;
200
200
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
201
201
  cursor: (slotProps?: ({
202
+ isDisabled?: boolean | undefined;
202
203
  size?: "lg" | "md" | "sm" | undefined;
203
204
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
204
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
205
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
205
206
  variant?: "light" | undefined;
206
- isDisabled?: boolean | undefined;
207
207
  isCompact?: boolean | undefined;
208
208
  disableCursorAnimation?: boolean | undefined;
209
209
  disableAnimation?: boolean | undefined;
210
210
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
211
211
  forwardIcon: (slotProps?: ({
212
+ isDisabled?: boolean | undefined;
212
213
  size?: "lg" | "md" | "sm" | undefined;
213
214
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
214
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
215
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
215
216
  variant?: "light" | undefined;
216
- isDisabled?: boolean | undefined;
217
217
  isCompact?: boolean | undefined;
218
218
  disableCursorAnimation?: boolean | undefined;
219
219
  disableAnimation?: boolean | undefined;
220
220
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
221
221
  ellipsis: (slotProps?: ({
222
+ isDisabled?: boolean | undefined;
222
223
  size?: "lg" | "md" | "sm" | undefined;
223
224
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
224
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
225
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
225
226
  variant?: "light" | undefined;
226
- isDisabled?: boolean | undefined;
227
227
  isCompact?: boolean | undefined;
228
228
  disableCursorAnimation?: boolean | undefined;
229
229
  disableAnimation?: boolean | undefined;
230
230
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
231
231
  chevronNext: (slotProps?: ({
232
+ isDisabled?: boolean | undefined;
232
233
  size?: "lg" | "md" | "sm" | undefined;
233
234
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
234
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
235
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
235
236
  variant?: "light" | undefined;
236
- isDisabled?: boolean | undefined;
237
237
  isCompact?: boolean | undefined;
238
238
  disableCursorAnimation?: boolean | undefined;
239
239
  disableAnimation?: boolean | undefined;
240
240
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
241
241
  } & {
242
242
  base: (slotProps?: ({
243
+ isDisabled?: boolean | undefined;
243
244
  size?: "lg" | "md" | "sm" | undefined;
244
245
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
245
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
246
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
246
247
  variant?: "light" | undefined;
247
- isDisabled?: boolean | undefined;
248
248
  isCompact?: boolean | undefined;
249
249
  disableCursorAnimation?: boolean | undefined;
250
250
  disableAnimation?: boolean | undefined;
251
251
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
252
252
  wrapper: (slotProps?: ({
253
+ isDisabled?: boolean | undefined;
253
254
  size?: "lg" | "md" | "sm" | undefined;
254
255
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
255
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
256
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
256
257
  variant?: "light" | undefined;
257
- isDisabled?: boolean | undefined;
258
258
  isCompact?: boolean | undefined;
259
259
  disableCursorAnimation?: boolean | undefined;
260
260
  disableAnimation?: boolean | undefined;
261
261
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
262
262
  item: (slotProps?: ({
263
+ isDisabled?: boolean | undefined;
263
264
  size?: "lg" | "md" | "sm" | undefined;
264
265
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
265
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
266
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
266
267
  variant?: "light" | undefined;
267
- isDisabled?: boolean | undefined;
268
268
  isCompact?: boolean | undefined;
269
269
  disableCursorAnimation?: boolean | undefined;
270
270
  disableAnimation?: boolean | undefined;
271
271
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
272
272
  prev: (slotProps?: ({
273
+ isDisabled?: boolean | undefined;
273
274
  size?: "lg" | "md" | "sm" | undefined;
274
275
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
275
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
276
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
276
277
  variant?: "light" | undefined;
277
- isDisabled?: boolean | undefined;
278
278
  isCompact?: boolean | undefined;
279
279
  disableCursorAnimation?: boolean | undefined;
280
280
  disableAnimation?: boolean | undefined;
281
281
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
282
282
  next: (slotProps?: ({
283
+ isDisabled?: boolean | undefined;
283
284
  size?: "lg" | "md" | "sm" | undefined;
284
285
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
285
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
286
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
286
287
  variant?: "light" | undefined;
287
- isDisabled?: boolean | undefined;
288
288
  isCompact?: boolean | undefined;
289
289
  disableCursorAnimation?: boolean | undefined;
290
290
  disableAnimation?: boolean | undefined;
291
291
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
292
292
  cursor: (slotProps?: ({
293
+ isDisabled?: boolean | undefined;
293
294
  size?: "lg" | "md" | "sm" | undefined;
294
295
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
295
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
296
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
296
297
  variant?: "light" | undefined;
297
- isDisabled?: boolean | undefined;
298
298
  isCompact?: boolean | undefined;
299
299
  disableCursorAnimation?: boolean | undefined;
300
300
  disableAnimation?: boolean | undefined;
301
301
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
302
302
  forwardIcon: (slotProps?: ({
303
+ isDisabled?: boolean | undefined;
303
304
  size?: "lg" | "md" | "sm" | undefined;
304
305
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
305
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
306
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
306
307
  variant?: "light" | undefined;
307
- isDisabled?: boolean | undefined;
308
308
  isCompact?: boolean | undefined;
309
309
  disableCursorAnimation?: boolean | undefined;
310
310
  disableAnimation?: boolean | undefined;
311
311
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
312
312
  ellipsis: (slotProps?: ({
313
+ isDisabled?: boolean | undefined;
313
314
  size?: "lg" | "md" | "sm" | undefined;
314
315
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
315
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
316
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
316
317
  variant?: "light" | undefined;
317
- isDisabled?: boolean | undefined;
318
318
  isCompact?: boolean | undefined;
319
319
  disableCursorAnimation?: boolean | undefined;
320
320
  disableAnimation?: boolean | undefined;
321
321
  } & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string;
322
322
  chevronNext: (slotProps?: ({
323
+ isDisabled?: boolean | undefined;
323
324
  size?: "lg" | "md" | "sm" | undefined;
324
325
  color?: "main" | "neutral" | "critical" | "warning" | "success" | undefined;
325
- radius?: "lg" | "md" | "sm" | "none" | "full" | undefined;
326
+ radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
326
327
  variant?: "light" | undefined;
327
- isDisabled?: boolean | undefined;
328
328
  isCompact?: boolean | undefined;
329
329
  disableCursorAnimation?: boolean | undefined;
330
330
  disableAnimation?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengovsg/oui",
3
- "version": "0.0.23",
3
+ "version": "0.0.25",
4
4
  "sideEffects": false,
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",
@@ -31,10 +31,11 @@
31
31
  "types": "./dist/types/*/index.d.ts",
32
32
  "default": "./dist/cjs/*/index.cjs"
33
33
  }
34
- }
34
+ },
35
+ "./package.json": "./package.json"
35
36
  },
36
37
  "devDependencies": {
37
- "@storybook/react-vite": "9.1.4",
38
+ "@storybook/react-vite": "10.1.2",
38
39
  "@types/lodash-es": "^4.17.12",
39
40
  "@types/prop-types": "^15.7.15",
40
41
  "@types/react": "^19.0.12",
@@ -45,20 +46,22 @@
45
46
  "motion": "^12.18.1",
46
47
  "prettier": "^3.5.3",
47
48
  "react": "^19.0.0",
48
- "react-aria-components": "^1.12.2",
49
- "storybook": "9.1.6",
49
+ "react-aria-components": "^1.13.0",
50
+ "storybook": "10.1.2",
50
51
  "tsx": "^4.20.3",
51
52
  "typescript": "5.7.3",
52
- "@opengovsg/oui-theme": "0.0.23",
53
53
  "@oui/chromatic": "0.0.0",
54
54
  "@oui/eslint-config": "0.0.0",
55
- "@oui/prettier-config": "0.0.0",
56
- "@oui/typescript-config": "0.0.0"
55
+ "@opengovsg/oui-theme": "0.0.25",
56
+ "@oui/typescript-config": "0.0.0",
57
+ "@oui/prettier-config": "0.0.0"
57
58
  },
58
59
  "dependencies": {
59
60
  "@internationalized/date": "^3.9.0",
60
61
  "@react-aria/calendar": "^3.8.3",
61
- "@react-aria/i18n": "^3.12.10",
62
+ "@react-aria/focus": "^3.21.2",
63
+ "@react-aria/i18n": "^3.12.13",
64
+ "@react-aria/interactions": "^3.25.6",
62
65
  "@react-aria/utils": "^3.29.1",
63
66
  "@react-stately/calendar": "^3.8.4",
64
67
  "@react-stately/collections": "^3.12.7",
@@ -84,7 +87,7 @@
84
87
  "motion": ">=11.12.0 || >=12.0.0-alpha.1",
85
88
  "react": ">= 18",
86
89
  "react-aria-components": "^1.12.2",
87
- "@opengovsg/oui-theme": "0.0.23"
90
+ "@opengovsg/oui-theme": "0.0.25"
88
91
  },
89
92
  "scripts": {
90
93
  "build": "tsx ../../tooling/build-scripts/main.ts --dts --clean",
@@ -1,45 +0,0 @@
1
- 'use strict';
2
-
3
- var useFocus = require('../../../../../@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');
4
- var useFocusVisible = require('../../../../../@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');
5
- var useFocusWithin = require('../../../../../@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');
6
- var $670gB$react = require('react');
7
-
8
- function $f7dceffc5ad7768b$export$4e328f61c538687f(props = {}) {
9
- let { autoFocus: autoFocus = false, isTextInput: isTextInput, within: within } = props;
10
- let state = ($670gB$react.useRef)({
11
- isFocused: false,
12
- isFocusVisible: autoFocus || (useFocusVisible.isFocusVisible)()
13
- });
14
- let [isFocused, setFocused] = ($670gB$react.useState)(false);
15
- let [isFocusVisibleState, setFocusVisible] = ($670gB$react.useState)(()=>state.current.isFocused && state.current.isFocusVisible);
16
- let updateState = ($670gB$react.useCallback)(()=>setFocusVisible(state.current.isFocused && state.current.isFocusVisible), []);
17
- let onFocusChange = ($670gB$react.useCallback)((isFocused)=>{
18
- state.current.isFocused = isFocused;
19
- setFocused(isFocused);
20
- updateState();
21
- }, [
22
- updateState
23
- ]);
24
- (useFocusVisible.useFocusVisibleListener)((isFocusVisible)=>{
25
- state.current.isFocusVisible = isFocusVisible;
26
- updateState();
27
- }, [], {
28
- isTextInput: isTextInput
29
- });
30
- let { focusProps: focusProps } = (useFocus.useFocus)({
31
- isDisabled: within,
32
- onFocusChange: onFocusChange
33
- });
34
- let { focusWithinProps: focusWithinProps } = (useFocusWithin.useFocusWithin)({
35
- isDisabled: !within,
36
- onFocusWithinChange: onFocusChange
37
- });
38
- return {
39
- isFocused: isFocused,
40
- isFocusVisible: isFocusVisibleState,
41
- focusProps: within ? focusWithinProps : focusProps
42
- };
43
- }
44
-
45
- exports.useFocusRing = $f7dceffc5ad7768b$export$4e328f61c538687f;
@@ -1,21 +0,0 @@
1
- 'use strict';
2
-
3
- var $670gB$react = require('react');
4
-
5
- /*
6
- * Copyright 2020 Adobe. All rights reserved.
7
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License. You may obtain a copy
9
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software distributed under
12
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
- * OF ANY KIND, either express or implied. See the License for the specific language
14
- * governing permissions and limitations under the License.
15
- */
16
- const $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = ($670gB$react).createContext({
17
- register: ()=>{}
18
- });
19
- $ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = 'PressResponderContext';
20
-
21
- exports.PressResponderContext = $ae1eeba8b9eafd08$export$5165eccb35aaadb5;
@@ -1,72 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('@react-aria/utils');
4
-
5
- /*
6
- * Copyright 2020 Adobe. All rights reserved.
7
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
- * you may not use this file except in compliance with the License. You may obtain a copy
9
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software distributed under
12
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
- * OF ANY KIND, either express or implied. See the License for the specific language
14
- * governing permissions and limitations under the License.
15
- */
16
- // Note that state only matters here for iOS. Non-iOS gets user-select: none applied to the target element
17
- // rather than at the document level so we just need to apply/remove user-select: none for each pressed element individually
18
- let $14c0b72509d70225$var$state = 'default';
19
- let $14c0b72509d70225$var$savedUserSelect = '';
20
- let $14c0b72509d70225$var$modifiedElementMap = new WeakMap();
21
- function $14c0b72509d70225$export$16a4697467175487(target) {
22
- if ((utils.isIOS)()) {
23
- if ($14c0b72509d70225$var$state === 'default') {
24
- const documentObject = (utils.getOwnerDocument)(target);
25
- $14c0b72509d70225$var$savedUserSelect = documentObject.documentElement.style.webkitUserSelect;
26
- documentObject.documentElement.style.webkitUserSelect = 'none';
27
- }
28
- $14c0b72509d70225$var$state = 'disabled';
29
- } else if (target instanceof HTMLElement || target instanceof SVGElement) {
30
- // If not iOS, store the target's original user-select and change to user-select: none
31
- // Ignore state since it doesn't apply for non iOS
32
- let property = 'userSelect' in target.style ? 'userSelect' : 'webkitUserSelect';
33
- $14c0b72509d70225$var$modifiedElementMap.set(target, target.style[property]);
34
- target.style[property] = 'none';
35
- }
36
- }
37
- function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
38
- if ((utils.isIOS)()) {
39
- // If the state is already default, there's nothing to do.
40
- // If it is restoring, then there's no need to queue a second restore.
41
- if ($14c0b72509d70225$var$state !== 'disabled') return;
42
- $14c0b72509d70225$var$state = 'restoring';
43
- // There appears to be a delay on iOS where selection still might occur
44
- // after pointer up, so wait a bit before removing user-select.
45
- setTimeout(()=>{
46
- // Wait for any CSS transitions to complete so we don't recompute style
47
- // for the whole page in the middle of the animation and cause jank.
48
- (utils.runAfterTransition)(()=>{
49
- // Avoid race conditions
50
- if ($14c0b72509d70225$var$state === 'restoring') {
51
- const documentObject = (utils.getOwnerDocument)(target);
52
- if (documentObject.documentElement.style.webkitUserSelect === 'none') documentObject.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || '';
53
- $14c0b72509d70225$var$savedUserSelect = '';
54
- $14c0b72509d70225$var$state = 'default';
55
- }
56
- });
57
- }, 300);
58
- } else if (target instanceof HTMLElement || target instanceof SVGElement) // If not iOS, restore the target's original user-select if any
59
- // Ignore state since it doesn't apply for non iOS
60
- {
61
- if (target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
62
- let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target);
63
- let property = 'userSelect' in target.style ? 'userSelect' : 'webkitUserSelect';
64
- if (target.style[property] === 'none') target.style[property] = targetOldUserSelect;
65
- if (target.getAttribute('style') === '') target.removeAttribute('style');
66
- $14c0b72509d70225$var$modifiedElementMap.delete(target);
67
- }
68
- }
69
- }
70
-
71
- exports.disableTextSelection = $14c0b72509d70225$export$16a4697467175487;
72
- exports.restoreTextSelection = $14c0b72509d70225$export$b0d6fa1ab32e3295;
@@ -1,60 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('./utils.cjs');
4
- var $670gB$react = require('react');
5
- var utils$1 = require('@react-aria/utils');
6
-
7
- /*
8
- * Copyright 2020 Adobe. All rights reserved.
9
- * This file is licensed to you under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License. You may obtain a copy
11
- * of the License at http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software distributed under
14
- * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
15
- * OF ANY KIND, either express or implied. See the License for the specific language
16
- * governing permissions and limitations under the License.
17
- */ // Portions of the code in this file are based on code from react.
18
- // Original licensing for the following can be found in the
19
- // NOTICE file in the root directory of this source tree.
20
- // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
21
-
22
-
23
-
24
- function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
25
- let { isDisabled: isDisabled, onFocus: onFocusProp, onBlur: onBlurProp, onFocusChange: onFocusChange } = props;
26
- const onBlur = ($670gB$react.useCallback)((e)=>{
27
- if (e.target === e.currentTarget) {
28
- if (onBlurProp) onBlurProp(e);
29
- if (onFocusChange) onFocusChange(false);
30
- return true;
31
- }
32
- }, [
33
- onBlurProp,
34
- onFocusChange
35
- ]);
36
- const onSyntheticFocus = (utils.useSyntheticBlurEvent)(onBlur);
37
- const onFocus = ($670gB$react.useCallback)((e)=>{
38
- // Double check that document.activeElement actually matches e.target in case a previously chained
39
- // focus handler already moved focus somewhere else.
40
- const ownerDocument = (utils$1.getOwnerDocument)(e.target);
41
- const activeElement = ownerDocument ? (utils$1.getActiveElement)(ownerDocument) : (utils$1.getActiveElement)();
42
- if (e.target === e.currentTarget && activeElement === (utils$1.getEventTarget)(e.nativeEvent)) {
43
- if (onFocusProp) onFocusProp(e);
44
- if (onFocusChange) onFocusChange(true);
45
- onSyntheticFocus(e);
46
- }
47
- }, [
48
- onFocusChange,
49
- onFocusProp,
50
- onSyntheticFocus
51
- ]);
52
- return {
53
- focusProps: {
54
- onFocus: !isDisabled && (onFocusProp || onFocusChange || onBlurProp) ? onFocus : undefined,
55
- onBlur: !isDisabled && (onBlurProp || onFocusChange) ? onBlur : undefined
56
- }
57
- };
58
- }
59
-
60
- exports.useFocus = $a1ea59d68270f0dd$export$f8168d8dd8fd66e6;