@opengovsg/oui 0.0.0-snapshot-20251103063040 → 0.0.0-snapshot-20251203091804
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 +4 -4
- 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 +39 -13
- package/dist/cjs/date-range-picker/date-range-picker.cjs +4 -4
- 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/index.cjs +2 -0
- package/dist/cjs/hooks/use-callback-ref.cjs +4 -4
- package/dist/cjs/hooks/use-controllable-state.cjs +2 -2
- package/dist/cjs/hooks/use-draggable.cjs +88 -0
- package/dist/cjs/index.cjs +47 -22
- package/dist/cjs/input/input.cjs +2 -2
- package/dist/cjs/menu/menu.cjs +6 -6
- package/dist/cjs/modal/i18n.cjs +19 -0
- package/dist/cjs/modal/index.cjs +19 -0
- package/dist/cjs/modal/modal-body.cjs +26 -0
- package/dist/cjs/modal/modal-content.cjs +54 -0
- package/dist/cjs/modal/modal-footer.cjs +27 -0
- package/dist/cjs/modal/modal-header.cjs +25 -0
- package/dist/cjs/modal/modal-variant-context.cjs +13 -0
- package/dist/cjs/modal/modal.cjs +66 -0
- 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 +7 -7
- package/dist/cjs/ripple/use-ripple.cjs +4 -4
- package/dist/cjs/select/select.cjs +3 -3
- 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 +1 -1
- 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 +37 -11
- package/dist/esm/date-range-picker/date-range-picker.js +1 -1
- 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/hooks/index.js +1 -0
- package/dist/esm/hooks/use-draggable.js +86 -0
- package/dist/esm/index.js +19 -8
- package/dist/esm/modal/i18n.js +17 -0
- package/dist/esm/modal/index.js +7 -0
- package/dist/esm/modal/modal-body.js +24 -0
- package/dist/esm/modal/modal-content.js +52 -0
- package/dist/esm/modal/modal-footer.js +25 -0
- package/dist/esm/modal/modal-header.js +23 -0
- package/dist/esm/modal/modal-variant-context.js +10 -0
- package/dist/esm/modal/modal.js +64 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/plus.js +17 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/trash-2.js +20 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/upload.js +18 -0
- package/dist/esm/number-field/index.js +2 -0
- package/dist/esm/number-field/number-field.js +134 -0
- package/dist/esm/pagination/use-pagination-item.js +5 -6
- package/dist/esm/range-calendar/range-calendar.js +1 -1
- package/dist/esm/select/select.js +1 -1
- package/dist/types/badge/use-badge.d.ts +12 -12
- 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/hooks/index.d.ts +4 -1
- package/dist/types/hooks/index.d.ts.map +1 -1
- package/dist/types/hooks/use-draggable.d.ts +24 -0
- package/dist/types/hooks/use-draggable.d.ts.map +1 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/menu/menu.d.ts.map +1 -1
- package/dist/types/modal/i18n.d.ts +3 -0
- package/dist/types/modal/i18n.d.ts.map +1 -0
- package/dist/types/modal/index.d.ts +12 -0
- package/dist/types/modal/index.d.ts.map +1 -0
- package/dist/types/modal/modal-body.d.ts +5 -0
- package/dist/types/modal/modal-body.d.ts.map +1 -0
- package/dist/types/modal/modal-content.d.ts +10 -0
- package/dist/types/modal/modal-content.d.ts.map +1 -0
- package/dist/types/modal/modal-footer.d.ts +5 -0
- package/dist/types/modal/modal-footer.d.ts.map +1 -0
- package/dist/types/modal/modal-header.d.ts +5 -0
- package/dist/types/modal/modal-header.d.ts.map +1 -0
- package/dist/types/modal/modal-variant-context.d.ts +8 -0
- package/dist/types/modal/modal-variant-context.d.ts.map +1 -0
- package/dist/types/modal/modal.d.ts +8 -0
- package/dist/types/modal/modal.d.ts.map +1 -0
- 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/dist/types/pagination/use-pagination.d.ts +36 -36
- package/package.json +14 -10
- 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,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { useContext, isValidElement } from 'react';
|
|
5
|
+
import { useMessageFormatter } from 'react-aria';
|
|
6
|
+
import { Dialog } from 'react-aria-components';
|
|
7
|
+
import { cn } from '@opengovsg/oui-theme';
|
|
8
|
+
import { Button } from '../button/button.js';
|
|
9
|
+
import { i18nStrings } from './i18n.js';
|
|
10
|
+
import { ModalVariantContext } from './modal-variant-context.js';
|
|
11
|
+
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
12
|
+
|
|
13
|
+
function ModalContent({
|
|
14
|
+
closeButtonContent: closeButtonContentProp,
|
|
15
|
+
hideCloseButton,
|
|
16
|
+
closeButtonProps,
|
|
17
|
+
...props
|
|
18
|
+
}) {
|
|
19
|
+
const { slots, classNames, buttonSize } = useContext(ModalVariantContext);
|
|
20
|
+
const formatMessage = useMessageFormatter(i18nStrings);
|
|
21
|
+
const closeButtonContent = isValidElement(closeButtonContentProp) ? closeButtonContentProp : /* @__PURE__ */ jsx(X, {});
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
23
|
+
Dialog,
|
|
24
|
+
{
|
|
25
|
+
...props,
|
|
26
|
+
className: slots.dialog({
|
|
27
|
+
className: props.className ?? classNames?.dialog
|
|
28
|
+
}),
|
|
29
|
+
children: ({ close }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30
|
+
!hideCloseButton && /* @__PURE__ */ jsx(
|
|
31
|
+
Button,
|
|
32
|
+
{
|
|
33
|
+
slot: "close",
|
|
34
|
+
isIconOnly: true,
|
|
35
|
+
"aria-label": formatMessage("dismiss"),
|
|
36
|
+
size: buttonSize,
|
|
37
|
+
variant: "clear",
|
|
38
|
+
color: "neutral",
|
|
39
|
+
...closeButtonProps,
|
|
40
|
+
className: slots.closeButton({
|
|
41
|
+
className: cn(classNames?.closeButton, props.className)
|
|
42
|
+
}),
|
|
43
|
+
children: closeButtonContent
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
typeof props.children === "function" ? props.children(close) : props.children
|
|
47
|
+
] })
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { ModalContent };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useContext } from 'react';
|
|
5
|
+
import { cn } from '@opengovsg/oui-theme';
|
|
6
|
+
import { forwardRef } from '../system/utils.js';
|
|
7
|
+
import { ModalVariantContext } from './modal-variant-context.js';
|
|
8
|
+
|
|
9
|
+
const ModalFooter = forwardRef(function ModalFooter2({ as, ...props }, ref) {
|
|
10
|
+
const { slots, classNames } = useContext(ModalVariantContext);
|
|
11
|
+
const Component = as || "footer";
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Component,
|
|
14
|
+
{
|
|
15
|
+
ref,
|
|
16
|
+
className: slots.footer({
|
|
17
|
+
className: cn(classNames?.footer, props.className)
|
|
18
|
+
}),
|
|
19
|
+
...props
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
ModalFooter.displayName = "ModalFooter";
|
|
24
|
+
|
|
25
|
+
export { ModalFooter };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { useContext } from 'react';
|
|
5
|
+
import { Heading } from 'react-aria-components';
|
|
6
|
+
import { cn } from '@opengovsg/oui-theme';
|
|
7
|
+
import { ModalVariantContext } from './modal-variant-context.js';
|
|
8
|
+
|
|
9
|
+
function ModalHeader(props) {
|
|
10
|
+
const { slots, classNames } = useContext(ModalVariantContext);
|
|
11
|
+
return /* @__PURE__ */ jsx(
|
|
12
|
+
Heading,
|
|
13
|
+
{
|
|
14
|
+
slot: "title",
|
|
15
|
+
...props,
|
|
16
|
+
className: slots.header({
|
|
17
|
+
className: cn(classNames?.header, props.className)
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { ModalHeader };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { createContext } from '../system/react-utils/context.js';
|
|
4
|
+
|
|
5
|
+
const [ModalVariantContext, useModalVariantContext] = createContext({
|
|
6
|
+
name: "ModalVariantContext",
|
|
7
|
+
strict: true
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export { ModalVariantContext, useModalVariantContext };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { forwardRef, useMemo } from 'react';
|
|
5
|
+
import { Provider, ModalOverlay, Modal as Modal$1 } from 'react-aria-components';
|
|
6
|
+
import { modalStyles, composeRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
+
import { mapPropsVariants } from '../system/utils.js';
|
|
8
|
+
import { ModalVariantContext } from './modal-variant-context.js';
|
|
9
|
+
|
|
10
|
+
const Modal = forwardRef(function Modal2(originalProps, ref) {
|
|
11
|
+
const [{ classNames, ...props }, variantProps] = mapPropsVariants(
|
|
12
|
+
originalProps,
|
|
13
|
+
modalStyles.variantKeys
|
|
14
|
+
);
|
|
15
|
+
const { isDismissable = true } = props;
|
|
16
|
+
const slots = modalStyles(variantProps);
|
|
17
|
+
const buttonSize = useMemo(() => {
|
|
18
|
+
switch (variantProps.size) {
|
|
19
|
+
case "mobile":
|
|
20
|
+
return "md";
|
|
21
|
+
default: {
|
|
22
|
+
return "lg";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, [variantProps.size]);
|
|
26
|
+
return /* @__PURE__ */ jsx(
|
|
27
|
+
Provider,
|
|
28
|
+
{
|
|
29
|
+
values: [
|
|
30
|
+
[
|
|
31
|
+
ModalVariantContext,
|
|
32
|
+
{ ...variantProps, classNames, buttonSize, slots }
|
|
33
|
+
]
|
|
34
|
+
],
|
|
35
|
+
children: /* @__PURE__ */ jsx(
|
|
36
|
+
ModalOverlay,
|
|
37
|
+
{
|
|
38
|
+
...props,
|
|
39
|
+
isDismissable,
|
|
40
|
+
className: composeRenderProps(
|
|
41
|
+
classNames?.overlay,
|
|
42
|
+
(className, renderProps) => slots.overlay({ className, ...renderProps })
|
|
43
|
+
),
|
|
44
|
+
children: /* @__PURE__ */ jsx(
|
|
45
|
+
Modal$1,
|
|
46
|
+
{
|
|
47
|
+
...props,
|
|
48
|
+
ref,
|
|
49
|
+
isDismissable,
|
|
50
|
+
"data-placement": variantProps.placement,
|
|
51
|
+
className: composeRenderProps(
|
|
52
|
+
props.className ?? classNames?.base,
|
|
53
|
+
(className, renderProps) => slots.base({ className, ...renderProps })
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
Modal.displayName = "Modal";
|
|
63
|
+
|
|
64
|
+
export { Modal };
|
|
@@ -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,20 @@
|
|
|
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: "M3 6h18", key: "d0wm0j" }],
|
|
13
|
+
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
14
|
+
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
|
|
15
|
+
["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
|
|
16
|
+
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
|
|
17
|
+
];
|
|
18
|
+
const Trash2 = createLucideIcon("Trash2", __iconNode);
|
|
19
|
+
|
|
20
|
+
export { __iconNode, Trash2 as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
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: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
13
|
+
["polyline", { points: "17 8 12 3 7 8", key: "t8dd8p" }],
|
|
14
|
+
["line", { x1: "12", x2: "12", y1: "3", y2: "15", key: "widbto" }]
|
|
15
|
+
];
|
|
16
|
+
const Upload = createLucideIcon("Upload", __iconNode);
|
|
17
|
+
|
|
18
|
+
export { __iconNode, Upload 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 { Button } from '../button/button.js';
|
|
7
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
8
|
+
import { Input } from '../input/input.js';
|
|
9
|
+
import { mapPropsVariants } from '../system/utils.js';
|
|
10
|
+
import Minus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.js';
|
|
11
|
+
import Plus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/plus.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,12 +6,12 @@ import { CalendarDate, today, getLocalTimeZone, getDayOfWeek } from '@internatio
|
|
|
6
6
|
import { RangeCalendar as RangeCalendar$1, Provider, CalendarGrid, CalendarGridBody, Text, RangeCalendarStateContext, useLocale, CalendarCell } from 'react-aria-components';
|
|
7
7
|
import { useDeepCompareMemo } from 'use-deep-compare';
|
|
8
8
|
import { calendarStyles, composeRenderProps, cn, dataAttr } from '@opengovsg/oui-theme';
|
|
9
|
+
import { CalendarStyleContext, useCalendarStyleContext } from '../calendar/calendar-style-context.js';
|
|
9
10
|
import { AgnosticCalendarStateContext } from '../calendar/agnostic-calendar-state-context.js';
|
|
10
11
|
import { CalendarBottomContent } from '../calendar/calendar-bottom-content.js';
|
|
11
12
|
import { CalendarGridHeader } from '../calendar/calendar-grid-header.js';
|
|
12
13
|
import { CalendarHeader } from '../calendar/calendar-header.js';
|
|
13
14
|
import { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
|
|
14
|
-
import { CalendarStyleContext, useCalendarStyleContext } from '../calendar/calendar-style-context.js';
|
|
15
15
|
|
|
16
16
|
const RangeCalendar = forwardRefGeneric(function RangeCalendar2(originalProps, ref) {
|
|
17
17
|
const [props, variantProps] = mapPropsVariants(
|
|
@@ -4,12 +4,12 @@ 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 { Button } from '../button/button.js';
|
|
7
8
|
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
9
|
import { Popover } from '../popover/popover.js';
|
|
9
10
|
import { mapPropsVariants } from '../system/utils.js';
|
|
10
11
|
import { SelectVariantContext } from './select-variant-context.js';
|
|
11
12
|
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';
|
|
12
|
-
import { Button } from '../button/button.js';
|
|
13
13
|
|
|
14
14
|
const calculateEstimatedRowHeight = (size) => {
|
|
15
15
|
switch (size) {
|
|
@@ -70,48 +70,48 @@ export declare function useBadge(originalProps: UseBadgeProps): {
|
|
|
70
70
|
};
|
|
71
71
|
}, undefined, "outline-offset-2 outline-none", unknown, unknown, undefined>>>;
|
|
72
72
|
base: ((slotProps?: ({
|
|
73
|
+
isDisabled?: boolean | undefined;
|
|
73
74
|
size?: "md" | "sm" | "xs" | undefined;
|
|
74
75
|
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
75
|
-
radius?: "
|
|
76
|
+
radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
|
|
76
77
|
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
77
|
-
isDisabled?: boolean | undefined;
|
|
78
78
|
isCloseable?: boolean | undefined;
|
|
79
79
|
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string) & ((slotProps?: ({
|
|
80
|
+
isDisabled?: boolean | undefined;
|
|
80
81
|
size?: "md" | "sm" | "xs" | undefined;
|
|
81
82
|
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
82
|
-
radius?: "
|
|
83
|
+
radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
|
|
83
84
|
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
84
|
-
isDisabled?: boolean | undefined;
|
|
85
85
|
isCloseable?: boolean | undefined;
|
|
86
86
|
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string);
|
|
87
87
|
dot: ((slotProps?: ({
|
|
88
|
+
isDisabled?: boolean | undefined;
|
|
88
89
|
size?: "md" | "sm" | "xs" | undefined;
|
|
89
90
|
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
90
|
-
radius?: "
|
|
91
|
+
radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
|
|
91
92
|
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
92
|
-
isDisabled?: boolean | undefined;
|
|
93
93
|
isCloseable?: boolean | undefined;
|
|
94
94
|
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string) & ((slotProps?: ({
|
|
95
|
+
isDisabled?: boolean | undefined;
|
|
95
96
|
size?: "md" | "sm" | "xs" | undefined;
|
|
96
97
|
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
97
|
-
radius?: "
|
|
98
|
+
radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
|
|
98
99
|
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
99
|
-
isDisabled?: boolean | undefined;
|
|
100
100
|
isCloseable?: boolean | undefined;
|
|
101
101
|
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string);
|
|
102
102
|
content: ((slotProps?: ({
|
|
103
|
+
isDisabled?: boolean | undefined;
|
|
103
104
|
size?: "md" | "sm" | "xs" | undefined;
|
|
104
105
|
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
105
|
-
radius?: "
|
|
106
|
+
radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
|
|
106
107
|
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
107
|
-
isDisabled?: boolean | undefined;
|
|
108
108
|
isCloseable?: boolean | undefined;
|
|
109
109
|
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string) & ((slotProps?: ({
|
|
110
|
+
isDisabled?: boolean | undefined;
|
|
110
111
|
size?: "md" | "sm" | "xs" | undefined;
|
|
111
112
|
color?: "sub" | "main" | "neutral" | "critical" | "warning" | "success" | undefined;
|
|
112
|
-
radius?: "
|
|
113
|
+
radius?: "none" | "lg" | "md" | "sm" | "full" | undefined;
|
|
113
114
|
variant?: "solid" | "outline" | "dot" | "subtle" | undefined;
|
|
114
|
-
isDisabled?: boolean | undefined;
|
|
115
115
|
isCloseable?: boolean | undefined;
|
|
116
116
|
} & import("tailwind-variants").ClassProp<import("tailwind-merge").ClassNameValue>) | undefined) => string);
|
|
117
117
|
};
|
|
@@ -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"}
|