@opengovsg/oui 0.0.22 → 0.0.24
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 +4 -4
- 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 +4 -4
- package/dist/cjs/date-picker/date-picker.cjs +4 -4
- package/dist/cjs/date-range-picker/date-range-picker.cjs +6 -6
- package/dist/cjs/field/field.cjs +2 -2
- package/dist/cjs/file-dropzone/file-dropzone.cjs +12 -12
- package/dist/cjs/file-dropzone/file-info.cjs +3 -3
- 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 +49 -47
- 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/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 +2 -2
- package/dist/esm/checkbox/checkbox.js +1 -1
- package/dist/esm/combo-box/combo-box.js +2 -2
- package/dist/esm/date-field/date-field.js +1 -1
- package/dist/esm/date-picker/date-picker.js +2 -2
- package/dist/esm/date-range-picker/date-range-picker.js +3 -3
- package/dist/esm/file-dropzone/file-dropzone.js +2 -2
- package/dist/esm/index.js +18 -17
- 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/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/index.d.mts +1 -0
- package/dist/types/index.d.ts +1 -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 +11 -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
|
@@ -5,13 +5,13 @@ import { useMemo, useCallback } from 'react';
|
|
|
5
5
|
import { useMessageFormatter } from 'react-aria';
|
|
6
6
|
import { ListLayout, Provider, ComboBox as ComboBox$1, Input, Button, Virtualizer, ListBox } from 'react-aria-components';
|
|
7
7
|
import { listBoxItemStyles, cn, comboBoxStyles, composeTailwindRenderProps, composeRenderProps, comboBoxClearButtonStyles } from '@opengovsg/oui-theme';
|
|
8
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
9
|
+
import { Popover } from '../popover/popover.js';
|
|
8
10
|
import { mapPropsVariants } from '../system/utils.js';
|
|
9
11
|
import { ComboBoxVariantContext } from './combo-box-variant-context.js';
|
|
10
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
11
12
|
import ChevronUp from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-up.js';
|
|
12
13
|
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
13
14
|
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
14
|
-
import { Popover } from '../popover/popover.js';
|
|
15
15
|
|
|
16
16
|
const calculateEstimatedRowHeight = (size) => {
|
|
17
17
|
switch (size) {
|
|
@@ -4,8 +4,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { DateField as DateField$1, DateInput as DateInput$1, DateSegment } from 'react-aria-components';
|
|
6
6
|
import { dateFieldStyles, composeTailwindRenderProps, dateInputStyles, composeRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
-
import { mapPropsVariants } from '../system/utils.js';
|
|
8
7
|
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
|
+
import { mapPropsVariants } from '../system/utils.js';
|
|
9
9
|
|
|
10
10
|
function DateField(originalProps) {
|
|
11
11
|
const [
|
|
@@ -4,13 +4,13 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { DatePicker as DatePicker$1, Dialog } from 'react-aria-components';
|
|
6
6
|
import { datePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
8
|
+
import { Popover } from '../popover/popover.js';
|
|
7
9
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
10
|
import { DateInput } from '../date-field/date-field.js';
|
|
9
11
|
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
10
12
|
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
11
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
13
|
import { Button } from '../button/button.js';
|
|
13
|
-
import { Popover } from '../popover/popover.js';
|
|
14
14
|
|
|
15
15
|
function DatePicker(originalProps) {
|
|
16
16
|
const [
|
|
@@ -5,13 +5,13 @@ import { useMemo } from 'react';
|
|
|
5
5
|
import { CalendarDate } from '@internationalized/date';
|
|
6
6
|
import { DateRangePicker as DateRangePicker$1, Dialog } from 'react-aria-components';
|
|
7
7
|
import { dateRangePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
8
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
9
|
+
import { Popover } from '../popover/popover.js';
|
|
10
|
+
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
8
11
|
import { mapPropsVariants } from '../system/utils.js';
|
|
9
12
|
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
10
|
-
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
11
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
13
|
import { DateInput } from '../date-field/date-field.js';
|
|
13
14
|
import { Button } from '../button/button.js';
|
|
14
|
-
import { Popover } from '../popover/popover.js';
|
|
15
15
|
|
|
16
16
|
function DateRangePicker(originalProps) {
|
|
17
17
|
const [
|
|
@@ -7,13 +7,13 @@ import { useField, useId } from 'react-aria';
|
|
|
7
7
|
import { Provider, LabelContext, GroupContext, TextContext, FieldErrorContext, Group } from 'react-aria-components';
|
|
8
8
|
import { useDropzone } from 'react-dropzone';
|
|
9
9
|
import { fileDropzoneStyles, dataAttr } from '@opengovsg/oui-theme';
|
|
10
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
11
|
+
import { useControllableState } from '../hooks/use-controllable-state.js';
|
|
10
12
|
import { mapPropsVariants } from '../system/utils.js';
|
|
11
13
|
import { FileDropzoneStyleContext, FileDropzoneStateContext, useFileDropzoneStateContext, useFileDropzoneStyleContext } from './contexts.js';
|
|
12
14
|
import { FileInfo } from './file-info.js';
|
|
13
15
|
import { formatErrorMessage, formatBytes } from './utils.js';
|
|
14
|
-
import { useControllableState } from '../hooks/use-controllable-state.js';
|
|
15
16
|
import Upload from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/upload.js';
|
|
16
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
17
17
|
|
|
18
18
|
const FileDropzone = (originalProps) => {
|
|
19
19
|
const [props, variantProps] = mapPropsVariants(
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
export { useControllableState } from './hooks/use-controllable-state.js';
|
|
3
|
-
export { Button } from './button/button.js';
|
|
4
3
|
export { GovtBanner } from './govt-banner/govt-banner.js';
|
|
5
4
|
export { Ripple } from './ripple/ripple.js';
|
|
6
5
|
export { useRipple } from './ripple/use-ripple.js';
|
|
@@ -13,35 +12,37 @@ export { TextField } from './text-field/text-field.js';
|
|
|
13
12
|
export { Description, FieldError, FieldErrorIcon, FieldGroup, Label } from './field/field.js';
|
|
14
13
|
export { TextArea } from './text-area/text-area.js';
|
|
15
14
|
export { TextAreaField } from './text-area-field/text-area-field.js';
|
|
16
|
-
export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
17
|
-
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
18
|
-
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
19
|
-
export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
|
|
20
|
-
export { Banner } from './banner/banner.js';
|
|
21
15
|
export { TagField } from './tag-field/tag-field.js';
|
|
22
16
|
export { TagFieldItem } from './tag-field/tag-field-item.js';
|
|
23
17
|
export { Select } from './select/select.js';
|
|
24
18
|
export { SelectItem } from './select/select-item.js';
|
|
25
19
|
export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
|
|
26
|
-
export { Badge } from './badge/badge.js';
|
|
27
|
-
export { CalendarDate } from '@internationalized/date';
|
|
28
|
-
export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
29
|
-
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
30
|
-
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
31
20
|
export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
|
|
32
21
|
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
|
|
33
22
|
export { Popover } from './popover/popover.js';
|
|
34
23
|
export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext } from './tabs/tabs.js';
|
|
35
|
-
export { DateField, DateInput } from './date-field/date-field.js';
|
|
36
|
-
export { DatePicker } from './date-picker/date-picker.js';
|
|
37
|
-
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
38
|
-
export { Checkbox, CheckboxGroup } from './checkbox/checkbox.js';
|
|
39
|
-
export { CheckboxGroupStyleContext, useCheckboxGroupStyleContext } from './checkbox/checkbox-group-style-context.js';
|
|
40
|
-
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
41
24
|
export { Pagination } from './pagination/pagination.js';
|
|
42
25
|
export { PaginationCursor } from './pagination/pagination-cursor.js';
|
|
43
26
|
export { PaginationItem } from './pagination/pagination-item.js';
|
|
27
|
+
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
44
28
|
export { CURSOR_TRANSITION_TIMEOUT, usePagination } from './pagination/use-pagination.js';
|
|
45
29
|
export { FileDropzone } from './file-dropzone/file-dropzone.js';
|
|
46
30
|
export { FileInfo } from './file-dropzone/file-info.js';
|
|
47
31
|
export { formatBytes, formatErrorMessage } from './file-dropzone/utils.js';
|
|
32
|
+
export { NumberField } from './number-field/number-field.js';
|
|
33
|
+
export { Button } from './button/button.js';
|
|
34
|
+
export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
35
|
+
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
36
|
+
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
37
|
+
export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
|
|
38
|
+
export { Banner } from './banner/banner.js';
|
|
39
|
+
export { Badge } from './badge/badge.js';
|
|
40
|
+
export { CalendarDate } from '@internationalized/date';
|
|
41
|
+
export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
42
|
+
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
43
|
+
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
44
|
+
export { DateField, DateInput } from './date-field/date-field.js';
|
|
45
|
+
export { DatePicker } from './date-picker/date-picker.js';
|
|
46
|
+
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
47
|
+
export { Checkbox, CheckboxGroup } from './checkbox/checkbox.js';
|
|
48
|
+
export { CheckboxGroupStyleContext, useCheckboxGroupStyleContext } from './checkbox/checkbox-group-style-context.js';
|
package/dist/esm/menu/menu.js
CHANGED
|
@@ -4,11 +4,11 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
4
4
|
import { forwardRef, useMemo, useCallback } from 'react';
|
|
5
5
|
import { useContextProps, MenuItem as MenuItem$1, composeRenderProps, Provider, Menu as Menu$1, MenuSection as MenuSection$1, Header, Collection, MenuTrigger as MenuTrigger$1, SubmenuTrigger as SubmenuTrigger$1, Separator } from 'react-aria-components';
|
|
6
6
|
import { listBoxItemStyles, menuItemStyles, menuStyles, menuSectionStyles, menuDividerStyles } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Popover } from '../popover/popover.js';
|
|
7
8
|
import { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
|
|
8
9
|
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.js';
|
|
9
10
|
import ChevronRight from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-right.js';
|
|
10
11
|
import { createContext } from '../system/react-utils/context.js';
|
|
11
|
-
import { Popover } from '../popover/popover.js';
|
|
12
12
|
|
|
13
13
|
const [MenuVariantContext, useMenuVariantContext] = createContext({
|
|
14
14
|
name: "MenuVariantContext",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import createLucideIcon from '../createLucideIcon.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @license lucide-react v0.475.0 - ISC
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the ISC license.
|
|
7
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const __iconNode = [
|
|
12
|
+
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
13
|
+
["path", { d: "M12 5v14", key: "s699le" }]
|
|
14
|
+
];
|
|
15
|
+
const Plus = createLucideIcon("Plus", __iconNode);
|
|
16
|
+
|
|
17
|
+
export { __iconNode, Plus as default };
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { NumberField as NumberField$1 } from 'react-aria-components';
|
|
5
|
+
import { numberFieldStyles, composeTailwindRenderProps, dataAttr, fieldBorderStyles, cn } from '@opengovsg/oui-theme';
|
|
6
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
7
|
+
import { Input } from '../input/input.js';
|
|
8
|
+
import { mapPropsVariants } from '../system/utils.js';
|
|
9
|
+
import Minus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.js';
|
|
10
|
+
import Plus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/plus.js';
|
|
11
|
+
import { Button } from '../button/button.js';
|
|
12
|
+
|
|
13
|
+
function NumberField(originalProps) {
|
|
14
|
+
const [
|
|
15
|
+
{
|
|
16
|
+
label,
|
|
17
|
+
description,
|
|
18
|
+
errorMessage,
|
|
19
|
+
classNames,
|
|
20
|
+
inputProps,
|
|
21
|
+
startContent,
|
|
22
|
+
endContent,
|
|
23
|
+
hideSteppers,
|
|
24
|
+
...props
|
|
25
|
+
},
|
|
26
|
+
variantProps
|
|
27
|
+
] = mapPropsVariants(originalProps, numberFieldStyles.variantKeys);
|
|
28
|
+
const styles = numberFieldStyles(variantProps);
|
|
29
|
+
return /* @__PURE__ */ jsxs(
|
|
30
|
+
NumberField$1,
|
|
31
|
+
{
|
|
32
|
+
...props,
|
|
33
|
+
"data-hide-steppers": dataAttr(!!hideSteppers),
|
|
34
|
+
"data-has-start-content": dataAttr(!!startContent),
|
|
35
|
+
"data-has-end-content": dataAttr(!!endContent),
|
|
36
|
+
className: composeTailwindRenderProps(
|
|
37
|
+
props.className,
|
|
38
|
+
styles.base({
|
|
39
|
+
className: classNames?.base
|
|
40
|
+
})
|
|
41
|
+
),
|
|
42
|
+
children: [
|
|
43
|
+
label && /* @__PURE__ */ jsx(
|
|
44
|
+
Label,
|
|
45
|
+
{
|
|
46
|
+
className: styles.label({ className: classNames?.label }),
|
|
47
|
+
size: variantProps.size,
|
|
48
|
+
children: label
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
/* @__PURE__ */ jsx(FieldGroup, { className: styles.field({ className: classNames?.field }), children: (renderProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
52
|
+
startContent,
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
Input,
|
|
55
|
+
{
|
|
56
|
+
size: variantProps.size,
|
|
57
|
+
variant: "unstyled",
|
|
58
|
+
className: styles.input({
|
|
59
|
+
className: classNames?.input
|
|
60
|
+
}),
|
|
61
|
+
...inputProps
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
endContent,
|
|
65
|
+
!hideSteppers && /* @__PURE__ */ jsxs(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: fieldBorderStyles({
|
|
69
|
+
...renderProps,
|
|
70
|
+
className: cn(
|
|
71
|
+
styles.stepperContainer({
|
|
72
|
+
className: classNames?.stepperContainer
|
|
73
|
+
})
|
|
74
|
+
)
|
|
75
|
+
}),
|
|
76
|
+
children: [
|
|
77
|
+
/* @__PURE__ */ jsx(
|
|
78
|
+
Button,
|
|
79
|
+
{
|
|
80
|
+
className: styles.decrement({
|
|
81
|
+
className: classNames?.decrement
|
|
82
|
+
}),
|
|
83
|
+
size: variantProps.size,
|
|
84
|
+
isIconOnly: true,
|
|
85
|
+
variant: "clear",
|
|
86
|
+
color: "neutral",
|
|
87
|
+
slot: "decrement",
|
|
88
|
+
children: /* @__PURE__ */ jsx(Minus, { "aria-hidden": true })
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Button,
|
|
93
|
+
{
|
|
94
|
+
className: styles.increment({
|
|
95
|
+
className: classNames?.increment
|
|
96
|
+
}),
|
|
97
|
+
size: variantProps.size,
|
|
98
|
+
isIconOnly: true,
|
|
99
|
+
variant: "clear",
|
|
100
|
+
color: "neutral",
|
|
101
|
+
slot: "increment",
|
|
102
|
+
children: /* @__PURE__ */ jsx(Plus, { "aria-hidden": true })
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
] }) }),
|
|
109
|
+
description && /* @__PURE__ */ jsx(
|
|
110
|
+
Description,
|
|
111
|
+
{
|
|
112
|
+
className: styles.description({
|
|
113
|
+
className: classNames?.description
|
|
114
|
+
}),
|
|
115
|
+
size: variantProps.size,
|
|
116
|
+
children: description
|
|
117
|
+
}
|
|
118
|
+
),
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
FieldError,
|
|
121
|
+
{
|
|
122
|
+
className: styles.error({
|
|
123
|
+
className: classNames?.error
|
|
124
|
+
}),
|
|
125
|
+
size: variantProps.size,
|
|
126
|
+
children: errorMessage
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export { NumberField };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
import { useFocusRing
|
|
4
|
+
import { useFocusRing } from '@react-aria/focus';
|
|
5
|
+
import { usePress, useHover } from '@react-aria/interactions';
|
|
5
6
|
import { useRouter, mergeProps, chain, shouldClientNavigate } from '@react-aria/utils';
|
|
6
|
-
import { useHover as $6179b936705e76d3$export$ae780daf29e6d456 } from '../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';
|
|
7
|
-
import { usePress as $f6c31cce2adf654f$export$45712eceda6fad21 } from '../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';
|
|
8
7
|
import { cn, dataAttr } from '@opengovsg/oui-theme';
|
|
9
8
|
import { filterDOMProps } from '../system/react-utils/filter-dom-props.js';
|
|
10
9
|
import { useDomRef } from '../system/react-utils/refs.js';
|
|
@@ -32,12 +31,12 @@ function usePaginationItem(props) {
|
|
|
32
31
|
() => isActive ? `${getAriaLabel?.(value)} active` : getAriaLabel?.(value),
|
|
33
32
|
[isActive, getAriaLabel, value]
|
|
34
33
|
);
|
|
35
|
-
const { isPressed, pressProps } =
|
|
34
|
+
const { isPressed, pressProps } = usePress({
|
|
36
35
|
isDisabled,
|
|
37
36
|
onPress
|
|
38
37
|
});
|
|
39
|
-
const { focusProps, isFocused, isFocusVisible } =
|
|
40
|
-
const { isHovered, hoverProps } =
|
|
38
|
+
const { focusProps, isFocused, isFocusVisible } = useFocusRing({});
|
|
39
|
+
const { isHovered, hoverProps } = useHover({ isDisabled });
|
|
41
40
|
const getItemProps = (props2 = {}) => {
|
|
42
41
|
return {
|
|
43
42
|
ref: domRef,
|
|
@@ -4,11 +4,11 @@ import { jsx, jsxs } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { Provider, Select as Select$1, SelectValue, Virtualizer, ListLayout, ListBox } from 'react-aria-components';
|
|
6
6
|
import { selectStyles, composeRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
|
+
import { Popover } from '../popover/popover.js';
|
|
7
9
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
10
|
import { SelectVariantContext } from './select-variant-context.js';
|
|
9
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
10
11
|
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
11
|
-
import { Popover } from '../popover/popover.js';
|
|
12
12
|
import { Button } from '../button/button.js';
|
|
13
13
|
|
|
14
14
|
const calculateEstimatedRowHeight = (size) => {
|
|
@@ -4,15 +4,15 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { createElement } from 'react';
|
|
5
5
|
import { composeRenderProps } from 'react-aria-components';
|
|
6
6
|
import { tagFieldStyles } from '@opengovsg/oui-theme';
|
|
7
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
8
|
+
import { Input } from '../input/input.js';
|
|
9
|
+
import { Popover } from '../popover/popover.js';
|
|
7
10
|
import { TagFieldItem } from './tag-field-item.js';
|
|
8
11
|
import { TagFieldList } from './tag-field-list.js';
|
|
9
12
|
import { TagFieldRoot } from './tag-field-root.js';
|
|
10
13
|
import { TagFieldTagList } from './tag-field-tag-list.js';
|
|
11
14
|
import { TagFieldTrigger } from './tag-field-trigger.js';
|
|
12
15
|
import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
13
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
14
|
-
import { Input } from '../input/input.js';
|
|
15
|
-
import { Popover } from '../popover/popover.js';
|
|
16
16
|
|
|
17
17
|
function TagField({
|
|
18
18
|
classNames,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { TextField } from 'react-aria-components';
|
|
5
5
|
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
|
-
import { TextArea } from '../text-area/text-area.js';
|
|
7
6
|
import { Label, Description, FieldError } from '../field/field.js';
|
|
7
|
+
import { TextArea } from '../text-area/text-area.js';
|
|
8
8
|
|
|
9
9
|
function TextAreaField({
|
|
10
10
|
label,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { TextField as TextField$1 } from 'react-aria-components';
|
|
5
5
|
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
|
-
import { Input } from '../input/input.js';
|
|
7
6
|
import { Label, Description, FieldError } from '../field/field.js';
|
|
7
|
+
import { Input } from '../input/input.js';
|
|
8
8
|
|
|
9
9
|
function TextField({
|
|
10
10
|
label,
|
package/dist/types/index.d.mts
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,CAAA;AACzB,cAAc,QAAQ,CAAA;AACtB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,gBAAgB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/menu/menu.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,SAAS,IAAI,aAAa,EAC1B,gBAAgB,IAAI,oBAAoB,EACxC,YAAY,EAEZ,cAAc,EACf,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAIL,WAAW,IAAI,eAAe,EAQ/B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAS7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAK9C,eAAO,MAAO,kBAAkB,gEAAE,qBAAqB,2CAMrD,CAAA;AACF,MAAM,WAAW,SAAS,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC,EAAE,gBAAgB;IACtE,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;IACrC,UAAU,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;CAC9C;AA4CD,eAAO,MAAM,IAAI,GA1CE,CAAC,SAAS,MAAM,0EAgBhC,MAAO,SA0BsC,CAAA;AAEhD,MAAM,WAAW,aACf,SAAQ,iBAAiB,EACvB,uBAAuB;IACzB,UAAU,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAA;IACjD,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAC9C,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAE5C;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC7B;AAED,eAAO,MAAM,QAAQ,kGA+HnB,CAAA;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,2CASlD;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,CACjC,SAAQ,oBAAoB,CAAC,CAAC,CAAC,EAC7B,uBAAuB;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,UAAU,CAAC,EAAE,cAAc,CAAC,uBAAuB,CAAC,CAAA;CACrD;AAwCD,eAAO,MAAM,WAAW,GAtCE,CAAC,SAAS,MAAM,8EArMvC,MAAO,SA2OoD,CAAA;AAE9D,eAAO,MAAM,WAAW,wBAAkB,CAAA;AAC1C,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../src/menu/menu.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,SAAS,IAAI,aAAa,EAC1B,gBAAgB,IAAI,oBAAoB,EACxC,YAAY,EAEZ,cAAc,EACf,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAIL,WAAW,IAAI,eAAe,EAQ/B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAS7B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAK9C,eAAO,MAAO,kBAAkB,gEAAE,qBAAqB,2CAMrD,CAAA;AACF,MAAM,WAAW,SAAS,CAAC,CAAC,CAAE,SAAQ,aAAa,CAAC,CAAC,CAAC,EAAE,gBAAgB;IACtE,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;IACrC,UAAU,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;CAC9C;AA4CD,eAAO,MAAM,IAAI,GA1CE,CAAC,SAAS,MAAM,0EAgBhC,MAAO,SA0BsC,CAAA;AAEhD,MAAM,WAAW,aACf,SAAQ,iBAAiB,EACvB,uBAAuB;IACzB,UAAU,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAA;IACjD,qBAAqB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAC9C,mBAAmB,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAE5C;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC7B;AAED,eAAO,MAAM,QAAQ,kGA+HnB,CAAA;AAEF,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,2CASlD;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,CACjC,SAAQ,oBAAoB,CAAC,CAAC,CAAC,EAC7B,uBAAuB;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,UAAU,CAAC,EAAE,cAAc,CAAC,uBAAuB,CAAC,CAAA;CACrD;AAwCD,eAAO,MAAM,WAAW,GAtCE,CAAC,SAAS,MAAM,8EArMvC,MAAO,SA2OoD,CAAA;AAE9D,eAAO,MAAM,WAAW,wBAAkB,CAAA;AAC1C,eAAO,MAAM,cAAc,gEACmytD,MAAO,aAAa,wDADlytD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/number-field/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { NumberFieldProps as AriaNumberFieldProps, ValidationResult } from "react-aria-components";
|
|
2
|
+
import type { NumberFieldSlots, NumberFieldVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
3
|
+
import type { InputProps } from "../input";
|
|
4
|
+
export interface NumberFieldProps extends AriaNumberFieldProps, NumberFieldVariantProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
8
|
+
classNames?: SlotsToClasses<NumberFieldSlots>;
|
|
9
|
+
inputProps?: Partial<InputProps>;
|
|
10
|
+
/**
|
|
11
|
+
* If true, hides the stepper buttons
|
|
12
|
+
*/
|
|
13
|
+
hideSteppers?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Content to be displayed at the start of the input field
|
|
16
|
+
*/
|
|
17
|
+
startContent?: React.ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Content to be displayed at the end of the input field
|
|
20
|
+
*/
|
|
21
|
+
endContent?: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export declare function NumberField(originalProps: NumberFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=number-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-field.d.ts","sourceRoot":"","sources":["../../../src/number-field/number-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,IAAI,oBAAoB,EACxC,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAI9B,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAS7B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAM1C,MAAM,WAAW,gBACf,SAAQ,oBAAoB,EAC1B,uBAAuB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAElE,UAAU,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;IAE7C,UAAU,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;IAEhC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE9B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC7B;AAED,wBAAgB,WAAW,CAAC,aAAa,EAAE,gBAAgB,2CAgH1D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengovsg/oui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
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": "
|
|
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,11 +46,11 @@
|
|
|
45
46
|
"motion": "^12.18.1",
|
|
46
47
|
"prettier": "^3.5.3",
|
|
47
48
|
"react": "^19.0.0",
|
|
48
|
-
"react-aria-components": "^1.
|
|
49
|
-
"storybook": "
|
|
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.
|
|
53
|
+
"@opengovsg/oui-theme": "0.0.24",
|
|
53
54
|
"@oui/chromatic": "0.0.0",
|
|
54
55
|
"@oui/eslint-config": "0.0.0",
|
|
55
56
|
"@oui/prettier-config": "0.0.0",
|
|
@@ -58,7 +59,9 @@
|
|
|
58
59
|
"dependencies": {
|
|
59
60
|
"@internationalized/date": "^3.9.0",
|
|
60
61
|
"@react-aria/calendar": "^3.8.3",
|
|
61
|
-
"@react-aria/
|
|
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.
|
|
90
|
+
"@opengovsg/oui-theme": "0.0.24"
|
|
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;
|