@opengovsg/oui 0.0.0-snapshot-20251002073151 → 0.0.0-snapshot-20251201075851
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/badge/badge.cjs +4 -4
- package/dist/cjs/badge/use-badge.cjs +6 -6
- package/dist/cjs/banner/banner.cjs +10 -5
- package/dist/cjs/button/button.cjs +3 -3
- 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 -3
- 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/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 +3 -3
- package/dist/cjs/date-field/date-field.cjs +15 -6
- package/dist/cjs/date-picker/date-picker.cjs +36 -11
- package/dist/cjs/date-range-picker/date-range-picker.cjs +3 -3
- package/dist/cjs/field/field.cjs +20 -6
- package/dist/cjs/field/index.cjs +1 -0
- package/dist/cjs/file-dropzone/contexts.cjs +18 -0
- package/dist/cjs/file-dropzone/file-dropzone.cjs +311 -0
- package/dist/cjs/file-dropzone/file-info.cjs +146 -0
- package/dist/cjs/file-dropzone/index.cjs +13 -0
- package/dist/cjs/file-dropzone/types.cjs +3 -0
- package/dist/cjs/file-dropzone/utils.cjs +31 -0
- package/dist/cjs/govt-banner/govt-banner.cjs +3 -3
- package/dist/cjs/hooks/use-callback-ref.cjs +4 -4
- package/dist/cjs/hooks/use-controllable-state.cjs +2 -2
- package/dist/cjs/index.cjs +10 -0
- package/dist/cjs/input/input.cjs +2 -2
- package/dist/cjs/menu/menu.cjs +6 -6
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/Icon.cjs +4 -4
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +3 -3
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/plus.cjs +22 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/trash-2.cjs +25 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/upload.cjs +23 -0
- package/dist/cjs/number-field/index.cjs +8 -0
- package/dist/cjs/number-field/number-field.cjs +136 -0
- package/dist/cjs/pagination/hooks/use-pagination.cjs +7 -7
- package/dist/cjs/pagination/pagination.cjs +6 -6
- package/dist/cjs/pagination/use-pagination-item.cjs +7 -8
- package/dist/cjs/pagination/use-pagination.cjs +8 -8
- package/dist/cjs/range-calendar/range-calendar.cjs +6 -6
- package/dist/cjs/ripple/use-ripple.cjs +4 -4
- package/dist/cjs/select/select.cjs +2 -2
- 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 +2 -2
- 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/toggle/toggle.cjs +3 -3
- package/dist/esm/banner/banner.js +7 -2
- package/dist/esm/calendar/calendar-month-day-selector.js +2 -1
- package/dist/esm/date-field/date-field.js +12 -3
- package/dist/esm/date-picker/date-picker.js +34 -9
- package/dist/esm/field/field.js +20 -7
- package/dist/esm/field/index.js +1 -1
- package/dist/esm/file-dropzone/contexts.js +13 -0
- package/dist/esm/file-dropzone/file-dropzone.js +309 -0
- package/dist/esm/file-dropzone/file-info.js +144 -0
- package/dist/esm/file-dropzone/index.js +4 -0
- package/dist/esm/file-dropzone/types.js +1 -0
- package/dist/esm/file-dropzone/utils.js +28 -0
- package/dist/esm/index.js +5 -1
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/plus.js +17 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/trash-2.js +20 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/upload.js +18 -0
- package/dist/esm/number-field/index.js +2 -0
- package/dist/esm/number-field/number-field.js +134 -0
- package/dist/esm/pagination/use-pagination-item.js +5 -6
- package/dist/types/banner/banner.d.ts +1 -1
- package/dist/types/banner/banner.d.ts.map +1 -1
- package/dist/types/calendar/calendar-month-day-selector.d.ts.map +1 -1
- package/dist/types/date-field/date-field.d.ts +1 -0
- package/dist/types/date-field/date-field.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.d.ts +5 -2
- package/dist/types/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/field/field.d.ts +4 -1
- package/dist/types/field/field.d.ts.map +1 -1
- package/dist/types/file-dropzone/contexts.d.ts +4 -0
- package/dist/types/file-dropzone/contexts.d.ts.map +1 -0
- package/dist/types/file-dropzone/file-dropzone.d.ts +82 -0
- package/dist/types/file-dropzone/file-dropzone.d.ts.map +1 -0
- package/dist/types/file-dropzone/file-info.d.ts +9 -0
- package/dist/types/file-dropzone/file-info.d.ts.map +1 -0
- package/dist/types/file-dropzone/index.d.ts +7 -0
- package/dist/types/file-dropzone/index.d.ts.map +1 -0
- package/dist/types/file-dropzone/types.d.ts +24 -0
- package/dist/types/file-dropzone/types.d.ts.map +1 -0
- package/dist/types/file-dropzone/utils.d.ts +8 -0
- package/dist/types/file-dropzone/utils.d.ts.map +1 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/menu/menu.d.ts.map +1 -1
- package/dist/types/number-field/index.d.ts +3 -0
- package/dist/types/number-field/index.d.ts.map +1 -0
- package/dist/types/number-field/number-field.d.ts +24 -0
- package/dist/types/number-field/number-field.d.ts.map +1 -0
- package/package.json +12 -8
- package/dist/cjs/node_modules/.pnpm/@react-aria_focus@3.20.5_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/focus/dist/useFocusRing.cjs +0 -45
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/context.cjs +0 -21
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/textSelection.cjs +0 -72
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocus.cjs +0 -60
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocusVisible.cjs +0 -210
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocusWithin.cjs +0 -100
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useHover.cjs +0 -152
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/usePress.cjs +0 -676
- package/dist/cjs/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/utils.cjs +0 -160
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_check_private_redeclaration.cjs +0 -9
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.cjs +0 -9
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.cjs +0 -16
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.cjs +0 -9
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_get.cjs +0 -11
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_init.cjs +0 -10
- package/dist/cjs/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_set.cjs +0 -12
- package/dist/esm/node_modules/.pnpm/@react-aria_focus@3.20.5_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/focus/dist/useFocusRing.js +0 -43
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/context.js +0 -19
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/textSelection.js +0 -69
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocus.js +0 -58
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocusVisible.js +0 -205
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useFocusWithin.js +0 -98
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/useHover.js +0 -150
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/usePress.js +0 -674
- package/dist/esm/node_modules/.pnpm/@react-aria_interactions@3.25.3_react-dom@19.0.0_react@19.0.0__react@19.0.0/node_modules/@react-aria/interactions/dist/utils.js +0 -155
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +0 -7
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js +0 -7
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js +0 -14
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js +0 -7
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_get.js +0 -9
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_init.js +0 -8
- package/dist/esm/node_modules/.pnpm/@swc_helpers@0.5.17/node_modules/@swc/helpers/esm/_class_private_field_set.js +0 -10
|
@@ -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 { mapPropsVariants } from '../system/utils.js';
|
|
7
|
+
import Minus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.js';
|
|
8
|
+
import Plus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/plus.js';
|
|
9
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
10
|
+
import { Input } from '../input/input.js';
|
|
11
|
+
import { Button } from '../button/button.js';
|
|
12
|
+
|
|
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,
|
|
@@ -6,7 +6,7 @@ interface BannerProps extends VariantProps<typeof bannerStyles>, AriaDisclosureP
|
|
|
6
6
|
/**
|
|
7
7
|
* The banner start content. Will default to the relevant icons based on the `variant` prop.
|
|
8
8
|
*/
|
|
9
|
-
startContent?: React.ReactNode;
|
|
9
|
+
startContent?: React.ReactNode | null;
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
/**
|
|
12
12
|
* If provided, the dismiss button will be rendered.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/banner/banner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAoB,MAAM,YAAY,CAAA;AAMvE,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAInD,UAAU,WACR,SAAQ,YAAY,CAAC,OAAO,YAAY,CAAC,EACvC,mBAAmB;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/banner/banner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,mBAAmB,EAAoB,MAAM,YAAY,CAAA;AAMvE,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAInD,UAAU,WACR,SAAQ,YAAY,CAAC,OAAO,YAAY,CAAC,EACvC,mBAAmB;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IACrC,QAAQ,EAAE,SAAS,CAAA;IACnB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAA;CACzC;AAiBD,eAAO,MAAM,MAAM,2IAUhB,WAAW,mDAsFb,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-month-day-selector.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar-month-day-selector.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,wBAAwB,+
|
|
1
|
+
{"version":3,"file":"calendar-month-day-selector.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar-month-day-selector.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,wBAAwB,+CA4EpC,CAAA"}
|
|
@@ -6,6 +6,7 @@ interface DateFieldProps<T extends DateValue> extends AriaDateFieldProps<T>, Var
|
|
|
6
6
|
description?: string;
|
|
7
7
|
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
8
8
|
classNames?: SlotsToClasses<"base" | "label" | "input" | "description" | "error">;
|
|
9
|
+
inputProps?: DateInputProps;
|
|
9
10
|
}
|
|
10
11
|
export declare function DateField<T extends DateValue>(originalProps: DateFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
interface DateInputProps extends Omit<AriaDateInputProps, "children">, VariantProps<typeof dateInputStyles> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-field.d.ts","sourceRoot":"","sources":["../../../src/date-field/date-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,cAAc,IAAI,kBAAkB,EACpC,SAAS,EACT,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAQ9B,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"date-field.d.ts","sourceRoot":"","sources":["../../../src/date-field/date-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,cAAc,IAAI,kBAAkB,EACpC,SAAS,EACT,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAQ9B,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAIL,eAAe,EACf,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAK7B,UAAU,cAAc,CAAC,CAAC,SAAS,SAAS,CAC1C,SAAQ,kBAAkB,CAAC,CAAC,CAAC,EAC3B,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,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;IAClE,UAAU,CAAC,EAAE,cAAc,CACzB,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CACrD,CAAA;IACD,UAAU,CAAC,EAAE,cAAc,CAAA;CAC5B;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,EAC3C,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,2CAmDjC;AAED,UAAU,cACR,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,EAC1C,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,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;IAClE,UAAU,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;CAC5C;AAED,wBAAgB,SAAS,CAAC,aAAa,EAAE,cAAc,2CA+BtD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DatePickerProps as AriaDatePickerProps, DateValue, ValidationResult } from "react-aria-components";
|
|
2
|
-
import type { CalendarSlots, DatePickerSlots, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
|
|
2
|
+
import type { CalendarSlots, DatePickerSlots, FieldErrorSlots, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
|
|
3
3
|
import { datePickerStyles } from "@opengovsg/oui-theme";
|
|
4
4
|
import type { ButtonProps } from "../button";
|
|
5
5
|
import type { CalendarProps } from "../calendar";
|
|
@@ -8,11 +8,14 @@ interface DatePickerProps<T extends DateValue> extends VariantProps<typeof dateP
|
|
|
8
8
|
label?: string;
|
|
9
9
|
description?: string;
|
|
10
10
|
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
11
|
+
selectorIcon?: React.ReactNode;
|
|
11
12
|
calendarProps?: CalendarProps<T>;
|
|
12
13
|
popoverProps?: PopoverProps;
|
|
13
14
|
calendarButtonProps?: ButtonProps;
|
|
14
|
-
classNames?: SlotsToClasses<DatePickerSlots> & {
|
|
15
|
+
classNames?: SlotsToClasses<DatePickerSlots | "description"> & {
|
|
15
16
|
calendar?: SlotsToClasses<CalendarSlots>;
|
|
17
|
+
error?: SlotsToClasses<FieldErrorSlots>;
|
|
18
|
+
popover?: PopoverProps["classNames"];
|
|
16
19
|
};
|
|
17
20
|
}
|
|
18
21
|
export declare function DatePicker<T extends DateValue>(originalProps: DatePickerProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/date-picker/date-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,SAAS,EACT,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAK9B,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEL,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAQ9C,UAAU,eAAe,CAAC,CAAC,SAAS,SAAS,CAC3C,SAAQ,YAAY,CAAC,OAAO,gBAAgB,CAAC,EAC3C,mBAAmB,CAAC,CAAC,CAAC;IACxB,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;IAClE,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAChC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,mBAAmB,CAAC,EAAE,WAAW,CAAA;IACjC,UAAU,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../src/date-picker/date-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,SAAS,EACT,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAK9B,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,eAAe,EACf,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEL,gBAAgB,EACjB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAQ9C,UAAU,eAAe,CAAC,CAAC,SAAS,SAAS,CAC3C,SAAQ,YAAY,CAAC,OAAO,gBAAgB,CAAC,EAC3C,mBAAmB,CAAC,CAAC,CAAC;IACxB,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;IAClE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,aAAa,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAA;IAChC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,mBAAmB,CAAC,EAAE,WAAW,CAAA;IACjC,UAAU,CAAC,EAAE,cAAc,CAAC,eAAe,GAAG,aAAa,CAAC,GAAG;QAC7D,QAAQ,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;QACxC,KAAK,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAA;QACvC,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAA;KACrC,CAAA;CACF;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,SAAS,EAC5C,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,2CAoFlC"}
|
|
@@ -9,6 +9,9 @@ export declare function Description({ size, className, ...props }: DescriptionPr
|
|
|
9
9
|
export interface FieldErrorProps extends AriaFieldErrorProps, FieldErrorVariantProps {
|
|
10
10
|
classNames?: SlotsToClasses<FieldErrorSlots>;
|
|
11
11
|
}
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function FieldErrorIcon({ size, className, }: Pick<FieldErrorProps, "size"> & {
|
|
13
|
+
className?: string;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function FieldError({ children, className, size, classNames, ...props }: FieldErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
export declare function FieldGroup(props: GroupProps): import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
//# sourceMappingURL=field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/field/field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,UAAU,IAAI,cAAc,EAC5B,UAAU,EACV,SAAS,EACV,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/field/field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,UAAU,IAAI,cAAc,EAC5B,UAAU,EACV,SAAS,EACV,MAAM,uBAAuB,CAAA;AAU9B,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAS7B,MAAM,WAAW,UAAW,SAAQ,cAAc,EAAE,iBAAiB;CAAG;AAExE,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAE9D;AAED,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,uBAAuB;CAAG;AAE/E,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAQ1E;AAED,MAAM,WAAW,eACf,SAAQ,mBAAmB,EACzB,sBAAsB;IACxB,UAAU,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAA;CAC7C;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,SAAS,GACV,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAIxD;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,UAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CA0BjB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,2CAS3C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FileDropzoneState, FileDropzoneStyleContextReturn } from "./types";
|
|
2
|
+
export declare const FileDropzoneStateContext: import("react").Context<FileDropzoneState>, useFileDropzoneStateContext: () => FileDropzoneState;
|
|
3
|
+
export declare const FileDropzoneStyleContext: import("react").Context<FileDropzoneStyleContextReturn>, useFileDropzoneStyleContext: () => FileDropzoneStyleContextReturn;
|
|
4
|
+
//# sourceMappingURL=contexts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../../src/file-dropzone/contexts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAA;AAGhF,eAAO,MAAO,wBAAwB,8CAAE,2BAA2B,yBAI/D,CAAA;AACJ,eAAO,MAAO,wBAAwB,2DAAE,2BAA2B,sCAI/D,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { InputBase, Validation } from "@react-types/shared";
|
|
2
|
+
import type { AriaFieldProps } from "react-aria";
|
|
3
|
+
import type { DropzoneOptions } from "react-dropzone";
|
|
4
|
+
import type { FileDropzoneSlots, FileInfoDropzoneSlots, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
|
|
5
|
+
import { fileDropzoneStyles } from "@opengovsg/oui-theme";
|
|
6
|
+
import type { FileItem } from "./types";
|
|
7
|
+
export interface FileItemsRenderProps {
|
|
8
|
+
file: FileItem;
|
|
9
|
+
removeFile: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface FileDropzoneProps extends Omit<AriaFieldProps, "validate">, InputBase, Validation<FileItem[]>, VariantProps<typeof fileDropzoneStyles> {
|
|
12
|
+
name?: string;
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
description?: React.ReactNode;
|
|
15
|
+
errorMessage?: React.ReactNode;
|
|
16
|
+
validator?: DropzoneOptions["validator"];
|
|
17
|
+
classNames?: SlotsToClasses<FileDropzoneSlots>;
|
|
18
|
+
itemClassNames?: SlotsToClasses<FileInfoDropzoneSlots>;
|
|
19
|
+
/** The current files (controlled). */
|
|
20
|
+
value?: FileItem[];
|
|
21
|
+
/** The default files (uncontrolled). */
|
|
22
|
+
defaultValue?: FileItem[];
|
|
23
|
+
/** Sets the controlled value. */
|
|
24
|
+
onChange?: (value: FileItem[]) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Allowed MIME types for each file upload (e.g `image/png`, `text/html`, etc). Wildcards are also supported (e.g `image/*`).
|
|
27
|
+
*
|
|
28
|
+
* Defaults to allowing uploading of all MIME types.
|
|
29
|
+
*/
|
|
30
|
+
allowedMimeTypes?: string[];
|
|
31
|
+
/**
|
|
32
|
+
* Maximum upload size of each file allowed in bytes. (e.g 1000 bytes = 1 KB)
|
|
33
|
+
* @default Number.POSITIVE_INFINITY
|
|
34
|
+
*/
|
|
35
|
+
maxFileSize?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Minimum upload size of each file allowed in bytes. (e.g 1000 bytes = 1 KB)
|
|
38
|
+
* @default 0
|
|
39
|
+
*/
|
|
40
|
+
minFileSize?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to show file size information below the dropzone.
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
showFileSizeText?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Maximum number of files allowed per upload.
|
|
48
|
+
* @default 1
|
|
49
|
+
*/
|
|
50
|
+
maxFiles?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to show rejected files in the component.
|
|
53
|
+
*/
|
|
54
|
+
showRejectedFiles?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* List of file rejections (controlled).
|
|
57
|
+
*/
|
|
58
|
+
rejections?: FileItem[];
|
|
59
|
+
/**
|
|
60
|
+
* If provided, callback function will be called when files are rejected.
|
|
61
|
+
*/
|
|
62
|
+
onRejection?: (rejections: FileItem[]) => void;
|
|
63
|
+
/**
|
|
64
|
+
* If provided, this function will be called with any error messages that occur during file validation.
|
|
65
|
+
* If there are multiple errors, only the first message will be passed to this function.
|
|
66
|
+
*/
|
|
67
|
+
onError?: (errorMessage: string) => void;
|
|
68
|
+
children?: (values: FileItemsRenderProps) => React.ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Whether to hide the dropzone when there is at least one file uploaded.
|
|
71
|
+
* @default true if maxFiles is 1, false otherwise
|
|
72
|
+
*/
|
|
73
|
+
hideDropzoneOnValue?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* If provided, the image preview will be shown in the given size variant.
|
|
76
|
+
* If `null`, no image preview will be shown.
|
|
77
|
+
* @default "small"
|
|
78
|
+
*/
|
|
79
|
+
imagePreview?: "small" | "large" | null;
|
|
80
|
+
}
|
|
81
|
+
export declare const FileDropzone: (originalProps: FileDropzoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
82
|
+
//# sourceMappingURL=file-dropzone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-dropzone.d.ts","sourceRoot":"","sources":["../../../src/file-dropzone/file-dropzone.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAA4B,MAAM,gBAAgB,CAAA;AAe/E,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAY,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAavC,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,QAAQ,CAAA;IACd,UAAU,EAAE,MAAM,IAAI,CAAA;CACvB;AAED,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,EACtC,SAAS,EACT,UAAU,CAAC,QAAQ,EAAE,CAAC,EACtB,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE9B,SAAS,CAAC,EAAE,eAAe,CAAC,WAAW,CAAC,CAAA;IACxC,UAAU,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAC9C,cAAc,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAA;IACtD,sCAAsC;IACtC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;IAClB,wCAAwC;IACxC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAA;IACzB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAA;IACtC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAE3B;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,EAAE,CAAA;IAEvB;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAA;IAC9C;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,KAAK,CAAC,SAAS,CAAA;IAE5D;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAE7B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;CACxC;AAED,eAAO,MAAM,YAAY,kBAAmB,iBAAiB,4CAwQ5D,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FileInfoDropzoneSlots, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
2
|
+
import type { FileItem } from "./types";
|
|
3
|
+
export interface FileInfoProps {
|
|
4
|
+
file: FileItem;
|
|
5
|
+
imagePreview?: "small" | "large" | null;
|
|
6
|
+
classNames?: SlotsToClasses<FileInfoDropzoneSlots>;
|
|
7
|
+
}
|
|
8
|
+
export declare const FileInfo: ({ file, imagePreview, classNames }: FileInfoProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
//# sourceMappingURL=file-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-info.d.ts","sourceRoot":"","sources":["../../../src/file-dropzone/file-info.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,qBAAqB,EACrB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAG7B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAQvC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,QAAQ,CAAA;IACd,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;IACvC,UAAU,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAA;CACnD;AAED,eAAO,MAAM,QAAQ,uCAAwC,aAAa,4CA0HzE,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { FileDropzone } from "./file-dropzone";
|
|
2
|
+
export { FileInfo } from "./file-info";
|
|
3
|
+
export type { FileInfoProps } from "./file-info";
|
|
4
|
+
export type { FileDropzoneProps, FileItemsRenderProps } from "./file-dropzone";
|
|
5
|
+
export type { FileItem } from "./types";
|
|
6
|
+
export { formatBytes, formatErrorMessage } from "./utils";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/file-dropzone/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAChD,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAE9E,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { DropzoneState, FileError } from "react-dropzone";
|
|
2
|
+
import type { FileDropzoneSlots, fileDropzoneStyles, FileDropzoneVariantProps, FileInfoDropzoneSlots, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
3
|
+
export interface FileItem extends File {
|
|
4
|
+
errors?: readonly FileError[];
|
|
5
|
+
}
|
|
6
|
+
export interface FileDropzoneState extends Omit<DropzoneState, "getInputProps"> {
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
isReadOnly?: boolean;
|
|
9
|
+
inputProps: ReturnType<DropzoneState["getInputProps"]>;
|
|
10
|
+
triggerFileSelector: () => void | null;
|
|
11
|
+
maxFiles: number;
|
|
12
|
+
maxFileSize: number;
|
|
13
|
+
showDropzone: boolean;
|
|
14
|
+
files: FileItem[];
|
|
15
|
+
handleRemoveFile: (fileName: string) => void;
|
|
16
|
+
handleRemoveRejection: (fileName: string) => void;
|
|
17
|
+
formatError: (error: FileError) => string;
|
|
18
|
+
}
|
|
19
|
+
export interface FileDropzoneStyleContextReturn extends FileDropzoneVariantProps {
|
|
20
|
+
slots: ReturnType<typeof fileDropzoneStyles>;
|
|
21
|
+
classNames?: SlotsToClasses<FileDropzoneSlots>;
|
|
22
|
+
itemClassNames?: SlotsToClasses<FileInfoDropzoneSlots>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/file-dropzone/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAE9D,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,QAAS,SAAQ,IAAI;IACpC,MAAM,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC;IAC5C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,EAAE,UAAU,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC,CAAA;IACtD,mBAAmB,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;IACtC,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,OAAO,CAAA;IACrB,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,qBAAqB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IACjD,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,MAAM,CAAA;CAC1C;AAED,MAAM,WAAW,8BACf,SAAQ,wBAAwB;IAChC,KAAK,EAAE,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA;IAC5C,UAAU,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAC9C,cAAc,CAAC,EAAE,cAAc,CAAC,qBAAqB,CAAC,CAAA;CACvD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FileRejection } from "react-dropzone";
|
|
2
|
+
export declare const formatBytes: (bytes: number, decimals?: number, size?: "bytes" | "KB" | "MB" | "GB" | "TB" | "PB" | "EB" | "ZB" | "YB") => string;
|
|
3
|
+
export declare const formatErrorMessage: (error: FileRejection["errors"][number], config: {
|
|
4
|
+
maxFileSize: number;
|
|
5
|
+
minFileSize: number;
|
|
6
|
+
maxFiles: number;
|
|
7
|
+
}) => string;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/file-dropzone/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAGnD,eAAO,MAAM,WAAW,UACf,MAAM,4BAEN,OAAO,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,WAavE,CAAA;AAED,eAAO,MAAM,kBAAkB,UACtB,aAAa,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAC9B;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,WAgBvE,CAAA"}
|
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"}
|
|
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.0-snapshot-
|
|
3
|
+
"version": "0.0.0-snapshot-20251201075851",
|
|
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.0-snapshot-
|
|
53
|
+
"@opengovsg/oui-theme": "0.0.0-snapshot-20251201075851",
|
|
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",
|
|
@@ -72,6 +75,7 @@
|
|
|
72
75
|
"lodash-es": "^4.17.21",
|
|
73
76
|
"nanoid": "^5.1.5",
|
|
74
77
|
"react-aria": "^3.41.1",
|
|
78
|
+
"react-dropzone": "^14.3.8",
|
|
75
79
|
"react-stately": "^3.41.0",
|
|
76
80
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
77
81
|
"type-fest": "^4.41.0",
|
|
@@ -83,7 +87,7 @@
|
|
|
83
87
|
"motion": ">=11.12.0 || >=12.0.0-alpha.1",
|
|
84
88
|
"react": ">= 18",
|
|
85
89
|
"react-aria-components": "^1.12.2",
|
|
86
|
-
"@opengovsg/oui-theme": "0.0.0-snapshot-
|
|
90
|
+
"@opengovsg/oui-theme": "0.0.0-snapshot-20251201075851"
|
|
87
91
|
},
|
|
88
92
|
"scripts": {
|
|
89
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;
|