@opengovsg/oui 0.0.0-snapshot-20250311073924
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/LICENSE.md +13 -0
- package/dist/cjs/banner/banner.cjs +118 -0
- package/dist/cjs/banner/index.cjs +8 -0
- package/dist/cjs/button/button.cjs +86 -0
- package/dist/cjs/button/index.cjs +8 -0
- package/dist/cjs/combo-box/combo-box-fuzzy.cjs +107 -0
- package/dist/cjs/combo-box/combo-box.cjs +277 -0
- package/dist/cjs/combo-box/index.cjs +12 -0
- package/dist/cjs/field/field.cjs +63 -0
- package/dist/cjs/field/index.cjs +11 -0
- package/dist/cjs/govt-banner/govt-banner.cjs +259 -0
- package/dist/cjs/govt-banner/index.cjs +8 -0
- package/dist/cjs/hooks/index.cjs +8 -0
- package/dist/cjs/hooks/use-callback-ref.cjs +17 -0
- package/dist/cjs/hooks/use-controllable-state.cjs +37 -0
- package/dist/cjs/index.cjs +47 -0
- package/dist/cjs/input/index.cjs +8 -0
- package/dist/cjs/input/input.cjs +28 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/Icon.cjs +48 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +30 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +24 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs +19 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs +19 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs +23 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/external-link.cjs +23 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/info.cjs +23 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/landmark.cjs +26 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/lock.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/x.cjs +22 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +16 -0
- package/dist/cjs/ripple/index.cjs +10 -0
- package/dist/cjs/ripple/ripple.cjs +70 -0
- package/dist/cjs/ripple/use-ripple.cjs +29 -0
- package/dist/cjs/skip-nav-link/index.cjs +8 -0
- package/dist/cjs/skip-nav-link/skip-nav-link.cjs +18 -0
- package/dist/cjs/spinner/index.cjs +10 -0
- package/dist/cjs/spinner/spinner.cjs +17 -0
- package/dist/cjs/spinner/use-spinner.cjs +38 -0
- package/dist/cjs/system/react-utils/context.cjs +31 -0
- package/dist/cjs/system/react-utils/index.cjs +8 -0
- package/dist/cjs/system/types.cjs +3 -0
- package/dist/cjs/system/utils.cjs +101 -0
- package/dist/cjs/tag-field/index.cjs +8 -0
- package/dist/cjs/tag-field/tag-field-list.cjs +73 -0
- package/dist/cjs/tag-field/tag-field-root.cjs +184 -0
- package/dist/cjs/tag-field/tag-field-state-context.cjs +11 -0
- package/dist/cjs/tag-field/tag-field-tag-list.cjs +70 -0
- package/dist/cjs/tag-field/tag-field-trigger.cjs +27 -0
- package/dist/cjs/tag-field/tag-field.cjs +106 -0
- package/dist/cjs/tag-field/types.cjs +3 -0
- package/dist/cjs/tag-field/use-tag-field-state.cjs +103 -0
- package/dist/cjs/tag-field/use-tag-field.cjs +188 -0
- package/dist/cjs/text-area/index.cjs +8 -0
- package/dist/cjs/text-area/text-area.cjs +28 -0
- package/dist/cjs/text-area-field/index.cjs +8 -0
- package/dist/cjs/text-area-field/text-area-field.cjs +48 -0
- package/dist/cjs/text-field/index.cjs +8 -0
- package/dist/cjs/text-field/text-field.cjs +48 -0
- package/dist/cjs/toggle/index.cjs +8 -0
- package/dist/cjs/toggle/toggle.cjs +48 -0
- package/dist/esm/banner/banner.js +116 -0
- package/dist/esm/banner/index.js +2 -0
- package/dist/esm/button/button.js +84 -0
- package/dist/esm/button/index.js +2 -0
- package/dist/esm/combo-box/combo-box-fuzzy.js +105 -0
- package/dist/esm/combo-box/combo-box.js +273 -0
- package/dist/esm/combo-box/index.js +3 -0
- package/dist/esm/field/field.js +58 -0
- package/dist/esm/field/index.js +2 -0
- package/dist/esm/govt-banner/govt-banner.js +257 -0
- package/dist/esm/govt-banner/index.js +2 -0
- package/dist/esm/hooks/index.js +2 -0
- package/dist/esm/hooks/use-callback-ref.js +15 -0
- package/dist/esm/hooks/use-controllable-state.js +35 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/input/index.js +2 -0
- package/dist/esm/input/input.js +26 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/Icon.js +44 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/createLucideIcon.js +26 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/defaultAttributes.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/chevron-down.js +14 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-up.js +14 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/circle-alert.js +18 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/external-link.js +18 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/info.js +18 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/landmark.js +21 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/lock.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/x.js +17 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/shared/src/utils.js +13 -0
- package/dist/esm/ripple/index.js +3 -0
- package/dist/esm/ripple/ripple.js +49 -0
- package/dist/esm/ripple/use-ripple.js +27 -0
- package/dist/esm/skip-nav-link/index.js +2 -0
- package/dist/esm/skip-nav-link/skip-nav-link.js +16 -0
- package/dist/esm/spinner/index.js +3 -0
- package/dist/esm/spinner/spinner.js +15 -0
- package/dist/esm/spinner/use-spinner.js +36 -0
- package/dist/esm/system/react-utils/context.js +29 -0
- package/dist/esm/system/react-utils/index.js +2 -0
- package/dist/esm/system/types.js +1 -0
- package/dist/esm/system/utils.js +94 -0
- package/dist/esm/tag-field/index.js +2 -0
- package/dist/esm/tag-field/tag-field-list.js +69 -0
- package/dist/esm/tag-field/tag-field-root.js +182 -0
- package/dist/esm/tag-field/tag-field-state-context.js +9 -0
- package/dist/esm/tag-field/tag-field-tag-list.js +68 -0
- package/dist/esm/tag-field/tag-field-trigger.js +24 -0
- package/dist/esm/tag-field/tag-field.js +104 -0
- package/dist/esm/tag-field/types.js +1 -0
- package/dist/esm/tag-field/use-tag-field-state.js +101 -0
- package/dist/esm/tag-field/use-tag-field.js +186 -0
- package/dist/esm/text-area/index.js +2 -0
- package/dist/esm/text-area/text-area.js +26 -0
- package/dist/esm/text-area-field/index.js +2 -0
- package/dist/esm/text-area-field/text-area-field.js +46 -0
- package/dist/esm/text-field/index.js +2 -0
- package/dist/esm/text-field/text-field.js +46 -0
- package/dist/esm/toggle/index.js +2 -0
- package/dist/esm/toggle/toggle.js +46 -0
- package/dist/types/banner/banner.d.ts +19 -0
- package/dist/types/banner/banner.d.ts.map +1 -0
- package/dist/types/banner/index.d.ts +2 -0
- package/dist/types/banner/index.d.ts.map +1 -0
- package/dist/types/button/button.d.ts +48 -0
- package/dist/types/button/button.d.ts.map +1 -0
- package/dist/types/button/index.d.ts +2 -0
- package/dist/types/button/index.d.ts.map +1 -0
- package/dist/types/combo-box/combo-box-fuzzy.d.ts +11 -0
- package/dist/types/combo-box/combo-box-fuzzy.d.ts.map +1 -0
- package/dist/types/combo-box/combo-box.d.ts +50 -0
- package/dist/types/combo-box/combo-box.d.ts.map +1 -0
- package/dist/types/combo-box/index.d.ts +3 -0
- package/dist/types/combo-box/index.d.ts.map +1 -0
- package/dist/types/field/field.d.ts +14 -0
- package/dist/types/field/field.d.ts.map +1 -0
- package/dist/types/field/index.d.ts +2 -0
- package/dist/types/field/index.d.ts.map +1 -0
- package/dist/types/govt-banner/govt-banner.d.ts +39 -0
- package/dist/types/govt-banner/govt-banner.d.ts.map +1 -0
- package/dist/types/govt-banner/index.d.ts +2 -0
- package/dist/types/govt-banner/index.d.ts.map +1 -0
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/index.d.ts.map +1 -0
- package/dist/types/hooks/use-callback-ref.d.ts +6 -0
- package/dist/types/hooks/use-callback-ref.d.ts.map +1 -0
- package/dist/types/hooks/use-controllable-state.d.ts +11 -0
- package/dist/types/hooks/use-controllable-state.d.ts.map +1 -0
- package/dist/types/index.d.mts +16 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/input/index.d.ts +2 -0
- package/dist/types/input/index.d.ts.map +1 -0
- package/dist/types/input/input.d.ts +9 -0
- package/dist/types/input/input.d.ts.map +1 -0
- package/dist/types/ripple/index.d.ts +3 -0
- package/dist/types/ripple/index.d.ts.map +1 -0
- package/dist/types/ripple/ripple.d.ts +10 -0
- package/dist/types/ripple/ripple.d.ts.map +1 -0
- package/dist/types/ripple/use-ripple.d.ts +15 -0
- package/dist/types/ripple/use-ripple.d.ts.map +1 -0
- package/dist/types/skip-nav-link/index.d.ts +2 -0
- package/dist/types/skip-nav-link/index.d.ts.map +1 -0
- package/dist/types/skip-nav-link/skip-nav-link.d.ts +11 -0
- package/dist/types/skip-nav-link/skip-nav-link.d.ts.map +1 -0
- package/dist/types/spinner/index.d.ts +3 -0
- package/dist/types/spinner/index.d.ts.map +1 -0
- package/dist/types/spinner/spinner.d.ts +4 -0
- package/dist/types/spinner/spinner.d.ts.map +1 -0
- package/dist/types/spinner/use-spinner.d.ts +66 -0
- package/dist/types/spinner/use-spinner.d.ts.map +1 -0
- package/dist/types/system/react-utils/context.d.ts +27 -0
- package/dist/types/system/react-utils/context.d.ts.map +1 -0
- package/dist/types/system/react-utils/index.d.ts +2 -0
- package/dist/types/system/react-utils/index.d.ts.map +1 -0
- package/dist/types/system/types.d.ts +63 -0
- package/dist/types/system/types.d.ts.map +1 -0
- package/dist/types/system/utils.d.ts +856 -0
- package/dist/types/system/utils.d.ts.map +1 -0
- package/dist/types/tag-field/index.d.ts +2 -0
- package/dist/types/tag-field/index.d.ts.map +1 -0
- package/dist/types/tag-field/tag-field-list.d.ts +22 -0
- package/dist/types/tag-field/tag-field-list.d.ts.map +1 -0
- package/dist/types/tag-field/tag-field-root.d.ts +14 -0
- package/dist/types/tag-field/tag-field-root.d.ts.map +1 -0
- package/dist/types/tag-field/tag-field-state-context.d.ts +12 -0
- package/dist/types/tag-field/tag-field-state-context.d.ts.map +1 -0
- package/dist/types/tag-field/tag-field-tag-list.d.ts +17 -0
- package/dist/types/tag-field/tag-field-tag-list.d.ts.map +1 -0
- package/dist/types/tag-field/tag-field-trigger.d.ts +8 -0
- package/dist/types/tag-field/tag-field-trigger.d.ts.map +1 -0
- package/dist/types/tag-field/tag-field.d.ts +3 -0
- package/dist/types/tag-field/tag-field.d.ts.map +1 -0
- package/dist/types/tag-field/types.d.ts +71 -0
- package/dist/types/tag-field/types.d.ts.map +1 -0
- package/dist/types/tag-field/use-tag-field-state.d.ts +35 -0
- package/dist/types/tag-field/use-tag-field-state.d.ts.map +1 -0
- package/dist/types/tag-field/use-tag-field.d.ts +48 -0
- package/dist/types/tag-field/use-tag-field.d.ts.map +1 -0
- package/dist/types/text-area/index.d.ts +2 -0
- package/dist/types/text-area/index.d.ts.map +1 -0
- package/dist/types/text-area/text-area.d.ts +9 -0
- package/dist/types/text-area/text-area.d.ts.map +1 -0
- package/dist/types/text-area-field/index.d.ts +2 -0
- package/dist/types/text-area-field/index.d.ts.map +1 -0
- package/dist/types/text-area-field/text-area-field.d.ts +12 -0
- package/dist/types/text-area-field/text-area-field.d.ts.map +1 -0
- package/dist/types/text-field/index.d.ts +2 -0
- package/dist/types/text-field/index.d.ts.map +1 -0
- package/dist/types/text-field/text-field.d.ts +12 -0
- package/dist/types/text-field/text-field.d.ts.map +1 -0
- package/dist/types/toggle/index.d.ts +2 -0
- package/dist/types/toggle/index.d.ts.map +1 -0
- package/dist/types/toggle/toggle.d.ts +22 -0
- package/dist/types/toggle/toggle.d.ts.map +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { composeRenderProps, textAreaStyles } from '@opengovsg/oui-theme';
|
|
6
|
+
import { TextArea as TextArea$1 } from 'react-aria-components';
|
|
7
|
+
|
|
8
|
+
const TextArea = forwardRef(
|
|
9
|
+
({ size, variant, isDisabled, ...props }, ref) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
TextArea$1,
|
|
12
|
+
{
|
|
13
|
+
...props,
|
|
14
|
+
disabled: isDisabled,
|
|
15
|
+
className: composeRenderProps(
|
|
16
|
+
props.className,
|
|
17
|
+
(className, renderProps) => textAreaStyles({ ...renderProps, className, size, variant })
|
|
18
|
+
),
|
|
19
|
+
ref
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
TextArea.displayName = "TextArea";
|
|
25
|
+
|
|
26
|
+
export { TextArea };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
5
|
+
import { TextField } from 'react-aria-components';
|
|
6
|
+
import { TextArea } from '../text-area/text-area.js';
|
|
7
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
|
+
|
|
9
|
+
function TextAreaField({
|
|
10
|
+
label,
|
|
11
|
+
description,
|
|
12
|
+
errorMessage,
|
|
13
|
+
classNames,
|
|
14
|
+
className,
|
|
15
|
+
inputProps,
|
|
16
|
+
size,
|
|
17
|
+
variant,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
TextField,
|
|
22
|
+
{
|
|
23
|
+
...props,
|
|
24
|
+
className: composeTailwindRenderProps(
|
|
25
|
+
className ?? classNames?.base,
|
|
26
|
+
"flex flex-col gap-2"
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
label && /* @__PURE__ */ jsx(Label, { size, className: classNames?.label, children: label }),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
TextArea,
|
|
32
|
+
{
|
|
33
|
+
size,
|
|
34
|
+
variant,
|
|
35
|
+
className: classNames?.input,
|
|
36
|
+
...inputProps
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
description && /* @__PURE__ */ jsx(Description, { size, className: classNames?.description, children: description }),
|
|
40
|
+
/* @__PURE__ */ jsx(FieldError, { size, className: classNames?.error, children: errorMessage })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { TextAreaField };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
5
|
+
import { TextField as TextField$1 } from 'react-aria-components';
|
|
6
|
+
import { Input } from '../input/input.js';
|
|
7
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
|
+
|
|
9
|
+
function TextField({
|
|
10
|
+
label,
|
|
11
|
+
description,
|
|
12
|
+
errorMessage,
|
|
13
|
+
classNames,
|
|
14
|
+
className,
|
|
15
|
+
inputProps,
|
|
16
|
+
size,
|
|
17
|
+
variant,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
TextField$1,
|
|
22
|
+
{
|
|
23
|
+
...props,
|
|
24
|
+
className: composeTailwindRenderProps(
|
|
25
|
+
className ?? classNames?.base,
|
|
26
|
+
"flex flex-col gap-2"
|
|
27
|
+
),
|
|
28
|
+
children: [
|
|
29
|
+
label && /* @__PURE__ */ jsx(Label, { size, className: classNames?.label, children: label }),
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
Input,
|
|
32
|
+
{
|
|
33
|
+
size,
|
|
34
|
+
variant,
|
|
35
|
+
className: classNames?.input,
|
|
36
|
+
...inputProps
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
description && /* @__PURE__ */ jsx(Description, { size, className: classNames?.description, children: description }),
|
|
40
|
+
/* @__PURE__ */ jsx(FieldError, { size, className: classNames?.error, children: errorMessage })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { TextField };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { useCallback, cloneElement } from 'react';
|
|
5
|
+
import { toggleStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
6
|
+
import { mergeProps } from 'react-aria';
|
|
7
|
+
import { Switch } from 'react-aria-components';
|
|
8
|
+
import { mapPropsVariants } from '../system/utils.js';
|
|
9
|
+
|
|
10
|
+
const Toggle = ({
|
|
11
|
+
children,
|
|
12
|
+
classNames,
|
|
13
|
+
thumbIcon,
|
|
14
|
+
...originalProps
|
|
15
|
+
}) => {
|
|
16
|
+
const [props, variantProps] = mapPropsVariants(
|
|
17
|
+
originalProps,
|
|
18
|
+
toggleStyles.variantKeys
|
|
19
|
+
);
|
|
20
|
+
const slots = toggleStyles(variantProps);
|
|
21
|
+
const clonedThumbIcon = useCallback(
|
|
22
|
+
(renderProps) => {
|
|
23
|
+
const baseProps = {
|
|
24
|
+
className: slots.thumbIcon({ className: classNames?.thumbIcon })
|
|
25
|
+
};
|
|
26
|
+
return typeof thumbIcon === "function" ? thumbIcon(mergeProps(baseProps, renderProps)) : thumbIcon && cloneElement(thumbIcon, baseProps);
|
|
27
|
+
},
|
|
28
|
+
[classNames?.thumbIcon, slots, thumbIcon]
|
|
29
|
+
);
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
Switch,
|
|
32
|
+
{
|
|
33
|
+
...props,
|
|
34
|
+
className: composeTailwindRenderProps(
|
|
35
|
+
props.className ?? classNames?.base,
|
|
36
|
+
slots.base()
|
|
37
|
+
),
|
|
38
|
+
children: (renderProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx("div", { className: slots.track({ className: classNames?.track }), children: /* @__PURE__ */ jsx("span", { className: slots.thumb({ className: classNames?.thumb }), children: thumbIcon && clonedThumbIcon(renderProps) }) }),
|
|
40
|
+
children
|
|
41
|
+
] })
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export { Toggle };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { BannerSlots, bannerStyles, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
|
|
3
|
+
import { AriaDisclosureProps } from "react-aria";
|
|
4
|
+
interface BannerProps extends VariantProps<typeof bannerStyles>, AriaDisclosureProps {
|
|
5
|
+
/**
|
|
6
|
+
* The banner start content. Will default to the relevant icons based on the `variant` prop.
|
|
7
|
+
*/
|
|
8
|
+
startContent?: React.ReactNode;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* If provided, the dismiss button will be rendered.
|
|
12
|
+
*/
|
|
13
|
+
isDismissable?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
classNames?: SlotsToClasses<BannerSlots>;
|
|
16
|
+
}
|
|
17
|
+
export declare const Banner: ({ variant, size, children, isDismissable, startContent: startContentProp, className, classNames, defaultExpanded, ...disclosureProps }: BannerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/banner/banner.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAmB,MAAM,OAAO,CAAA;AAClD,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,mBAAmB,EAIpB,MAAM,YAAY,CAAA;AAKnB,UAAU,WACR,SAAQ,YAAY,CAAC,OAAO,YAAY,CAAC,EACvC,mBAAmB;IACrB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,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,mDA6Eb,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/banner/index.tsx"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { VariantProps } from "@opengovsg/oui-theme";
|
|
2
|
+
import type { ButtonProps as AriaButtonProps } from "react-aria-components";
|
|
3
|
+
import { buttonStyles } from "@opengovsg/oui-theme";
|
|
4
|
+
interface _ButtonProps extends Omit<AriaButtonProps, "children">, VariantProps<typeof buttonStyles> {
|
|
5
|
+
/**
|
|
6
|
+
* Whether the button should display a ripple effect on press.
|
|
7
|
+
* @defaultValue false
|
|
8
|
+
*/
|
|
9
|
+
disableRipple?: boolean;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The button start content.
|
|
13
|
+
*/
|
|
14
|
+
startContent?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The button end content.
|
|
17
|
+
*/
|
|
18
|
+
endContent?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Spinner to display when loading.
|
|
21
|
+
* @defaultValue \@opengovsg/oui/components/spinner
|
|
22
|
+
*/
|
|
23
|
+
spinner?: React.ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Text to show when the button is loading.
|
|
26
|
+
* If not provided, the button will only show the loading spinner.
|
|
27
|
+
*/
|
|
28
|
+
loadingText?: string;
|
|
29
|
+
/**
|
|
30
|
+
* The spinner placement.
|
|
31
|
+
* @defaultValue "start"
|
|
32
|
+
*/
|
|
33
|
+
spinnerPlacement?: "start" | "end";
|
|
34
|
+
}
|
|
35
|
+
export type ButtonProps = Omit<_ButtonProps, "aria-label"> & ({
|
|
36
|
+
isIconOnly: true;
|
|
37
|
+
"aria-label": string;
|
|
38
|
+
} | {
|
|
39
|
+
isIconOnly?: false;
|
|
40
|
+
"aria-label"?: string;
|
|
41
|
+
});
|
|
42
|
+
/**
|
|
43
|
+
* You probably do not want to use this component if you are rendering a link.
|
|
44
|
+
* Use `LinkButton` component instead.
|
|
45
|
+
*/
|
|
46
|
+
export declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/button/button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE3E,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAQnD,UAAU,YACR,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EACvC,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAEzB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;CACnC;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,EAAE,YAAY,CAAC,GACxD,CACI;IAAE,UAAU,EAAE,IAAI,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,UAAU,CAAC,EAAE,KAAK,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,CAChD,CAAA;AAEH;;;GAGG;AACH,eAAO,MAAM,MAAM,2GAwElB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/button/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SlotsToClasses } from "@opengovsg/oui-theme";
|
|
2
|
+
import { SetRequired } from "type-fest";
|
|
3
|
+
import { ComboBoxItem, ComboBoxProps } from "./combo-box";
|
|
4
|
+
export interface ComboBoxFuzzyProps<T extends ComboBoxItem = ComboBoxItem> extends SetRequired<ComboBoxProps<T>, "inputValue" | "onInputChange" | "onSelectionChange" | "selectedKey" | "items"> {
|
|
5
|
+
itemClassNames?: ComboBoxProps<T>["itemClassNames"] & SlotsToClasses<"highlight">;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Controlled variant of ComboBox, allows for fuzzy search and item highlight.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ComboBoxFuzzy<T extends ComboBoxItem = ComboBoxItem>({ items, itemClassNames, onSelectionChange: onSelectionChangeProp, onInputChange: onInputChangeProp, ...props }: ComboBoxFuzzyProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=combo-box-fuzzy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combo-box-fuzzy.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box-fuzzy.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,cAAc,EACf,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,OAAO,EAAY,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AA8BnE,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,CACvE,SAAQ,WAAW,CACjB,aAAa,CAAC,CAAC,CAAC,EACd,YAAY,GACZ,eAAe,GACf,mBAAmB,GACnB,aAAa,GACb,OAAO,CACV;IACD,cAAc,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,GACjD,cAAc,CAAC,WAAW,CAAC,CAAA;CAC9B;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EAAE,EACnE,KAAK,EACL,cAAc,EACd,iBAAiB,EAAE,qBAAqB,EACxC,aAAa,EAAE,iBAAiB,EAChC,GAAG,KAAK,EACT,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAyEvB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { JSX } from "react";
|
|
2
|
+
import { ComboBoxItemSlots, ComboBoxItemVariantProps, ComboBoxSlots, ComboBoxVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
3
|
+
import { ComboBoxProps as AriaComboBoxProps, ListBoxItemProps, ListBoxItemRenderProps, ListBoxProps, ListLayoutOptions, ValidationResult } from "react-aria-components";
|
|
4
|
+
export type ComboBoxItem = {
|
|
5
|
+
value: string;
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
};
|
|
9
|
+
export interface ComboBoxProps<T extends ComboBoxItem = ComboBoxItem> extends ComboBoxVariantProps, Omit<AriaComboBoxProps<T>, "children"> {
|
|
10
|
+
label?: string;
|
|
11
|
+
/** The list of ComboBox items (uncontrolled). */
|
|
12
|
+
defaultItems?: T[];
|
|
13
|
+
/** The list of ComboBox items (controlled). */
|
|
14
|
+
items?: T[];
|
|
15
|
+
description?: string | null;
|
|
16
|
+
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
17
|
+
classNames?: SlotsToClasses<ComboBoxSlots> & SlotsToClasses<"clearButton" | "emptyState">;
|
|
18
|
+
itemClassNames?: SlotsToClasses<ComboBoxItemSlots>;
|
|
19
|
+
/**
|
|
20
|
+
* Any additional props to be spread to the list layout.
|
|
21
|
+
*/
|
|
22
|
+
listLayoutOptions?: ListLayoutOptions;
|
|
23
|
+
children?: (item: T) => JSX.Element;
|
|
24
|
+
/** Values that should invalidate the item cache when using dynamic collections. */
|
|
25
|
+
dependencies?: ListBoxProps<T>["dependencies"];
|
|
26
|
+
/**
|
|
27
|
+
* If provided, a clear button will be rendered next to the expand button.
|
|
28
|
+
*
|
|
29
|
+
* This callback will be called when the clear button is clicked.
|
|
30
|
+
*
|
|
31
|
+
* To use this, this component must be a controlled component with externally
|
|
32
|
+
* handled `inputValue`, `onInputChange`, `selectedKey` and `onSelectionChange` state.
|
|
33
|
+
*/
|
|
34
|
+
onClear?: () => void;
|
|
35
|
+
renderEmptyState?: ListBoxProps<T>["renderEmptyState"];
|
|
36
|
+
}
|
|
37
|
+
export declare function ComboBoxEmptyState({ size, className, }: Pick<ComboBoxVariantProps, "size"> & {
|
|
38
|
+
className?: string;
|
|
39
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function ComboBox<T extends ComboBoxItem>({ label, description, errorMessage, classNames, itemClassNames, size, listLayoutOptions, children, dependencies, onClear, renderEmptyState: renderEmptyStateProp, ...props }: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export interface ComboBoxItemProps extends ListBoxItemProps, ComboBoxItemVariantProps {
|
|
42
|
+
label: React.ReactNode | ((props: ListBoxItemRenderProps) => React.ReactNode);
|
|
43
|
+
/**
|
|
44
|
+
* Description for the item, if any
|
|
45
|
+
*/
|
|
46
|
+
description?: React.ReactNode | ((props: ListBoxItemRenderProps) => React.ReactNode);
|
|
47
|
+
classNames?: SlotsToClasses<ComboBoxItemSlots>;
|
|
48
|
+
}
|
|
49
|
+
export declare function ComboBoxItem({ className, size, description, label, classNames, ...props }: ComboBoxItemProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
//# sourceMappingURL=combo-box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,GAAG,EAAwB,MAAM,OAAO,CAAA;AACxD,OAAO,EAGL,iBAAiB,EAEjB,wBAAwB,EACxB,aAAa,EAEb,oBAAoB,EAGpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAG7B,OAAO,EAGL,aAAa,IAAI,iBAAiB,EAIlC,gBAAgB,EAChB,sBAAsB,EACtB,YAAY,EAEZ,iBAAiB,EAKjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAI9B,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,CAClE,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,EAAE,CAAA;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAClE,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,GACxC,cAAc,CAAC,aAAa,GAAG,YAAY,CAAC,CAAA;IAC9C,cAAc,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;IAClD;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,CAAC,OAAO,CAAA;IAEnC,mFAAmF;IACnF,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAA;IAE9C;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB,gBAAgB,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAA;CACvD;AAkCD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,SAAS,GACV,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAY7D;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,YAAY,EAAE,EAC/C,KAAK,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,cAAc,EACd,IAAI,EACJ,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,gBAAgB,EAAE,oBAAoB,EACtC,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,CAAC,CAAC,2CAwJlB;AAED,MAAM,WAAW,iBACf,SAAQ,gBAAgB,EACtB,wBAAwB;IAC1B,KAAK,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,KAAK,EAAE,sBAAsB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAC7E;;OAEG;IACH,WAAW,CAAC,EACR,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,KAAK,EAAE,sBAAsB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IACxD,UAAU,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC/C;AAED,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,IAAI,EACJ,WAAW,EACX,KAAK,EACL,UAAU,EACV,GAAG,KAAK,EACT,EAAE,iBAAiB,2CAqCnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/combo-box/index.tsx"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DescriptionVariantProps, FieldErrorSlots, FieldErrorVariantProps, LabelVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
2
|
+
import { FieldErrorProps as AriaFieldErrorProps, LabelProps as AriaLabelProps, GroupProps, TextProps } from "react-aria-components";
|
|
3
|
+
export interface LabelProps extends AriaLabelProps, LabelVariantProps {
|
|
4
|
+
}
|
|
5
|
+
export declare function Label({ size, className, ...props }: LabelProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export interface DescriptionProps extends TextProps, DescriptionVariantProps {
|
|
7
|
+
}
|
|
8
|
+
export declare function Description({ size, className, ...props }: DescriptionProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export interface FieldErrorProps extends AriaFieldErrorProps, FieldErrorVariantProps {
|
|
10
|
+
classNames?: SlotsToClasses<FieldErrorSlots>;
|
|
11
|
+
}
|
|
12
|
+
export declare function FieldError({ children, className, size, classNames, ...props }: FieldErrorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
|
+
export declare function FieldGroup(props: GroupProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/field/field.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,uBAAuB,EACvB,eAAe,EAEf,sBAAsB,EAGtB,iBAAiB,EACjB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAEL,eAAe,IAAI,mBAAmB,EAEtC,UAAU,IAAI,cAAc,EAE5B,UAAU,EAEV,SAAS,EACV,MAAM,uBAAuB,CAAA;AAE9B,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,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,UAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,kDAmBjB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,2CAS3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/field/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { GovtBannerSlots, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
2
|
+
import type { DisclosureProps } from "react-stately";
|
|
3
|
+
import type { LiteralUnion } from "type-fest";
|
|
4
|
+
interface GovtBannerProps extends DisclosureProps {
|
|
5
|
+
/**
|
|
6
|
+
* The environment of the application. If provided, the banner will display a note indicating the environment:
|
|
7
|
+
* ```
|
|
8
|
+
* [NOTE: THIS IS A {environment} WEBSITE]
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
environment?: LiteralUnion<"production" | "staging" | "uat" | "preview", string>;
|
|
12
|
+
/**
|
|
13
|
+
* List of classes to change the className of the element.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```text
|
|
17
|
+
* Component: GovtBanner
|
|
18
|
+
*
|
|
19
|
+
* Class names:
|
|
20
|
+
* - banner: the wrapper of the full government banner component,
|
|
21
|
+
* - mainContentContainer: the wrapper of the main content of the banner
|
|
22
|
+
* - crest: the SVG of the government crest
|
|
23
|
+
* - mainContent: the main content of the banner
|
|
24
|
+
* - link: link stylings
|
|
25
|
+
* - identifyButton: for the "how to identify" button
|
|
26
|
+
* - chevron: the chevron icon beside the "how to identify" button
|
|
27
|
+
* - panel: the wrapper for the panel that appears when the "how to identify" button is clicked
|
|
28
|
+
* - panelGroup: the wrapper for the panel group containing the icon and the panel section
|
|
29
|
+
* - panelIcon: the icon in the panel group
|
|
30
|
+
* - panelSection: the wrapper for the panel section containing the header and content
|
|
31
|
+
* - panelHeader: the header in the panel section
|
|
32
|
+
* - inlineIcon: the icon in the panel content
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
classNames?: SlotsToClasses<GovtBannerSlots>;
|
|
36
|
+
}
|
|
37
|
+
export declare function GovtBanner({ environment, classNames, ...props }: GovtBannerProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=govt-banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"govt-banner.d.ts","sourceRoot":"","sources":["../../../src/govt-banner/govt-banner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAa7C,UAAU,eAAgB,SAAQ,eAAe;IAC/C;;;;;OAKG;IACH,WAAW,CAAC,EAAE,YAAY,CACxB,YAAY,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAC5C,MAAM,CACP,CAAA;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAA;CAC7C;AAsDD,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,UAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CA2JjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/govt-banner/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This hook is user-land implementation of the experimental `useEffectEvent` hook.
|
|
3
|
+
* React docs: https://react.dev/learn/separating-events-from-effects#declaring-an-effect-event
|
|
4
|
+
*/
|
|
5
|
+
export declare function useCallbackRef<Args extends unknown[], Return>(callback: ((...args: Args) => Return) | undefined, deps?: React.DependencyList): (...args: Args) => Return | undefined;
|
|
6
|
+
//# sourceMappingURL=use-callback-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-callback-ref.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-callback-ref.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,MAAM,EAC3D,QAAQ,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC,GAAG,SAAS,EACjD,IAAI,GAAE,KAAK,CAAC,cAAmB,aAWF,IAAI,wBAClC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface UseControllableStateProps<T> {
|
|
2
|
+
value?: T;
|
|
3
|
+
defaultValue?: T | (() => T);
|
|
4
|
+
onChange?: (value: T) => void;
|
|
5
|
+
shouldUpdate?: (prev: T, next: T) => boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The `useControllableState` hook returns the state and function that updates the state, just like React.useState does.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useControllableState<T>(props: UseControllableStateProps<T>): [T, React.Dispatch<React.SetStateAction<T>>];
|
|
11
|
+
//# sourceMappingURL=use-controllable-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-controllable-state.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-controllable-state.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,yBAAyB,CAAC,CAAC;IAC1C,KAAK,CAAC,EAAE,CAAC,CAAA;IACT,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAA;IAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,OAAO,CAAA;CAC7C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC,GAiC7C,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CACzE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./hooks";
|
|
2
|
+
export * from "./button";
|
|
3
|
+
export * from "./govt-banner";
|
|
4
|
+
export * from "./ripple";
|
|
5
|
+
export * from "./spinner";
|
|
6
|
+
export * from "./toggle";
|
|
7
|
+
export * from "./skip-nav-link";
|
|
8
|
+
export * from "./input";
|
|
9
|
+
export * from "./text-field";
|
|
10
|
+
export * from "./field";
|
|
11
|
+
export * from "./text-area";
|
|
12
|
+
export * from "./text-area-field";
|
|
13
|
+
export * from "./combo-box";
|
|
14
|
+
export * from "./banner";
|
|
15
|
+
export * from "./tag-field";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from "./hooks";
|
|
2
|
+
export * from "./button";
|
|
3
|
+
export * from "./govt-banner";
|
|
4
|
+
export * from "./ripple";
|
|
5
|
+
export * from "./spinner";
|
|
6
|
+
export * from "./toggle";
|
|
7
|
+
export * from "./skip-nav-link";
|
|
8
|
+
export * from "./input";
|
|
9
|
+
export * from "./text-field";
|
|
10
|
+
export * from "./field";
|
|
11
|
+
export * from "./text-area";
|
|
12
|
+
export * from "./text-area-field";
|
|
13
|
+
export * from "./combo-box";
|
|
14
|
+
export * from "./banner";
|
|
15
|
+
export * from "./tag-field";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/input/index.tsx"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { inputStyles, VariantProps } from "@opengovsg/oui-theme";
|
|
2
|
+
import { InputProps as AriaInputProps } from "react-aria-components";
|
|
3
|
+
export interface InputProps extends VariantProps<typeof inputStyles>, Omit<AriaInputProps, "size"> {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* This component should not be used by itself. Use the `TextField` component from `@opengovsg/oui/text-field` instead.
|
|
7
|
+
*/
|
|
8
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../src/input/input.tsx"],"names":[],"mappings":"AAGA,OAAO,EAEL,WAAW,EACX,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAEL,UAAU,IAAI,cAAc,EAC7B,MAAM,uBAAuB,CAAA;AAE9B,MAAM,WAAW,UACf,SAAQ,YAAY,CAAC,OAAO,WAAW,CAAC,EACtC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;CAAG;AAEnC;;GAEG;AACH,eAAO,MAAM,KAAK,yGAejB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ripple/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { RippleType, UseRippleReturn } from "./use-ripple";
|
|
3
|
+
export interface RippleProps {
|
|
4
|
+
ripples: RippleType[];
|
|
5
|
+
color?: CSSProperties["backgroundColor"];
|
|
6
|
+
style?: CSSProperties;
|
|
7
|
+
onClear: UseRippleReturn["onClear"];
|
|
8
|
+
}
|
|
9
|
+
export declare function Ripple({ ripples, style, onClear, color, }: RippleProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=ripple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ripple.d.ts","sourceRoot":"","sources":["../../../src/ripple/ripple.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAK1C,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAE/D,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,KAAK,CAAC,EAAE,aAAa,CAAC,iBAAiB,CAAC,CAAA;IACxC,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAA;CACpC;AAED,wBAAgB,MAAM,CAAC,EACrB,OAAY,EACZ,KAAK,EACL,OAAO,EACP,KAAsB,GACvB,EAAE,WAAW,2CAyCb"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Key } from "react";
|
|
2
|
+
import type { PressEvent } from "react-aria-components";
|
|
3
|
+
export interface RippleType {
|
|
4
|
+
key: React.Key;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
size: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const useRipple: () => {
|
|
10
|
+
ripples: RippleType[];
|
|
11
|
+
onPress: (event: PressEvent) => void;
|
|
12
|
+
onClear: (key: Key) => void;
|
|
13
|
+
};
|
|
14
|
+
export type UseRippleReturn = ReturnType<typeof useRipple>;
|
|
15
|
+
//# sourceMappingURL=use-ripple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-ripple.d.ts","sourceRoot":"","sources":["../../../src/ripple/use-ripple.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAIvD,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,KAAK,CAAC,GAAG,CAAA;IACd,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,IAAI,EAAE,MAAM,CAAA;CACb;AAED,eAAO,MAAM,SAAS;;qBAGgB,UAAU;mBAgBZ,GAAG;CAKtC,CAAA;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skip-nav-link/index.tsx"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes } from "react";
|
|
2
|
+
import { skipNavLinkStyles, VariantProps } from "@opengovsg/oui-theme";
|
|
3
|
+
interface SkipNavLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "id" | "href">, VariantProps<typeof skipNavLinkStyles> {
|
|
4
|
+
/**
|
|
5
|
+
* The id of the element to skip to
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const SkipNavLink: ({ className, id, ...props }: SkipNavLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=skip-nav-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skip-nav-link.d.ts","sourceRoot":"","sources":["../../../src/skip-nav-link/skip-nav-link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEtE,UAAU,gBACR,SAAQ,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,EAClE,YAAY,CAAC,OAAO,iBAAiB,CAAC;IACxC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;CACX;AAED,eAAO,MAAM,WAAW,gCAAiC,gBAAgB,4CAQxE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/spinner/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../../src/spinner/spinner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAIpD,MAAM,MAAM,YAAY,GAAG,eAAe,CAAA;AAE1C,eAAO,MAAM,OAAO,2FAWlB,CAAA"}
|