@opengovsg/oui 0.0.9 → 0.0.11
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/button/button.cjs +1 -1
- package/dist/cjs/calendar/agnostic-calendar-state-context.cjs +13 -0
- package/dist/cjs/calendar/calendar-bottom-content.cjs +51 -0
- package/dist/cjs/calendar/calendar-grid-header.cjs +28 -0
- package/dist/cjs/calendar/calendar-header.cjs +74 -0
- package/dist/cjs/calendar/calendar-month-day-selector.cjs +86 -0
- package/dist/cjs/calendar/calendar-style-context.cjs +0 -25
- package/dist/cjs/calendar/calendar.cjs +143 -4
- package/dist/cjs/calendar/hooks/index.cjs +11 -0
- package/dist/cjs/calendar/hooks/use-calendar-i18n.cjs +33 -0
- package/dist/cjs/calendar/hooks/use-calendar-selectors.cjs +41 -0
- package/dist/cjs/calendar/index.cjs +1 -1
- package/dist/cjs/combo-box/combo-box-fuzzy.cjs +3 -3
- package/dist/cjs/combo-box/combo-box-item.cjs +2 -2
- package/dist/cjs/combo-box/combo-box.cjs +3 -2
- package/dist/cjs/index.cjs +38 -16
- package/dist/cjs/menu/index.cjs +15 -0
- package/dist/cjs/menu/menu.cjs +229 -0
- package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.cjs +19 -0
- package/dist/cjs/popover/index.cjs +8 -0
- package/dist/cjs/popover/popover.cjs +46 -0
- package/dist/cjs/range-calendar/index.cjs +10 -0
- package/dist/cjs/range-calendar/range-calendar.cjs +188 -0
- package/dist/cjs/select/select.cjs +4 -1
- package/dist/cjs/system/react-utils/context.cjs +3 -2
- package/dist/cjs/tabs/index.cjs +13 -0
- package/dist/cjs/tabs/tabs.cjs +97 -0
- package/dist/cjs/tag-field/tag-field-item.cjs +8 -3
- package/dist/cjs/tag-field/tag-field.cjs +2 -1
- package/dist/esm/button/button.js +1 -1
- package/dist/esm/calendar/agnostic-calendar-state-context.js +10 -0
- package/dist/esm/calendar/calendar-bottom-content.js +49 -0
- package/dist/esm/calendar/calendar-grid-header.js +26 -0
- package/dist/esm/calendar/calendar-header.js +72 -0
- package/dist/esm/calendar/calendar-month-day-selector.js +84 -0
- package/dist/esm/calendar/calendar-style-context.js +1 -25
- package/dist/esm/calendar/calendar.js +147 -9
- package/dist/esm/calendar/hooks/index.js +3 -0
- package/dist/esm/calendar/hooks/use-calendar-i18n.js +30 -0
- package/dist/esm/calendar/hooks/use-calendar-selectors.js +39 -0
- package/dist/esm/calendar/index.js +2 -2
- package/dist/esm/combo-box/combo-box-fuzzy.js +4 -4
- package/dist/esm/combo-box/combo-box-item.js +3 -3
- package/dist/esm/combo-box/combo-box.js +4 -3
- package/dist/esm/index.js +13 -9
- package/dist/esm/menu/index.js +2 -0
- package/dist/esm/menu/menu.js +220 -0
- package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.js +14 -0
- package/dist/esm/popover/index.js +2 -0
- package/dist/esm/popover/popover.js +44 -0
- package/dist/esm/range-calendar/index.js +2 -0
- package/dist/esm/range-calendar/range-calendar.js +184 -0
- package/dist/esm/select/select.js +5 -2
- package/dist/esm/system/react-utils/context.js +3 -2
- package/dist/esm/tabs/index.js +2 -0
- package/dist/esm/tabs/tabs.js +90 -0
- package/dist/esm/tag-field/tag-field-item.js +9 -4
- package/dist/esm/tag-field/tag-field.js +3 -2
- package/dist/types/calendar/agnostic-calendar-state-context.d.ts +3 -0
- package/dist/types/calendar/agnostic-calendar-state-context.d.ts.map +1 -0
- package/dist/types/calendar/calendar-bottom-content.d.ts +4 -0
- package/dist/types/calendar/calendar-bottom-content.d.ts.map +1 -0
- package/dist/types/calendar/calendar-grid-header.d.ts +2 -0
- package/dist/types/calendar/calendar-grid-header.d.ts.map +1 -0
- package/dist/types/calendar/calendar-header.d.ts +6 -0
- package/dist/types/calendar/calendar-header.d.ts.map +1 -0
- package/dist/types/calendar/calendar-month-day-selector.d.ts +2 -0
- package/dist/types/calendar/calendar-month-day-selector.d.ts.map +1 -0
- package/dist/types/calendar/calendar-style-context.d.ts +10 -1030
- package/dist/types/calendar/calendar-style-context.d.ts.map +1 -1
- package/dist/types/calendar/calendar.d.ts +5 -2
- package/dist/types/calendar/calendar.d.ts.map +1 -1
- package/dist/types/calendar/hooks/index.d.ts +3 -0
- package/dist/types/calendar/hooks/index.d.ts.map +1 -0
- package/dist/types/calendar/hooks/use-calendar-i18n.d.ts +4 -0
- package/dist/types/calendar/hooks/use-calendar-i18n.d.ts.map +1 -0
- package/dist/types/calendar/hooks/use-calendar-selectors.d.ts +13 -0
- package/dist/types/calendar/hooks/use-calendar-selectors.d.ts.map +1 -0
- package/dist/types/calendar/types.d.ts +5 -4
- package/dist/types/calendar/types.d.ts.map +1 -1
- package/dist/types/combo-box/combo-box-fuzzy.d.ts +2 -2
- package/dist/types/combo-box/combo-box-fuzzy.d.ts.map +1 -1
- package/dist/types/combo-box/combo-box-item.d.ts +3 -3
- package/dist/types/combo-box/combo-box-item.d.ts.map +1 -1
- package/dist/types/combo-box/combo-box.d.ts +3 -3
- package/dist/types/combo-box/combo-box.d.ts.map +1 -1
- package/dist/types/index.d.mts +4 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/menu/index.d.ts +2 -0
- package/dist/types/menu/index.d.ts.map +1 -0
- package/dist/types/menu/menu.d.ts +38 -0
- package/dist/types/menu/menu.d.ts.map +1 -0
- package/dist/types/popover/index.d.ts +2 -0
- package/dist/types/popover/index.d.ts.map +1 -0
- package/dist/types/popover/popover.d.ts +21 -0
- package/dist/types/popover/popover.d.ts.map +1 -0
- package/dist/types/range-calendar/index.d.ts +2 -0
- package/dist/types/range-calendar/index.d.ts.map +1 -0
- package/dist/types/range-calendar/range-calendar.d.ts +69 -0
- package/dist/types/range-calendar/range-calendar.d.ts.map +1 -0
- package/dist/types/select/select.d.ts +7 -6
- package/dist/types/select/select.d.ts.map +1 -1
- package/dist/types/system/react-utils/context.d.ts +3 -2
- package/dist/types/system/react-utils/context.d.ts.map +1 -1
- package/dist/types/tabs/index.d.ts +2 -0
- package/dist/types/tabs/index.d.ts.map +1 -0
- package/dist/types/tabs/tabs.d.ts +16 -0
- package/dist/types/tabs/tabs.d.ts.map +1 -0
- package/dist/types/tag-field/tag-field-item.d.ts +2 -2
- package/dist/types/tag-field/tag-field-item.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field-tag-list.d.ts.map +1 -1
- package/dist/types/tag-field/tag-field.d.ts.map +1 -1
- package/dist/types/tag-field/types.d.ts +3 -3
- package/dist/types/tag-field/types.d.ts.map +1 -1
- package/dist/types/text-area-field/text-area-field.d.ts +3 -3
- package/dist/types/text-area-field/text-area-field.d.ts.map +1 -1
- package/dist/types/text-field/text-field.d.ts +3 -3
- package/dist/types/text-field/text-field.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/cjs/calendar/calendar-base.cjs +0 -347
- package/dist/esm/calendar/calendar-base.js +0 -343
- package/dist/types/calendar/calendar-base.d.ts +0 -14
- package/dist/types/calendar/calendar-base.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar-style-context.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar-style-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"calendar-style-context.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar-style-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,MAAM,WAAW,8BAA8B,CAAC,CAAC,SAAS,YAAY;IACpE,KAAK,EAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAA;IACxC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA;IAC1C,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAA;IAC7E,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;CAC/B;AAED,eAAO,MAAO,oBAAoB,yEAAE,uBAAuB,oDAKzD,CAAA"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
|
-
import
|
|
2
|
+
import { CalendarDate } from "@internationalized/date";
|
|
3
3
|
import type { CalendarProps } from "./types";
|
|
4
|
-
export declare const Calendar: <T extends
|
|
4
|
+
export declare const Calendar: <T extends CalendarDate>(props: CalendarProps<T>) => ReactElement;
|
|
5
|
+
export declare const CalendarStateWrapper: ({ children, }: {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
8
|
//# sourceMappingURL=calendar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/calendar/calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,EAAE,YAAY,EAA2B,MAAM,yBAAyB,CAAA;AAe/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAQ5C,eAAO,MAAM,QAAQ,EA8Hf,CAAC,CAAC,SAAS,YAAY,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,YAAY,CAAA;AAEvE,eAAO,MAAM,oBAAoB,kBAE9B;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,4CAQA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/calendar/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,0BAA0B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-calendar-i18n.d.ts","sourceRoot":"","sources":["../../../../src/calendar/hooks/use-calendar-i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAGlD,eAAO,MAAM,WAAW,EAAE,gBAqBzB,CAAA;AAED,eAAO,MAAM,eAAe,0CAE3B,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CalendarState, RangeCalendarState } from "react-stately";
|
|
2
|
+
export declare const useCalendarSelectors: (state: CalendarState | RangeCalendarState) => {
|
|
3
|
+
months: {
|
|
4
|
+
id: number;
|
|
5
|
+
textValue: string;
|
|
6
|
+
}[];
|
|
7
|
+
years: {
|
|
8
|
+
id: number;
|
|
9
|
+
textValue: string;
|
|
10
|
+
}[];
|
|
11
|
+
datePartOrder: ("month" | "year")[];
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=use-calendar-selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-calendar-selectors.d.ts","sourceRoot":"","sources":["../../../../src/calendar/hooks/use-calendar-selectors.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAMtE,eAAO,MAAM,oBAAoB,UACxB,aAAa,GAAG,kBAAkB;;;;;;;;;;CAmC1C,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { CalendarDate } from "@internationalized/date";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { CalendarProps as AriaCalendarProps, CalendarGridProps
|
|
3
|
+
import type { CalendarProps as AriaCalendarProps, CalendarGridProps } from "react-aria-components";
|
|
3
4
|
import type { CalendarSlots, CalendarVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
4
|
-
export interface CalendarProps<T extends
|
|
5
|
+
export interface CalendarProps<T extends CalendarDate> extends AriaCalendarProps<T>, CalendarVariantProps, Pick<CalendarGridProps, "weekdayStyle"> {
|
|
5
6
|
errorMessage?: string;
|
|
6
7
|
/**
|
|
7
8
|
* List of classes to change the classNames of the element.
|
|
@@ -41,12 +42,12 @@ export interface CalendarProps<T extends DateValue> extends AriaCalendarProps<T>
|
|
|
41
42
|
* The minimum allowed date that a user may select.
|
|
42
43
|
* @defaultValue `new CalendarDate(1900, 0, 1)`
|
|
43
44
|
*/
|
|
44
|
-
minValue?:
|
|
45
|
+
minValue?: T;
|
|
45
46
|
/**
|
|
46
47
|
* The maximum allowed date that a user may select.
|
|
47
48
|
* @defaultValue `new CalendarDate(2100, 12, 31)`
|
|
48
49
|
*/
|
|
49
|
-
maxValue?:
|
|
50
|
+
maxValue?: T;
|
|
50
51
|
/**
|
|
51
52
|
* If provided, there will be a button below the calendar for users to jump to today's date.
|
|
52
53
|
* @defaultValue `true`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/calendar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/calendar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,YAAY,CACnD,SAAQ,iBAAiB,CAAC,CAAC,CAAC,EAC1B,oBAAoB,EACpB,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAE1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAA;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAA;IAEZ;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,SAAS,CAAA;CAC1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Key } from "react-aria";
|
|
2
2
|
import type { SetRequired } from "type-fest";
|
|
3
|
-
import type {
|
|
3
|
+
import type { ListBoxItemSlots, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
4
4
|
import type { ComboBoxProps } from "./combo-box";
|
|
5
5
|
import { ComboBoxItem } from "./combo-box-item";
|
|
6
6
|
type ComboBoxItem = {
|
|
@@ -9,7 +9,7 @@ type ComboBoxItem = {
|
|
|
9
9
|
description?: string;
|
|
10
10
|
};
|
|
11
11
|
export interface ComboBoxFuzzyProps<T extends ComboBoxItem = ComboBoxItem> extends SetRequired<ComboBoxProps<T>, "inputValue" | "onInputChange" | "onSelectionChange" | "selectedKey" | "items"> {
|
|
12
|
-
itemClassNames?: SlotsToClasses<
|
|
12
|
+
itemClassNames?: SlotsToClasses<ListBoxItemSlots> & SlotsToClasses<"highlight">;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Controlled variant of ComboBox, allows for fuzzy search and item highlight.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box-fuzzy.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box-fuzzy.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAK5C,OAAO,KAAK,EAEV,
|
|
1
|
+
{"version":3,"file":"combo-box-fuzzy.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box-fuzzy.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAK5C,OAAO,KAAK,EAEV,gBAAgB,EAChB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAO7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAQ/C,KAAK,YAAY,GAAG;IAClB,EAAE,EAAE,GAAG,CAAA;IACP,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA;AAwBD,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,cAAc,CAAC,gBAAgB,CAAC,GAC/C,cAAc,CAAC,WAAW,CAAC,CAAA;CAC9B;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EACjE,aAAa,EAAE,kBAAkB,CAAC,CAAC,CAAC,2CAwGrC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ListBoxItemProps } from "react-aria-components";
|
|
2
|
-
import type {
|
|
3
|
-
export interface ComboBoxItemProps extends ListBoxItemProps,
|
|
2
|
+
import type { ListBoxItemSlots, ListBoxItemVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
3
|
+
export interface ComboBoxItemProps extends ListBoxItemProps, ListBoxItemVariantProps {
|
|
4
4
|
/**
|
|
5
5
|
* Description for the item, if any
|
|
6
6
|
*/
|
|
7
7
|
description?: React.ReactNode;
|
|
8
|
-
classNames?: SlotsToClasses<
|
|
8
|
+
classNames?: SlotsToClasses<ListBoxItemSlots>;
|
|
9
9
|
}
|
|
10
10
|
export declare const ComboBoxItem: import("../system/utils").InternalForwardRefRenderFunction<import("../system/types").As, ComboBoxItemProps, never>;
|
|
11
11
|
//# sourceMappingURL=combo-box-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box-item.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box-item.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAS7D,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"combo-box-item.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box-item.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAS7D,OAAO,KAAK,EACV,gBAAgB,EAChB,uBAAuB,EACvB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAM7B,MAAM,WAAW,iBACf,SAAQ,gBAAgB,EACtB,uBAAuB;IACzB;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,UAAU,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,YAAY,oHAgEvB,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ComboBoxProps as AriaComboBoxProps, ListBoxProps, ListLayoutOptions, ValidationResult } from "react-aria-components";
|
|
2
2
|
import type { ComboBoxSlots, ComboBoxVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
3
3
|
export interface ComboBoxProps<T extends object> extends ComboBoxVariantProps, Omit<AriaComboBoxProps<T>, "children"> {
|
|
4
|
-
label?:
|
|
4
|
+
label?: React.ReactNode;
|
|
5
5
|
/** The list of ComboBox items (uncontrolled). */
|
|
6
6
|
defaultItems?: T[];
|
|
7
7
|
/** The list of ComboBox items (controlled). */
|
|
8
8
|
items?: T[];
|
|
9
|
-
description?:
|
|
10
|
-
errorMessage?:
|
|
9
|
+
description?: React.ReactNode | null;
|
|
10
|
+
errorMessage?: React.ReactNode | ((validation: ValidationResult) => string);
|
|
11
11
|
classNames?: SlotsToClasses<ComboBoxSlots> & SlotsToClasses<"clearButton" | "emptyState">;
|
|
12
12
|
/**
|
|
13
13
|
* Any additional props to be spread to the list layout.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,YAAY,EAEZ,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,YAAY,EAEZ,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAc9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAe7B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,CAC7C,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,EAAE,CAAA;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IACpC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAC3E,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,GACxC,cAAc,CAAC,aAAa,GAAG,YAAY,CAAC,CAAA;IAC9C;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,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;IAEtD,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;CACvC;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,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,2CA6JzE"}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -16,4 +16,8 @@ export * from "./tag-field";
|
|
|
16
16
|
export * from "./select";
|
|
17
17
|
export * from "./badge";
|
|
18
18
|
export * from "./calendar";
|
|
19
|
+
export * from "./range-calendar";
|
|
20
|
+
export * from "./menu";
|
|
21
|
+
export * from "./popover";
|
|
22
|
+
export * from "./tabs";
|
|
19
23
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -16,4 +16,8 @@ export * from "./tag-field";
|
|
|
16
16
|
export * from "./select";
|
|
17
17
|
export * from "./badge";
|
|
18
18
|
export * from "./calendar";
|
|
19
|
+
export * from "./range-calendar";
|
|
20
|
+
export * from "./menu";
|
|
21
|
+
export * from "./popover";
|
|
22
|
+
export * from "./tabs";
|
|
19
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -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"}
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/menu/index.tsx"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { MenuItemProps as AriaMenuItemProps, MenuProps as AriaMenuProps, MenuSectionProps as AriaMenuSectionProps, ContextValue, SeparatorProps } from "react-aria-components";
|
|
2
|
+
import { MenuTrigger as AriaMenuTrigger } from "react-aria-components";
|
|
3
|
+
import type { ListBoxItemVariantProps, MenuItemVariantSlots, MenuSectionVariantProps, MenuSectionVariantSlots, MenuVariantProps, MenuVariantSlots, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
4
|
+
import type { PopoverProps } from "../popover";
|
|
5
|
+
export declare const MenuVariantContext: import("react").Context<ContextValue<MenuVariantProps, any>>, useMenuVariantContext: () => ContextValue<MenuVariantProps, any>;
|
|
6
|
+
export interface MenuProps<T> extends AriaMenuProps<T>, MenuVariantProps {
|
|
7
|
+
placement?: PopoverProps["placement"];
|
|
8
|
+
classNames?: SlotsToClasses<MenuVariantSlots>;
|
|
9
|
+
}
|
|
10
|
+
export declare const Menu: <T extends object>(props: MenuProps<T> & import("react").RefAttributes<HTMLDivElement>) => React.ReactNode;
|
|
11
|
+
export interface MenuItemProps extends AriaMenuItemProps, ListBoxItemVariantProps {
|
|
12
|
+
classNames?: SlotsToClasses<MenuItemVariantSlots>;
|
|
13
|
+
multipleSelectionIcon?: React.ReactNode | null;
|
|
14
|
+
singleSelectionIcon?: React.ReactNode | null;
|
|
15
|
+
/**
|
|
16
|
+
* Element to be rendered in the left side of the menu item.
|
|
17
|
+
*/
|
|
18
|
+
startContent?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Element to be rendered in the right side of the menu item.
|
|
21
|
+
*/
|
|
22
|
+
endContent?: React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<object>>;
|
|
25
|
+
export declare function MenuSeparator(props: SeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export interface MenuSectionProps<T> extends AriaMenuSectionProps<T>, MenuSectionVariantProps {
|
|
27
|
+
/**
|
|
28
|
+
* The title of the section.\
|
|
29
|
+
* If not provided, the `aria-label` prop must be provided for accessibility.
|
|
30
|
+
*/
|
|
31
|
+
title?: string;
|
|
32
|
+
items?: T[];
|
|
33
|
+
classNames?: SlotsToClasses<MenuSectionVariantSlots>;
|
|
34
|
+
}
|
|
35
|
+
export declare const MenuSection: <T extends object>(props: MenuSectionProps<T> & import("react").RefAttributes<HTMLElement>) => React.ReactNode;
|
|
36
|
+
export declare const MenuTrigger: typeof AriaMenuTrigger;
|
|
37
|
+
export declare const SubmenuTrigger: (props: import("react-aria-components").SubmenuTriggerProps & React.RefAttributes<HTMLDivElement>) => React.ReactElement | null;
|
|
38
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +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,gEACs0nD,MAAO,aAAa,qBAAoB,MAAO,YAAY,OAD52nD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/popover/index.tsx"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PopoverProps as AriaPopoverProps } from "react-aria-components";
|
|
2
|
+
import type { SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
|
|
3
|
+
import { popoverStyles } from "@opengovsg/oui-theme";
|
|
4
|
+
export interface PopoverProps extends Omit<AriaPopoverProps, "children">, VariantProps<typeof popoverStyles> {
|
|
5
|
+
showArrow?: boolean;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* List of classes to change the className of the element.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```text
|
|
12
|
+
* Component: Popover
|
|
13
|
+
*
|
|
14
|
+
* Class names:
|
|
15
|
+
* - base: the popover itself. Will be ignored if `className` is provided.
|
|
16
|
+
* - arrow: the arrow of the popover.
|
|
17
|
+
*/
|
|
18
|
+
classNames?: SlotsToClasses<"arrow" | "base">;
|
|
19
|
+
}
|
|
20
|
+
export declare const Popover: ({ children, showArrow, className, classNames, ...props }: PopoverProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../src/popover/popover.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAS7E,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxE,OAAO,EAAsB,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAExE,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EACxC,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IAEzB;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,OAAO,GAAG,MAAM,CAAC,CAAA;CAC9C;AAED,eAAO,MAAM,OAAO,6DAMjB,YAAY,4CA8Bd,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/range-calendar/index.tsx"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { RangeCalendarProps as AriaRangeCalendarProps, CalendarGridProps, DateValue } from "react-aria-components";
|
|
2
|
+
import { CalendarDate } from "@internationalized/date";
|
|
3
|
+
import type { CalendarSlots, CalendarVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
4
|
+
interface RangeCalendarProps<T extends CalendarDate> extends CalendarVariantProps, Pick<CalendarGridProps, "weekdayStyle">, AriaRangeCalendarProps<T> {
|
|
5
|
+
/**
|
|
6
|
+
* List of classes to change the classNames of the element.
|
|
7
|
+
* if `className` is passed, it will be added to the base slot.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
*
|
|
12
|
+
* Component: Calendar, RangeCalendar
|
|
13
|
+
*
|
|
14
|
+
* <Component classNames={{
|
|
15
|
+
* base:"base-classes",
|
|
16
|
+
* nextButton:"next-button-classes",
|
|
17
|
+
* prevButton:"prev-button-classes",
|
|
18
|
+
* buttonGroup:"button-group-classes",
|
|
19
|
+
* header:"header-classes",
|
|
20
|
+
* title:"title-classes",
|
|
21
|
+
* content:"content-classes",
|
|
22
|
+
* gridWrapper:"grid-wrapper-classes",
|
|
23
|
+
* calendar:"calendar-classes",
|
|
24
|
+
* grid:"grid-classes",
|
|
25
|
+
* gridHeader:"grid-header-classes",
|
|
26
|
+
* gridHeaderCell:"grid-header-cell-classes",
|
|
27
|
+
* gridBody:"grid-body-classes",
|
|
28
|
+
* cell:"grid-cell-classes",
|
|
29
|
+
* monthSelector:"month-selector-classes",
|
|
30
|
+
* yearSelector:"year-selector-classes",
|
|
31
|
+
* selectors:"selectors-classes",
|
|
32
|
+
* selectorText:"selector-text-classes",
|
|
33
|
+
* monthList:"month-list-classes",
|
|
34
|
+
* yearList:"year-list-classes",
|
|
35
|
+
* }} />
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
classNames?: SlotsToClasses<CalendarSlots>;
|
|
39
|
+
/**
|
|
40
|
+
* The minimum allowed date that a user may select.
|
|
41
|
+
* @defaultValue `new CalendarDate(1900, 0, 1)`
|
|
42
|
+
*/
|
|
43
|
+
minValue?: T;
|
|
44
|
+
/**
|
|
45
|
+
* The maximum allowed date that a user may select.
|
|
46
|
+
* @defaultValue `new CalendarDate(2100, 12, 31)`
|
|
47
|
+
*/
|
|
48
|
+
maxValue?: T;
|
|
49
|
+
/**
|
|
50
|
+
* If provided, there will be a button below the calendar for users to jump to today's date.
|
|
51
|
+
* @defaultValue `true`
|
|
52
|
+
* If `bottomContent is provided, this will be ignored.
|
|
53
|
+
*/
|
|
54
|
+
showTodayButton?: boolean;
|
|
55
|
+
bottomContent?: React.ReactNode;
|
|
56
|
+
errorMessage?: string;
|
|
57
|
+
}
|
|
58
|
+
export declare const RangeCalendar: import("react").ForwardRefExoticComponent<RangeCalendarProps<CalendarDate> & import("react").RefAttributes<HTMLDivElement>>;
|
|
59
|
+
export declare const RangeCalendarStateWrapper: ({ children, }: {
|
|
60
|
+
children: React.ReactNode;
|
|
61
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export declare const RangeCalendarCell: <T extends CalendarDate>({ date, isMultipleMonths, dateToHighlight, firstDayOfWeek, }: {
|
|
63
|
+
date: CalendarDate;
|
|
64
|
+
isMultipleMonths: boolean;
|
|
65
|
+
dateToHighlight: DateValue | null;
|
|
66
|
+
firstDayOfWeek?: RangeCalendarProps<T>["firstDayOfWeek"];
|
|
67
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=range-calendar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"range-calendar.d.ts","sourceRoot":"","sources":["../../../src/range-calendar/range-calendar.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,IAAI,sBAAsB,EAC5C,iBAAiB,EACjB,SAAS,EACV,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,YAAY,EAIb,MAAM,yBAAyB,CAAA;AAahC,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAe7B,UAAU,kBAAkB,CAAC,CAAC,SAAS,YAAY,CACjD,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,iBAAiB,EAAE,cAAc,CAAC,EACvC,sBAAsB,CAAC,CAAC,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAC1C;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAA;IACZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAA;IAEZ;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE/B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,aAAa,6HAiHxB,CAAA;AAEF,eAAO,MAAM,yBAAyB,kBAEnC;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,4CAQA,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,YAAY,gEAKrD;IACD,IAAI,EAAE,YAAY,CAAA;IAClB,gBAAgB,EAAE,OAAO,CAAA;IACzB,eAAe,EAAE,SAAS,GAAG,IAAI,CAAA;IACjC,cAAc,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAA;CACzD,4CAuDA,CAAA"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import type { SelectProps as AriaSelectProps, ListBoxProps, ListLayoutOptions } from "react-aria-components";
|
|
1
|
+
import type { SelectProps as AriaSelectProps, ListBoxProps, ListLayoutOptions, ValidationResult } from "react-aria-components";
|
|
2
2
|
import type { SelectVariantSlots, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
|
|
3
3
|
import { selectStyles } from "@opengovsg/oui-theme";
|
|
4
4
|
export interface SelectProps<T> extends Omit<AriaSelectProps, "children">, VariantProps<typeof selectStyles> {
|
|
5
|
-
classNames?: SlotsToClasses<SelectVariantSlots>;
|
|
5
|
+
classNames?: SlotsToClasses<SelectVariantSlots | "error">;
|
|
6
6
|
/**
|
|
7
7
|
* Any additional props to be spread to the list layout.
|
|
8
8
|
*/
|
|
9
9
|
listLayoutOptions?: ListLayoutOptions;
|
|
10
|
-
label?:
|
|
11
|
-
description?:
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
description?: React.ReactNode | null;
|
|
12
|
+
errorMessage?: React.ReactNode | ((validation: ValidationResult) => React.ReactNode);
|
|
12
13
|
/** The list of Select options to render */
|
|
13
|
-
items
|
|
14
|
+
items?: NonNullable<ListBoxProps<T>["items"]>;
|
|
14
15
|
children?: ListBoxProps<T>["children"];
|
|
15
16
|
}
|
|
16
|
-
export declare function Select<T extends object>({ label, description, classNames, ...originalProps }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function Select<T extends object>({ label, description, classNames, errorMessage, ...originalProps }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
17
18
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,YAAY,EACZ,iBAAiB,
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAY9B,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAQvE,MAAM,WAAW,WAAW,CAAC,CAAC,CAC5B,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EACvC,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,UAAU,CAAC,EAAE,cAAc,CAAC,kBAAkB,GAAG,OAAO,CAAC,CAAA;IAEzD;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAEpC,YAAY,CAAC,EACT,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAEvD,2CAA2C;IAC3C,KAAK,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IAE7C,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;CACvC;AAeD,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,EACvC,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,GAAG,aAAa,EACjB,EAAE,WAAW,CAAC,CAAC,CAAC,2CAqFhB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface CreateContextOptions {
|
|
1
|
+
export interface CreateContextOptions<T = any> {
|
|
2
2
|
/**
|
|
3
3
|
* If `true`, React will throw if context is `null` or `undefined`
|
|
4
4
|
* In some cases, you might want to support nested context, so you can set it to `false`
|
|
@@ -12,6 +12,7 @@ export interface CreateContextOptions {
|
|
|
12
12
|
* The display name of the context
|
|
13
13
|
*/
|
|
14
14
|
name?: string;
|
|
15
|
+
defaultValue?: T;
|
|
15
16
|
}
|
|
16
17
|
export type CreateContextReturn<T> = [React.Context<T>, () => T];
|
|
17
18
|
/**
|
|
@@ -19,5 +20,5 @@ export type CreateContextReturn<T> = [React.Context<T>, () => T];
|
|
|
19
20
|
*
|
|
20
21
|
* @param options - create context options
|
|
21
22
|
*/
|
|
22
|
-
export declare function createContext<ContextType>(options?: CreateContextOptions): CreateContextReturn<ContextType>;
|
|
23
|
+
export declare function createContext<ContextType>(options?: CreateContextOptions<ContextType>): CreateContextReturn<ContextType>;
|
|
23
24
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/system/react-utils/context.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB;
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/system/react-utils/context.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,GAAG;IAC3C;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb,YAAY,CAAC,EAAE,CAAC,CAAA;CACjB;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAA;AAEhE;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,WAAW,EACvC,OAAO,GAAE,oBAAoB,CAAC,WAAW,CAAM,GAC9C,mBAAmB,CAAC,WAAW,CAAC,CA2BlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tabs/index.tsx"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TabListProps as AriaTabListProps, TabProps as AriaTabProps, TabsProps as AriaTabsProps, ContextValue, TabPanelProps } from "react-aria-components";
|
|
2
|
+
import type { TabListVariantProps, TabsVariantProps, TabVariantProps } from "@opengovsg/oui-theme";
|
|
3
|
+
export declare const TabsVariantContext: import("react").Context<ContextValue<TabsVariantProps, any>>, useTabsVariantContext: () => ContextValue<TabsVariantProps, any>;
|
|
4
|
+
export interface TabsProps extends AriaTabsProps, TabsVariantProps {
|
|
5
|
+
}
|
|
6
|
+
export declare function Tabs(originalProps: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export interface TabListProps<T extends object> extends AriaTabListProps<T>, TabListVariantProps {
|
|
8
|
+
}
|
|
9
|
+
export declare const TabList: <T extends object>(props: TabListProps<T> & import("react").RefAttributes<HTMLDivElement>) => React.ReactNode;
|
|
10
|
+
export interface TabProps extends AriaTabProps, TabVariantProps {
|
|
11
|
+
startContent?: React.ReactNode;
|
|
12
|
+
endContent?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export declare const Tab: import("react").ForwardRefExoticComponent<TabProps & import("react").RefAttributes<object>>;
|
|
15
|
+
export declare function TabPanel(props: TabPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,QAAQ,IAAI,YAAY,EACxB,SAAS,IAAI,aAAa,EAC1B,YAAY,EACZ,aAAa,EACd,MAAM,uBAAuB,CAAA;AAY9B,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAW7B,eAAO,MAAO,kBAAkB,gEAAE,qBAAqB,2CAMrD,CAAA;AAEF,MAAM,WAAW,SAAU,SAAQ,aAAa,EAAE,gBAAgB;CAAG;AAErE,wBAAgB,IAAI,CAAC,aAAa,EAAE,SAAS,2CAiB5C;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,CAC5C,SAAQ,gBAAgB,CAAC,CAAC,CAAC,EACzB,mBAAmB;CAAG;AAE1B,eAAO,MAAM,OAAO,GAAsC,CAAC,SAAS,MAAM,6EAW5D,MAAO,SAYnB,CAAA;AAEF,MAAM,WAAW,QAAS,SAAQ,YAAY,EAAE,eAAe;IAC7D,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC7B;AAED,eAAO,MAAM,GAAG,6FA8Bd,CAAA;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAS5C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ListBoxItemSlots, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
2
2
|
import type { TagFieldBaseItemProps, TagFieldListRenderProps } from "./types";
|
|
3
3
|
export interface TagFieldItemProps<T extends object> extends Omit<TagFieldListRenderProps<T>, "key" | "itemProps">, TagFieldBaseItemProps<T> {
|
|
4
|
-
classNames?: SlotsToClasses<
|
|
4
|
+
classNames?: SlotsToClasses<ListBoxItemSlots>;
|
|
5
5
|
}
|
|
6
6
|
export declare const TagFieldItem: <T extends object>(props: TagFieldItemProps<T> & import("react").RefAttributes<HTMLLIElement>) => React.ReactNode;
|
|
7
7
|
//# sourceMappingURL=tag-field-item.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-field-item.d.ts","sourceRoot":"","sources":["../../../src/tag-field/tag-field-item.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"tag-field-item.d.ts","sourceRoot":"","sources":["../../../src/tag-field/tag-field-item.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI7E,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,MAAM,CACjD,SAAQ,IAAI,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC,EAC3D,qBAAqB,CAAC,CAAC,CAAC;IAC1B,UAAU,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;CAC9C;AA4BD,eAAO,MAAM,YAAY,GA1BE,CAAC,SAAS,MAAM,iFA2B4c,MAAO,SAAS,AADvc,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-field-tag-list.d.ts","sourceRoot":"","sources":["../../../src/tag-field/tag-field-tag-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"tag-field-tag-list.d.ts","sourceRoot":"","sources":["../../../src/tag-field/tag-field-tag-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,WAAW,CAAA;AAIhE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAKzE,UAAU,0BAA0B,CAAC,CAAC;IACpC,IAAI,EAAE,CAAC,CAAA;IACP,SAAS,EAAE,UAAU,CACnB,+BAA+B,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAC3D,CAAA;IACD,kBAAkB,EAAE,MAAM,IAAI,CAAA;IAC9B,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM;IACpD,UAAU,CAAC,EAAE,IAAI,CACf,cAAc,CAAC,aAAa,CAAC,EAC7B,KAAK,GAAG,SAAS,GAAG,SAAS,CAC9B,CAAA;IACD,QAAQ,CAAC,EACL,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;CACjE;AAED,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,MAAM,4BAG7C,oBAAoB,CAAC,CAAC,CAAC,iwBAyDzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-field.d.ts","sourceRoot":"","sources":["../../../src/tag-field/tag-field.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"tag-field.d.ts","sourceRoot":"","sources":["../../../src/tag-field/tag-field.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAU5C,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,EACzC,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,CAAC,CAAC,2CA8ElB"}
|
|
@@ -2,7 +2,7 @@ import type { FocusableProps, HelpTextProps, InputBase, Key, LabelableProps, Mul
|
|
|
2
2
|
import type { VirtualItem } from "@tanstack/react-virtual";
|
|
3
3
|
import type { UseComboboxReturnValue } from "downshift";
|
|
4
4
|
import type { ReactNode } from "react";
|
|
5
|
-
import type {
|
|
5
|
+
import type { ListBoxItemSlots, SlotsToClasses, TagFieldSlots, TagFieldVariantProps } from "@opengovsg/oui-theme";
|
|
6
6
|
export interface TagFieldValidationValue {
|
|
7
7
|
/** The selected key in the TagField. */
|
|
8
8
|
selectedKeys: Set<Key> | null;
|
|
@@ -16,14 +16,14 @@ export interface TagFieldListRenderProps<T> {
|
|
|
16
16
|
item: T;
|
|
17
17
|
key: VirtualItem["key"];
|
|
18
18
|
isHighlighted: boolean;
|
|
19
|
-
classNames?: SlotsToClasses<
|
|
19
|
+
classNames?: SlotsToClasses<ListBoxItemSlots>;
|
|
20
20
|
itemProps: TagFieldBaseItemProps<T>;
|
|
21
21
|
}
|
|
22
22
|
export interface TagFieldRenderProps<T> extends TagFieldListRenderProps<T> {
|
|
23
23
|
}
|
|
24
24
|
export interface TagFieldProps<T> extends Omit<MultipleSelection, "disallowEmptySelection" | "onSelectionChange" | "selectionMode" | "selectedKeys" | "defaultSelectedKeys">, InputBase, TextInputBase, Validation<TagFieldValidationValue>, FocusableProps<HTMLInputElement>, LabelableProps, HelpTextProps, TagFieldVariantProps {
|
|
25
25
|
classNames?: SlotsToClasses<TagFieldSlots>;
|
|
26
|
-
itemClassNames?: SlotsToClasses<
|
|
26
|
+
itemClassNames?: SlotsToClasses<ListBoxItemSlots>;
|
|
27
27
|
children?: (values: TagFieldRenderProps<T>) => ReactNode;
|
|
28
28
|
/** The filter function used to determine if a option should be included in the combo box list. */
|
|
29
29
|
defaultFilter?: (textValue: string, inputValue: string) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tag-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,SAAS,EACT,GAAG,EACH,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,UAAU,EACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EACV,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/tag-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,SAAS,EACT,GAAG,EACH,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,UAAU,EACX,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,oBAAoB,EACrB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,WAAW,uBAAuB;IACtC,wCAAwC;IACxC,YAAY,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;IAC7B,uCAAuC;IACvC,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,CACtC,SAAQ,UAAU,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IAC7D,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED,MAAM,WAAW,uBAAuB,CAAC,CAAC;IACxC,IAAI,EAAE,CAAC,CAAA;IACP,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;IAC7C,SAAS,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAA;CACpC;AAGD,MAAM,WAAW,mBAAmB,CAAC,CAAC,CAAE,SAAQ,uBAAuB,CAAC,CAAC,CAAC;CAAG;AAE7E,MAAM,WAAW,aAAa,CAAC,CAAC,CAC9B,SAAQ,IAAI,CACR,iBAAiB,EACf,wBAAwB,GACxB,mBAAmB,GACnB,eAAe,GACf,cAAc,GACd,qBAAqB,CACxB,EACD,SAAS,EACT,aAAa,EACb,UAAU,CAAC,uBAAuB,CAAC,EACnC,cAAc,CAAC,gBAAgB,CAAC,EAChC,cAAc,EACd,aAAa,EACb,oBAAoB;IACtB,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAA;IAC1C,cAAc,CAAC,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAA;IACjD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAA;IACxD,kGAAkG;IAClG,aAAa,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAA;IAClE;;;OAGG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,CAAA;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,GAAG,CAAA;IAC5B,kEAAkE;IAClE,YAAY,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;IACvB,kEAAkE;IAClE,mBAAmB,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;IAC9B,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,EAAE,CAAA;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,oJAAoJ;IACpJ,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAA;IACxC,yDAAyD;IACzD,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAA;IAC5C,oDAAoD;IACpD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,8DAA8D;IAC9D,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,oEAAoE;IACpE,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAEvC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B"}
|
|
@@ -2,9 +2,9 @@ import type { TextFieldProps as AriaTextFieldProps, ValidationResult } from "rea
|
|
|
2
2
|
import type { SlotsToClasses, TextAreaVariantProps } from "@opengovsg/oui-theme";
|
|
3
3
|
import type { TextAreaProps } from "../text-area";
|
|
4
4
|
export interface TextAreaFieldProps extends AriaTextFieldProps, TextAreaVariantProps {
|
|
5
|
-
label?:
|
|
6
|
-
description?:
|
|
7
|
-
errorMessage?:
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
errorMessage?: React.ReactNode | ((validation: ValidationResult) => React.ReactNode);
|
|
8
8
|
classNames?: SlotsToClasses<"base" | "label" | "input" | "description" | "error">;
|
|
9
9
|
inputProps?: TextAreaProps;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-area-field.d.ts","sourceRoot":"","sources":["../../../src/text-area-field/text-area-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAGhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjD,MAAM,WAAW,kBACf,SAAQ,kBAAkB,EACxB,oBAAoB;IACtB,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"text-area-field.d.ts","sourceRoot":"","sources":["../../../src/text-area-field/text-area-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAGhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAIjD,MAAM,WAAW,kBACf,SAAQ,kBAAkB,EACxB,oBAAoB;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,YAAY,CAAC,EACT,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IACvD,UAAU,CAAC,EAAE,cAAc,CACzB,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CACrD,CAAA;IACD,UAAU,CAAC,EAAE,aAAa,CAAA;CAC3B;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EACT,UAAU,EACV,IAAI,EACJ,OAAO,EACP,GAAG,KAAK,EACT,EAAE,kBAAkB,2CA8BpB"}
|
|
@@ -2,9 +2,9 @@ import type { TextFieldProps as AriaTextFieldProps, ValidationResult } from "rea
|
|
|
2
2
|
import type { InputVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
|
|
3
3
|
import type { InputProps } from "../input";
|
|
4
4
|
export interface TextFieldProps extends AriaTextFieldProps, InputVariantProps {
|
|
5
|
-
label?:
|
|
6
|
-
description?:
|
|
7
|
-
errorMessage?:
|
|
5
|
+
label?: React.ReactNode;
|
|
6
|
+
description?: React.ReactNode;
|
|
7
|
+
errorMessage?: React.ReactNode | ((validation: ValidationResult) => string);
|
|
8
8
|
classNames?: SlotsToClasses<"base" | "label" | "input" | "description" | "error">;
|
|
9
9
|
inputProps?: InputProps;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../src/text-field/text-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAI1C,MAAM,WAAW,cAAe,SAAQ,kBAAkB,EAAE,iBAAiB;IAC3E,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../../src/text-field/text-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG7E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAI1C,MAAM,WAAW,cAAe,SAAQ,kBAAkB,EAAE,iBAAiB;IAC3E,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAC3E,UAAU,CAAC,EAAE,cAAc,CACzB,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CACrD,CAAA;IACD,UAAU,CAAC,EAAE,UAAU,CAAA;CACxB;AAED,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,WAAW,EACX,YAAY,EACZ,UAAU,EACV,SAAS,EACT,UAAU,EACV,IAAI,EACJ,OAAO,EACP,GAAG,KAAK,EACT,EAAE,cAAc,2CA8BhB"}
|