@opengovsg/oui 0.0.0-snapshot-20250812083020 → 0.0.0-snapshot-20250813172831

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 (147) 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 +4 -4
  5. package/dist/cjs/calendar/calendar-bottom-content.cjs +2 -2
  6. package/dist/cjs/calendar/calendar-header.cjs +2 -2
  7. package/dist/cjs/calendar/calendar-month-day-selector.cjs +4 -4
  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-group-style-context.cjs +16 -0
  12. package/dist/cjs/checkbox/checkbox.cjs +94 -0
  13. package/dist/cjs/checkbox/index.cjs +12 -0
  14. package/dist/cjs/combo-box/combo-box-fuzzy.cjs +6 -6
  15. package/dist/cjs/combo-box/combo-box-item.cjs +2 -2
  16. package/dist/cjs/combo-box/combo-box.cjs +4 -4
  17. package/dist/cjs/date-field/date-field.cjs +3 -3
  18. package/dist/cjs/date-picker/date-picker.cjs +3 -3
  19. package/dist/cjs/date-range-picker/date-range-picker.cjs +5 -5
  20. package/dist/cjs/govt-banner/govt-banner.cjs +3 -3
  21. package/dist/cjs/hooks/use-callback-ref.cjs +4 -4
  22. package/dist/cjs/hooks/use-controllable-state.cjs +2 -2
  23. package/dist/cjs/index.cjs +56 -39
  24. package/dist/cjs/input/input.cjs +2 -2
  25. package/dist/cjs/menu/menu.cjs +7 -7
  26. 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 +45 -0
  27. 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 +21 -0
  28. 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 +72 -0
  29. 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 +60 -0
  30. 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 +210 -0
  31. 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 +100 -0
  32. 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 +152 -0
  33. 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 +676 -0
  34. 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 +160 -0
  35. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_check_private_redeclaration.cjs +9 -0
  36. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.cjs +9 -0
  37. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.cjs +16 -0
  38. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.cjs +9 -0
  39. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_get.cjs +11 -0
  40. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_init.cjs +10 -0
  41. package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_set.cjs +12 -0
  42. 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
  43. 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
  44. package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevrons-right.cjs +22 -0
  45. package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/ellipsis.cjs +23 -0
  46. package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.cjs +19 -0
  47. package/dist/cjs/pagination/hooks/use-pagination.cjs +117 -0
  48. package/dist/cjs/pagination/index.cjs +17 -0
  49. package/dist/cjs/pagination/pagination-cursor.cjs +18 -0
  50. package/dist/cjs/pagination/pagination-item.cjs +18 -0
  51. package/dist/cjs/pagination/pagination.cjs +263 -0
  52. package/dist/cjs/pagination/use-pagination-item.cjs +87 -0
  53. package/dist/cjs/pagination/use-pagination.cjs +251 -0
  54. package/dist/cjs/range-calendar/range-calendar.cjs +6 -6
  55. package/dist/cjs/ripple/use-ripple.cjs +4 -4
  56. package/dist/cjs/select/select.cjs +3 -3
  57. package/dist/cjs/spinner/use-spinner.cjs +3 -3
  58. package/dist/cjs/system/react-utils/context.cjs +3 -3
  59. package/dist/cjs/system/react-utils/dom-props.cjs +186 -0
  60. package/dist/cjs/system/react-utils/filter-dom-props.cjs +46 -0
  61. package/dist/cjs/system/react-utils/index.cjs +2 -0
  62. package/dist/cjs/system/react-utils/refs.cjs +3 -3
  63. package/dist/cjs/system/utils.cjs +3 -3
  64. package/dist/cjs/tabs/tabs.cjs +2 -2
  65. package/dist/cjs/tag-field/tag-field-item.cjs +2 -2
  66. package/dist/cjs/tag-field/tag-field-list.cjs +4 -4
  67. package/dist/cjs/tag-field/tag-field-root.cjs +14 -14
  68. package/dist/cjs/tag-field/tag-field-state-context.cjs +2 -2
  69. package/dist/cjs/tag-field/tag-field-tag-list.cjs +3 -3
  70. package/dist/cjs/tag-field/tag-field-trigger.cjs +2 -2
  71. package/dist/cjs/tag-field/tag-field.cjs +4 -4
  72. package/dist/cjs/tag-field/use-tag-field-state.cjs +6 -6
  73. package/dist/cjs/tag-field/use-tag-field.cjs +4 -4
  74. package/dist/cjs/text-area/text-area.cjs +2 -2
  75. package/dist/cjs/toggle/toggle.cjs +3 -3
  76. package/dist/esm/button/button.js +1 -1
  77. package/dist/esm/calendar/calendar-month-day-selector.js +2 -2
  78. package/dist/esm/checkbox/checkbox-group-style-context.js +13 -0
  79. package/dist/esm/checkbox/checkbox.js +91 -0
  80. package/dist/esm/checkbox/index.js +3 -0
  81. package/dist/esm/combo-box/combo-box.js +1 -1
  82. package/dist/esm/date-picker/date-picker.js +1 -1
  83. package/dist/esm/date-range-picker/date-range-picker.js +2 -2
  84. package/dist/esm/index.js +19 -12
  85. package/dist/esm/menu/menu.js +1 -1
  86. 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 +43 -0
  87. 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 +19 -0
  88. 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 +69 -0
  89. 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 +58 -0
  90. 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 +205 -0
  91. 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 +98 -0
  92. 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 +150 -0
  93. 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 +674 -0
  94. 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 +155 -0
  95. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
  96. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js +7 -0
  97. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js +14 -0
  98. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js +7 -0
  99. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_get.js +9 -0
  100. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_init.js +8 -0
  101. package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_set.js +10 -0
  102. package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevrons-right.js +17 -0
  103. package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/ellipsis.js +18 -0
  104. package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.js +14 -0
  105. package/dist/esm/pagination/hooks/use-pagination.js +114 -0
  106. package/dist/esm/pagination/index.js +6 -0
  107. package/dist/esm/pagination/pagination-cursor.js +16 -0
  108. package/dist/esm/pagination/pagination-item.js +16 -0
  109. package/dist/esm/pagination/pagination.js +261 -0
  110. package/dist/esm/pagination/use-pagination-item.js +85 -0
  111. package/dist/esm/pagination/use-pagination.js +248 -0
  112. package/dist/esm/select/select.js +1 -1
  113. package/dist/esm/system/react-utils/dom-props.js +183 -0
  114. package/dist/esm/system/react-utils/filter-dom-props.js +44 -0
  115. package/dist/esm/system/react-utils/index.js +1 -0
  116. package/dist/esm/tag-field/tag-field.js +2 -2
  117. package/dist/types/checkbox/checkbox-group-style-context.d.ts +6 -0
  118. package/dist/types/checkbox/checkbox-group-style-context.d.ts.map +1 -0
  119. package/dist/types/checkbox/checkbox.d.ts +19 -0
  120. package/dist/types/checkbox/checkbox.d.ts.map +1 -0
  121. package/dist/types/checkbox/index.d.ts +3 -0
  122. package/dist/types/checkbox/index.d.ts.map +1 -0
  123. package/dist/types/index.d.mts +2 -0
  124. package/dist/types/index.d.ts +2 -0
  125. package/dist/types/index.d.ts.map +1 -1
  126. package/dist/types/pagination/hooks/use-pagination.d.ts +51 -0
  127. package/dist/types/pagination/hooks/use-pagination.d.ts.map +1 -0
  128. package/dist/types/pagination/index.d.ts +7 -0
  129. package/dist/types/pagination/index.d.ts.map +1 -0
  130. package/dist/types/pagination/pagination-cursor.d.ts +9 -0
  131. package/dist/types/pagination/pagination-cursor.d.ts.map +1 -0
  132. package/dist/types/pagination/pagination-item.d.ts +5 -0
  133. package/dist/types/pagination/pagination-item.d.ts.map +1 -0
  134. package/dist/types/pagination/pagination.d.ts +5 -0
  135. package/dist/types/pagination/pagination.d.ts.map +1 -0
  136. package/dist/types/pagination/use-pagination-item.d.ts +51 -0
  137. package/dist/types/pagination/use-pagination-item.d.ts.map +1 -0
  138. package/dist/types/pagination/use-pagination.d.ts +353 -0
  139. package/dist/types/pagination/use-pagination.d.ts.map +1 -0
  140. package/dist/types/system/react-utils/context.d.ts.map +1 -1
  141. package/dist/types/system/react-utils/dom-props.d.ts +3 -0
  142. package/dist/types/system/react-utils/dom-props.d.ts.map +1 -0
  143. package/dist/types/system/react-utils/filter-dom-props.d.ts +39 -0
  144. package/dist/types/system/react-utils/filter-dom-props.d.ts.map +1 -0
  145. package/dist/types/system/react-utils/index.d.ts +1 -0
  146. package/dist/types/system/react-utils/index.d.ts.map +1 -1
  147. package/package.json +8 -6
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  'use strict';
3
3
 
4
+ var textArea = require('./text-area/text-area.cjs');
5
+ var textAreaField = require('./text-area-field/text-area-field.cjs');
4
6
  var useControllableState = require('./hooks/use-controllable-state.cjs');
7
+ var button = require('./button/button.cjs');
5
8
  var govtBanner = require('./govt-banner/govt-banner.cjs');
6
9
  var ripple = require('./ripple/ripple.cjs');
7
10
  var useRipple = require('./ripple/use-ripple.cjs');
@@ -11,36 +14,43 @@ var toggle = require('./toggle/toggle.cjs');
11
14
  var skipNavLink = require('./skip-nav-link/skip-nav-link.cjs');
12
15
  var input = require('./input/input.cjs');
13
16
  var textField = require('./text-field/text-field.cjs');
14
- var textArea = require('./text-area/text-area.cjs');
15
- var textAreaField = require('./text-area-field/text-area-field.cjs');
16
- var tagField = require('./tag-field/tag-field.cjs');
17
- var tagFieldItem = require('./tag-field/tag-field-item.cjs');
18
- var select = require('./select/select.cjs');
19
- var selectItem = require('./select/select-item.cjs');
20
- var selectVariantContext = require('./select/select-variant-context.cjs');
21
- var rangeCalendar = require('./range-calendar/range-calendar.cjs');
22
- var menu = require('./menu/menu.cjs');
23
- var popover = require('./popover/popover.cjs');
24
- var tabs = require('./tabs/tabs.cjs');
25
- var button = require('./button/button.cjs');
26
17
  var field = require('./field/field.cjs');
27
18
  var comboBox = require('./combo-box/combo-box.cjs');
28
19
  var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
29
20
  var comboBoxItem = require('./combo-box/combo-box-item.cjs');
30
21
  var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
31
22
  var banner = require('./banner/banner.cjs');
23
+ var tagField = require('./tag-field/tag-field.cjs');
24
+ var tagFieldItem = require('./tag-field/tag-field-item.cjs');
25
+ var select = require('./select/select.cjs');
26
+ var selectItem = require('./select/select-item.cjs');
27
+ var selectVariantContext = require('./select/select-variant-context.cjs');
32
28
  var badge = require('./badge/badge.cjs');
33
29
  var date = require('@internationalized/date');
34
30
  var calendar = require('./calendar/calendar.cjs');
35
31
  var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
36
32
  var utils = require('./calendar/utils.cjs');
33
+ var rangeCalendar = require('./range-calendar/range-calendar.cjs');
34
+ var menu = require('./menu/menu.cjs');
35
+ var popover = require('./popover/popover.cjs');
36
+ var tabs = require('./tabs/tabs.cjs');
37
37
  var dateField = require('./date-field/date-field.cjs');
38
38
  var datePicker = require('./date-picker/date-picker.cjs');
39
39
  var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
40
+ var checkbox = require('./checkbox/checkbox.cjs');
41
+ var checkboxGroupStyleContext = require('./checkbox/checkbox-group-style-context.cjs');
42
+ var usePagination = require('./pagination/hooks/use-pagination.cjs');
43
+ var pagination = require('./pagination/pagination.cjs');
44
+ var paginationCursor = require('./pagination/pagination-cursor.cjs');
45
+ var paginationItem = require('./pagination/pagination-item.cjs');
46
+ var usePagination$1 = require('./pagination/use-pagination.cjs');
40
47
 
41
48
 
42
49
 
50
+ exports.TextArea = textArea.TextArea;
51
+ exports.TextAreaField = textAreaField.TextAreaField;
43
52
  exports.useControllableState = useControllableState.useControllableState;
53
+ exports.Button = button.Button;
44
54
  exports.GovtBanner = govtBanner.GovtBanner;
45
55
  exports.Ripple = ripple.Ripple;
46
56
  exports.useRipple = useRipple.useRipple;
@@ -50,33 +60,6 @@ exports.Toggle = toggle.Toggle;
50
60
  exports.SkipNavLink = skipNavLink.SkipNavLink;
51
61
  exports.Input = input.Input;
52
62
  exports.TextField = textField.TextField;
53
- exports.TextArea = textArea.TextArea;
54
- exports.TextAreaField = textAreaField.TextAreaField;
55
- exports.TagField = tagField.TagField;
56
- exports.TagFieldItem = tagFieldItem.TagFieldItem;
57
- exports.Select = select.Select;
58
- exports.SelectItem = selectItem.SelectItem;
59
- exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
60
- exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
61
- exports.RangeCalendar = rangeCalendar.RangeCalendar;
62
- exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
63
- exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
64
- exports.Menu = menu.Menu;
65
- exports.MenuItem = menu.MenuItem;
66
- exports.MenuSection = menu.MenuSection;
67
- exports.MenuSeparator = menu.MenuSeparator;
68
- exports.MenuTrigger = menu.MenuTrigger;
69
- exports.MenuVariantContext = menu.MenuVariantContext;
70
- exports.SubmenuTrigger = menu.SubmenuTrigger;
71
- exports.useMenuVariantContext = menu.useMenuVariantContext;
72
- exports.Popover = popover.Popover;
73
- exports.Tab = tabs.Tab;
74
- exports.TabList = tabs.TabList;
75
- exports.TabPanel = tabs.TabPanel;
76
- exports.Tabs = tabs.Tabs;
77
- exports.TabsVariantContext = tabs.TabsVariantContext;
78
- exports.useTabsVariantContext = tabs.useTabsVariantContext;
79
- exports.Button = button.Button;
80
63
  exports.Description = field.Description;
81
64
  exports.FieldError = field.FieldError;
82
65
  exports.FieldGroup = field.FieldGroup;
@@ -88,6 +71,12 @@ exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
88
71
  exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
89
72
  exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
90
73
  exports.Banner = banner.Banner;
74
+ exports.TagField = tagField.TagField;
75
+ exports.TagFieldItem = tagFieldItem.TagFieldItem;
76
+ exports.Select = select.Select;
77
+ exports.SelectItem = selectItem.SelectItem;
78
+ exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
79
+ exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
91
80
  exports.Badge = badge.Badge;
92
81
  Object.defineProperty(exports, "CalendarDate", {
93
82
  enumerable: true,
@@ -101,7 +90,35 @@ exports.getEraFormat = utils.getEraFormat;
101
90
  exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
102
91
  exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
103
92
  exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
93
+ exports.RangeCalendar = rangeCalendar.RangeCalendar;
94
+ exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
95
+ exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
96
+ exports.Menu = menu.Menu;
97
+ exports.MenuItem = menu.MenuItem;
98
+ exports.MenuSection = menu.MenuSection;
99
+ exports.MenuSeparator = menu.MenuSeparator;
100
+ exports.MenuTrigger = menu.MenuTrigger;
101
+ exports.MenuVariantContext = menu.MenuVariantContext;
102
+ exports.SubmenuTrigger = menu.SubmenuTrigger;
103
+ exports.useMenuVariantContext = menu.useMenuVariantContext;
104
+ exports.Popover = popover.Popover;
105
+ exports.Tab = tabs.Tab;
106
+ exports.TabList = tabs.TabList;
107
+ exports.TabPanel = tabs.TabPanel;
108
+ exports.Tabs = tabs.Tabs;
109
+ exports.TabsVariantContext = tabs.TabsVariantContext;
110
+ exports.useTabsVariantContext = tabs.useTabsVariantContext;
104
111
  exports.DateField = dateField.DateField;
105
112
  exports.DateInput = dateField.DateInput;
106
113
  exports.DatePicker = datePicker.DatePicker;
107
114
  exports.DateRangePicker = dateRangePicker.DateRangePicker;
115
+ exports.Checkbox = checkbox.Checkbox;
116
+ exports.CheckboxGroup = checkbox.CheckboxGroup;
117
+ exports.CheckboxGroupStyleContext = checkboxGroupStyleContext.CheckboxGroupStyleContext;
118
+ exports.useCheckboxGroupStyleContext = checkboxGroupStyleContext.useCheckboxGroupStyleContext;
119
+ exports.PaginationItemType = usePagination.PaginationItemType;
120
+ exports.Pagination = pagination.Pagination;
121
+ exports.PaginationCursor = paginationCursor.PaginationCursor;
122
+ exports.PaginationItem = paginationItem.PaginationItem;
123
+ exports.CURSOR_TRANSITION_TIMEOUT = usePagination$1.CURSOR_TRANSITION_TIMEOUT;
124
+ exports.usePagination = usePagination$1.usePagination;
@@ -3,11 +3,11 @@
3
3
  'use strict';
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
6
+ var $670gB$react = require('react');
7
7
  var reactAriaComponents = require('react-aria-components');
8
8
  var ouiTheme = require('@opengovsg/oui-theme');
9
9
 
10
- const Input = react.forwardRef(
10
+ const Input = $670gB$react.forwardRef(
11
11
  ({ size, variant, isDisabled, ...props }, ref) => {
12
12
  return /* @__PURE__ */ jsxRuntime.jsx(
13
13
  reactAriaComponents.Input,
@@ -3,14 +3,14 @@
3
3
  'use strict';
4
4
 
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
- var react = require('react');
6
+ var $670gB$react = require('react');
7
7
  var reactAriaComponents = require('react-aria-components');
8
8
  var ouiTheme = require('@opengovsg/oui-theme');
9
- var popover = require('../popover/popover.cjs');
10
9
  var utils = require('../system/utils.cjs');
11
10
  var check = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.cjs');
12
11
  var chevronRight = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs');
13
12
  var context = require('../system/react-utils/context.cjs');
13
+ var popover = require('../popover/popover.cjs');
14
14
 
15
15
  const [MenuVariantContext, useMenuVariantContext] = context.createContext({
16
16
  name: "MenuVariantContext",
@@ -51,7 +51,7 @@ function MenuInner(originalProps, ref) {
51
51
  ) });
52
52
  }
53
53
  const Menu = utils.forwardRefGeneric(MenuInner);
54
- const MenuItem = react.forwardRef(function MenuItem2(originalProps, ref) {
54
+ const MenuItem = $670gB$react.forwardRef(function MenuItem2(originalProps, ref) {
55
55
  [originalProps, ref] = reactAriaComponents.useContextProps(
56
56
  originalProps,
57
57
  ref,
@@ -70,7 +70,7 @@ const MenuItem = 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 = react.useMemo(() => {
73
+ const multipleSelectionIcon = $670gB$react.useMemo(() => {
74
74
  if (multipleSelectionIconProp !== void 0) {
75
75
  return multipleSelectionIconProp;
76
76
  }
@@ -82,7 +82,7 @@ const MenuItem = react.forwardRef(function MenuItem2(originalProps, ref) {
82
82
  }
83
83
  );
84
84
  }, [classNames?.icon, multipleSelectionIconProp, styles]);
85
- const singleSelectionIcon = react.useMemo(() => {
85
+ const singleSelectionIcon = $670gB$react.useMemo(() => {
86
86
  if (singleSelectionIconProp !== void 0) {
87
87
  return singleSelectionIconProp;
88
88
  }
@@ -94,7 +94,7 @@ const MenuItem = react.forwardRef(function MenuItem2(originalProps, ref) {
94
94
  }
95
95
  );
96
96
  }, [classNames?.icon, singleSelectionIconProp, styles]);
97
- const showIconContainer = react.useCallback(
97
+ const showIconContainer = $670gB$react.useCallback(
98
98
  (selectionMode) => {
99
99
  switch (selectionMode) {
100
100
  case "none":
@@ -107,7 +107,7 @@ const MenuItem = react.forwardRef(function MenuItem2(originalProps, ref) {
107
107
  },
108
108
  [multipleSelectionIcon, singleSelectionIcon]
109
109
  );
110
- const defaultTextValue = react.useMemo(() => {
110
+ const defaultTextValue = $670gB$react.useMemo(() => {
111
111
  if (props.textValue) {
112
112
  return props.textValue;
113
113
  }
@@ -0,0 +1,45 @@
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;
@@ -0,0 +1,21 @@
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;
@@ -0,0 +1,72 @@
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;
@@ -0,0 +1,60 @@
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;
@@ -0,0 +1,210 @@
1
+ 'use strict';
2
+
3
+ var utils$1 = require('./utils.cjs');
4
+ var utils = require('@react-aria/utils');
5
+ var $670gB$react = require('react');
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
+
25
+ let $507fabe10e71c6fb$var$currentModality = null;
26
+ let $507fabe10e71c6fb$var$changeHandlers = new Set();
27
+ let $507fabe10e71c6fb$export$d90243b58daecda7 = new Map(); // We use a map here to support setting event listeners across multiple document objects.
28
+ let $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
29
+ let $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
30
+ // Only Tab or Esc keys will make focus visible on text input elements
31
+ const $507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS = {
32
+ Tab: true,
33
+ Escape: true
34
+ };
35
+ function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
36
+ for (let handler of $507fabe10e71c6fb$var$changeHandlers)handler(modality, e);
37
+ }
38
+ /**
39
+ * Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus styles visible.
40
+ */ function $507fabe10e71c6fb$var$isValidKey(e) {
41
+ // Control and Shift keys trigger when navigating back to the tab with keyboard.
42
+ return !(e.metaKey || !(utils.isMac)() && e.altKey || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta');
43
+ }
44
+ function $507fabe10e71c6fb$var$handleKeyboardEvent(e) {
45
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
46
+ if ($507fabe10e71c6fb$var$isValidKey(e)) {
47
+ $507fabe10e71c6fb$var$currentModality = 'keyboard';
48
+ $507fabe10e71c6fb$var$triggerChangeHandlers('keyboard', e);
49
+ }
50
+ }
51
+ function $507fabe10e71c6fb$var$handlePointerEvent(e) {
52
+ $507fabe10e71c6fb$var$currentModality = 'pointer';
53
+ if (e.type === 'mousedown' || e.type === 'pointerdown') {
54
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
55
+ $507fabe10e71c6fb$var$triggerChangeHandlers('pointer', e);
56
+ }
57
+ }
58
+ function $507fabe10e71c6fb$var$handleClickEvent(e) {
59
+ if ((utils.isVirtualClick)(e)) {
60
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
61
+ $507fabe10e71c6fb$var$currentModality = 'virtual';
62
+ }
63
+ }
64
+ function $507fabe10e71c6fb$var$handleFocusEvent(e) {
65
+ // Firefox fires two extra focus events when the user first clicks into an iframe:
66
+ // first on the window, then on the document. We ignore these events so they don't
67
+ // cause keyboard focus rings to appear.
68
+ if (e.target === window || e.target === document || (utils$1.ignoreFocusEvent) || !e.isTrusted) return;
69
+ // If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.
70
+ // This occurs, for example, when navigating a form with the next/previous buttons on iOS.
71
+ if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
72
+ $507fabe10e71c6fb$var$currentModality = 'virtual';
73
+ $507fabe10e71c6fb$var$triggerChangeHandlers('virtual', e);
74
+ }
75
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
76
+ $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
77
+ }
78
+ function $507fabe10e71c6fb$var$handleWindowBlur() {
79
+ if (utils$1.ignoreFocusEvent) return;
80
+ // When the window is blurred, reset state. This is necessary when tabbing out of the window,
81
+ // for example, since a subsequent focus event won't be fired.
82
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
83
+ $507fabe10e71c6fb$var$hasBlurredWindowRecently = true;
84
+ }
85
+ /**
86
+ * Setup global event listeners to control when keyboard focus style should be visible.
87
+ */ function $507fabe10e71c6fb$var$setupGlobalFocusEvents(element) {
88
+ if (typeof window === 'undefined' || typeof document === 'undefined' || $507fabe10e71c6fb$export$d90243b58daecda7.get((utils.getOwnerWindow)(element))) return;
89
+ const windowObject = (utils.getOwnerWindow)(element);
90
+ const documentObject = (utils.getOwnerDocument)(element);
91
+ // Programmatic focus() calls shouldn't affect the current input modality.
92
+ // However, we need to detect other cases when a focus event occurs without
93
+ // a preceding user event (e.g. screen reader focus). Overriding the focus
94
+ // method on HTMLElement.prototype is a bit hacky, but works.
95
+ let focus = windowObject.HTMLElement.prototype.focus;
96
+ windowObject.HTMLElement.prototype.focus = function() {
97
+ $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
98
+ focus.apply(this, arguments);
99
+ };
100
+ documentObject.addEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
101
+ documentObject.addEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
102
+ documentObject.addEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
103
+ // Register focus events on the window so they are sure to happen
104
+ // before React's event listeners (registered on the document).
105
+ windowObject.addEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
106
+ windowObject.addEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
107
+ if (typeof PointerEvent !== 'undefined') {
108
+ documentObject.addEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
109
+ documentObject.addEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
110
+ documentObject.addEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
111
+ } else if (process.env.NODE_ENV === 'test') {
112
+ documentObject.addEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
113
+ documentObject.addEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
114
+ documentObject.addEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
115
+ }
116
+ // Add unmount handler
117
+ windowObject.addEventListener('beforeunload', ()=>{
118
+ $507fabe10e71c6fb$var$tearDownWindowFocusTracking(element);
119
+ }, {
120
+ once: true
121
+ });
122
+ $507fabe10e71c6fb$export$d90243b58daecda7.set(windowObject, {
123
+ focus: focus
124
+ });
125
+ }
126
+ const $507fabe10e71c6fb$var$tearDownWindowFocusTracking = (element, loadListener)=>{
127
+ const windowObject = (utils.getOwnerWindow)(element);
128
+ const documentObject = (utils.getOwnerDocument)(element);
129
+ if (loadListener) documentObject.removeEventListener('DOMContentLoaded', loadListener);
130
+ if (!$507fabe10e71c6fb$export$d90243b58daecda7.has(windowObject)) return;
131
+ windowObject.HTMLElement.prototype.focus = $507fabe10e71c6fb$export$d90243b58daecda7.get(windowObject).focus;
132
+ documentObject.removeEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
133
+ documentObject.removeEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
134
+ documentObject.removeEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
135
+ windowObject.removeEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
136
+ windowObject.removeEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
137
+ if (typeof PointerEvent !== 'undefined') {
138
+ documentObject.removeEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
139
+ documentObject.removeEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
140
+ documentObject.removeEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
141
+ } else if (process.env.NODE_ENV === 'test') {
142
+ documentObject.removeEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
143
+ documentObject.removeEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
144
+ documentObject.removeEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
145
+ }
146
+ $507fabe10e71c6fb$export$d90243b58daecda7.delete(windowObject);
147
+ };
148
+ function $507fabe10e71c6fb$export$2f1888112f558a7d(element) {
149
+ const documentObject = (utils.getOwnerDocument)(element);
150
+ let loadListener;
151
+ if (documentObject.readyState !== 'loading') $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
152
+ else {
153
+ loadListener = ()=>{
154
+ $507fabe10e71c6fb$var$setupGlobalFocusEvents(element);
155
+ };
156
+ documentObject.addEventListener('DOMContentLoaded', loadListener);
157
+ }
158
+ return ()=>$507fabe10e71c6fb$var$tearDownWindowFocusTracking(element, loadListener);
159
+ }
160
+ // Server-side rendering does not have the document object defined
161
+ // eslint-disable-next-line no-restricted-globals
162
+ if (typeof document !== 'undefined') $507fabe10e71c6fb$export$2f1888112f558a7d();
163
+ function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
164
+ return $507fabe10e71c6fb$var$currentModality !== 'pointer';
165
+ }
166
+ const $507fabe10e71c6fb$var$nonTextInputTypes = new Set([
167
+ 'checkbox',
168
+ 'radio',
169
+ 'range',
170
+ 'color',
171
+ 'file',
172
+ 'image',
173
+ 'button',
174
+ 'submit',
175
+ 'reset'
176
+ ]);
177
+ /**
178
+ * If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that
179
+ * focus visible style can be properly set.
180
+ */ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
181
+ let document1 = (utils.getOwnerDocument)(e === null || e === void 0 ? void 0 : e.target);
182
+ const IHTMLInputElement = typeof window !== 'undefined' ? (utils.getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).HTMLInputElement : HTMLInputElement;
183
+ const IHTMLTextAreaElement = typeof window !== 'undefined' ? (utils.getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).HTMLTextAreaElement : HTMLTextAreaElement;
184
+ const IHTMLElement = typeof window !== 'undefined' ? (utils.getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).HTMLElement : HTMLElement;
185
+ const IKeyboardEvent = typeof window !== 'undefined' ? (utils.getOwnerWindow)(e === null || e === void 0 ? void 0 : e.target).KeyboardEvent : KeyboardEvent;
186
+ // For keyboard events that occur on a non-input element that will move focus into input element (aka ArrowLeft going from Datepicker button to the main input group)
187
+ // we need to rely on the user passing isTextInput into here. This way we can skip toggling focus visiblity for said input element
188
+ isTextInput = isTextInput || document1.activeElement instanceof IHTMLInputElement && !$507fabe10e71c6fb$var$nonTextInputTypes.has(document1.activeElement.type) || document1.activeElement instanceof IHTMLTextAreaElement || document1.activeElement instanceof IHTMLElement && document1.activeElement.isContentEditable;
189
+ return !(isTextInput && modality === 'keyboard' && e instanceof IKeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
190
+ }
191
+ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
192
+ $507fabe10e71c6fb$var$setupGlobalFocusEvents();
193
+ ($670gB$react.useEffect)(()=>{
194
+ let handler = (modality, e)=>{
195
+ // We want to early return for any keyboard events that occur inside text inputs EXCEPT for Tab and Escape
196
+ if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e)) return;
197
+ fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
198
+ };
199
+ $507fabe10e71c6fb$var$changeHandlers.add(handler);
200
+ return ()=>{
201
+ $507fabe10e71c6fb$var$changeHandlers.delete(handler);
202
+ };
203
+ // eslint-disable-next-line react-hooks/exhaustive-deps
204
+ }, deps);
205
+ }
206
+
207
+ exports.addWindowFocusTracking = $507fabe10e71c6fb$export$2f1888112f558a7d;
208
+ exports.hasSetupGlobalListeners = $507fabe10e71c6fb$export$d90243b58daecda7;
209
+ exports.isFocusVisible = $507fabe10e71c6fb$export$b9b3dfddab17db27;
210
+ exports.useFocusVisibleListener = $507fabe10e71c6fb$export$ec71b4b83ac08ec3;