@opengovsg/oui 0.0.8 → 0.0.10

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.
Files changed (138) hide show
  1. package/dist/cjs/button/button.cjs +1 -1
  2. package/dist/cjs/calendar/agnostic-calendar-state-context.cjs +13 -0
  3. package/dist/cjs/calendar/calendar-bottom-content.cjs +51 -0
  4. package/dist/cjs/calendar/calendar-grid-header.cjs +28 -0
  5. package/dist/cjs/calendar/calendar-header.cjs +74 -0
  6. package/dist/cjs/calendar/calendar-month-day-selector.cjs +86 -0
  7. package/dist/cjs/calendar/calendar-style-context.cjs +13 -0
  8. package/dist/cjs/calendar/calendar.cjs +155 -0
  9. package/dist/cjs/calendar/hooks/index.cjs +11 -0
  10. package/dist/cjs/calendar/hooks/use-calendar-i18n.cjs +33 -0
  11. package/dist/cjs/calendar/hooks/use-calendar-selectors.cjs +41 -0
  12. package/dist/cjs/calendar/index.cjs +22 -0
  13. package/dist/cjs/calendar/types.cjs +3 -0
  14. package/dist/cjs/calendar/utils.cjs +62 -0
  15. package/dist/cjs/combo-box/combo-box-fuzzy.cjs +3 -3
  16. package/dist/cjs/combo-box/combo-box-item.cjs +2 -2
  17. package/dist/cjs/combo-box/combo-box.cjs +3 -2
  18. package/dist/cjs/index.cjs +53 -20
  19. package/dist/cjs/menu/index.cjs +15 -0
  20. package/dist/cjs/menu/menu.cjs +229 -0
  21. package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/{chevrons-up-down.cjs → chevron-left.cjs} +3 -6
  22. package/dist/cjs/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs +19 -0
  23. package/dist/cjs/popover/index.cjs +8 -0
  24. package/dist/cjs/popover/popover.cjs +46 -0
  25. package/dist/cjs/range-calendar/index.cjs +10 -0
  26. package/dist/cjs/range-calendar/range-calendar.cjs +188 -0
  27. package/dist/cjs/select/select-item.cjs +11 -24
  28. package/dist/cjs/select/select.cjs +17 -6
  29. package/dist/cjs/system/react-utils/context.cjs +3 -2
  30. package/dist/cjs/system/utils.cjs +9 -6
  31. package/dist/cjs/tag-field/index.cjs +2 -0
  32. package/dist/cjs/tag-field/tag-field-item.cjs +33 -0
  33. package/dist/cjs/tag-field/tag-field-list.cjs +11 -22
  34. package/dist/cjs/tag-field/tag-field-tag-list.cjs +3 -2
  35. package/dist/cjs/tag-field/tag-field.cjs +5 -3
  36. package/dist/esm/button/button.js +1 -1
  37. package/dist/esm/calendar/agnostic-calendar-state-context.js +10 -0
  38. package/dist/esm/calendar/calendar-bottom-content.js +49 -0
  39. package/dist/esm/calendar/calendar-grid-header.js +26 -0
  40. package/dist/esm/calendar/calendar-header.js +72 -0
  41. package/dist/esm/calendar/calendar-month-day-selector.js +84 -0
  42. package/dist/esm/calendar/calendar-style-context.js +10 -0
  43. package/dist/esm/calendar/calendar.js +152 -0
  44. package/dist/esm/calendar/hooks/index.js +3 -0
  45. package/dist/esm/calendar/hooks/use-calendar-i18n.js +30 -0
  46. package/dist/esm/calendar/hooks/use-calendar-selectors.js +39 -0
  47. package/dist/esm/calendar/index.js +5 -0
  48. package/dist/esm/calendar/types.js +1 -0
  49. package/dist/esm/calendar/utils.js +57 -0
  50. package/dist/esm/combo-box/combo-box-fuzzy.js +4 -4
  51. package/dist/esm/combo-box/combo-box-item.js +3 -3
  52. package/dist/esm/combo-box/combo-box.js +4 -3
  53. package/dist/esm/index.js +17 -9
  54. package/dist/esm/menu/index.js +2 -0
  55. package/dist/esm/menu/menu.js +220 -0
  56. package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-left.js +14 -0
  57. package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-right.js +14 -0
  58. package/dist/esm/popover/index.js +2 -0
  59. package/dist/esm/popover/popover.js +44 -0
  60. package/dist/esm/range-calendar/index.js +2 -0
  61. package/dist/esm/range-calendar/range-calendar.js +184 -0
  62. package/dist/esm/select/select-item.js +12 -25
  63. package/dist/esm/select/select.js +19 -8
  64. package/dist/esm/system/react-utils/context.js +3 -2
  65. package/dist/esm/system/utils.js +9 -6
  66. package/dist/esm/tag-field/index.js +1 -0
  67. package/dist/esm/tag-field/tag-field-item.js +31 -0
  68. package/dist/esm/tag-field/tag-field-list.js +12 -22
  69. package/dist/esm/tag-field/tag-field-tag-list.js +3 -2
  70. package/dist/esm/tag-field/tag-field.js +7 -5
  71. package/dist/types/button/button.d.ts +5 -0
  72. package/dist/types/button/button.d.ts.map +1 -1
  73. package/dist/types/calendar/agnostic-calendar-state-context.d.ts +3 -0
  74. package/dist/types/calendar/agnostic-calendar-state-context.d.ts.map +1 -0
  75. package/dist/types/calendar/calendar-bottom-content.d.ts +4 -0
  76. package/dist/types/calendar/calendar-bottom-content.d.ts.map +1 -0
  77. package/dist/types/calendar/calendar-grid-header.d.ts +2 -0
  78. package/dist/types/calendar/calendar-grid-header.d.ts.map +1 -0
  79. package/dist/types/calendar/calendar-header.d.ts +6 -0
  80. package/dist/types/calendar/calendar-header.d.ts.map +1 -0
  81. package/dist/types/calendar/calendar-month-day-selector.d.ts +2 -0
  82. package/dist/types/calendar/calendar-month-day-selector.d.ts.map +1 -0
  83. package/dist/types/calendar/calendar-style-context.d.ts +12 -0
  84. package/dist/types/calendar/calendar-style-context.d.ts.map +1 -0
  85. package/dist/types/calendar/calendar.d.ts +8 -0
  86. package/dist/types/calendar/calendar.d.ts.map +1 -0
  87. package/dist/types/calendar/hooks/index.d.ts +3 -0
  88. package/dist/types/calendar/hooks/index.d.ts.map +1 -0
  89. package/dist/types/calendar/hooks/use-calendar-i18n.d.ts +4 -0
  90. package/dist/types/calendar/hooks/use-calendar-i18n.d.ts.map +1 -0
  91. package/dist/types/calendar/hooks/use-calendar-selectors.d.ts +13 -0
  92. package/dist/types/calendar/hooks/use-calendar-selectors.d.ts.map +1 -0
  93. package/dist/types/calendar/index.d.ts +6 -0
  94. package/dist/types/calendar/index.d.ts.map +1 -0
  95. package/dist/types/calendar/types.d.ts +59 -0
  96. package/dist/types/calendar/types.d.ts.map +1 -0
  97. package/dist/types/calendar/utils.d.ts +13 -0
  98. package/dist/types/calendar/utils.d.ts.map +1 -0
  99. package/dist/types/combo-box/combo-box-fuzzy.d.ts +2 -2
  100. package/dist/types/combo-box/combo-box-fuzzy.d.ts.map +1 -1
  101. package/dist/types/combo-box/combo-box-item.d.ts +3 -3
  102. package/dist/types/combo-box/combo-box-item.d.ts.map +1 -1
  103. package/dist/types/combo-box/combo-box.d.ts.map +1 -1
  104. package/dist/types/index.d.mts +4 -0
  105. package/dist/types/index.d.ts +4 -0
  106. package/dist/types/index.d.ts.map +1 -1
  107. package/dist/types/menu/index.d.ts +2 -0
  108. package/dist/types/menu/index.d.ts.map +1 -0
  109. package/dist/types/menu/menu.d.ts +38 -0
  110. package/dist/types/menu/menu.d.ts.map +1 -0
  111. package/dist/types/popover/index.d.ts +2 -0
  112. package/dist/types/popover/index.d.ts.map +1 -0
  113. package/dist/types/popover/popover.d.ts +21 -0
  114. package/dist/types/popover/popover.d.ts.map +1 -0
  115. package/dist/types/range-calendar/index.d.ts +2 -0
  116. package/dist/types/range-calendar/index.d.ts.map +1 -0
  117. package/dist/types/range-calendar/range-calendar.d.ts +69 -0
  118. package/dist/types/range-calendar/range-calendar.d.ts.map +1 -0
  119. package/dist/types/select/select-item.d.ts.map +1 -1
  120. package/dist/types/select/select.d.ts +4 -3
  121. package/dist/types/select/select.d.ts.map +1 -1
  122. package/dist/types/system/react-utils/context.d.ts +3 -2
  123. package/dist/types/system/react-utils/context.d.ts.map +1 -1
  124. package/dist/types/system/utils.d.ts.map +1 -1
  125. package/dist/types/tag-field/index.d.ts +1 -0
  126. package/dist/types/tag-field/index.d.ts.map +1 -1
  127. package/dist/types/tag-field/tag-field-item.d.ts +7 -0
  128. package/dist/types/tag-field/tag-field-item.d.ts.map +1 -0
  129. package/dist/types/tag-field/tag-field-list.d.ts +2 -6
  130. package/dist/types/tag-field/tag-field-list.d.ts.map +1 -1
  131. package/dist/types/tag-field/tag-field-state-context.d.ts +1 -2
  132. package/dist/types/tag-field/tag-field-state-context.d.ts.map +1 -1
  133. package/dist/types/tag-field/tag-field-tag-list.d.ts.map +1 -1
  134. package/dist/types/tag-field/tag-field.d.ts.map +1 -1
  135. package/dist/types/tag-field/types.d.ts +8 -6
  136. package/dist/types/tag-field/types.d.ts.map +1 -1
  137. package/package.json +8 -7
  138. package/dist/esm/node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevrons-up-down.js +0 -17
@@ -0,0 +1,3 @@
1
+ export * from "./use-calendar-i18n";
2
+ export * from "./use-calendar-selectors";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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,4 @@
1
+ import type { LocalizedStrings } from "react-aria";
2
+ export declare const i18nStrings: LocalizedStrings;
3
+ export declare const useCalendarI18n: () => import("react-aria").FormatMessage;
4
+ //# sourceMappingURL=use-calendar-i18n.d.ts.map
@@ -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"}
@@ -0,0 +1,6 @@
1
+ export * from "./calendar";
2
+ export * from "./calendar-style-context";
3
+ export * from "./utils";
4
+ export type * from "./types";
5
+ export { CalendarDate } from "@internationalized/date";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/calendar/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,0BAA0B,CAAA;AACxC,cAAc,SAAS,CAAA;AAEvB,mBAAmB,SAAS,CAAA;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,59 @@
1
+ import type { CalendarDate } from "@internationalized/date";
2
+ import type { ReactNode } from "react";
3
+ import type { CalendarProps as AriaCalendarProps, CalendarGridProps } from "react-aria-components";
4
+ import type { CalendarSlots, CalendarVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
5
+ export interface CalendarProps<T extends CalendarDate> extends AriaCalendarProps<T>, CalendarVariantProps, Pick<CalendarGridProps, "weekdayStyle"> {
6
+ errorMessage?: string;
7
+ /**
8
+ * List of classes to change the classNames of the element.
9
+ * if `className` is passed, it will be added to the base slot.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ *
14
+ * Component: Calendar, RangeCalendar
15
+ *
16
+ * <Component classNames={{
17
+ * base:"base-classes",
18
+ * nextButton:"next-button-classes",
19
+ * prevButton:"prev-button-classes",
20
+ * buttonGroup:"button-group-classes",
21
+ * header:"header-classes",
22
+ * title:"title-classes",
23
+ * content:"content-classes",
24
+ * gridWrapper:"grid-wrapper-classes",
25
+ * calendar:"calendar-classes",
26
+ * grid:"grid-classes",
27
+ * gridHeader:"grid-header-classes",
28
+ * gridHeaderCell:"grid-header-cell-classes",
29
+ * gridBody:"grid-body-classes",
30
+ * cell:"grid-cell-classes",
31
+ * monthSelector:"month-selector-classes",
32
+ * yearSelector:"year-selector-classes",
33
+ * selectors:"selectors-classes",
34
+ * selectorText:"selector-text-classes",
35
+ * monthList:"month-list-classes",
36
+ * yearList:"year-list-classes",
37
+ * }} />
38
+ * ```
39
+ */
40
+ classNames?: SlotsToClasses<CalendarSlots>;
41
+ /**
42
+ * The minimum allowed date that a user may select.
43
+ * @defaultValue `new CalendarDate(1900, 0, 1)`
44
+ */
45
+ minValue?: T;
46
+ /**
47
+ * The maximum allowed date that a user may select.
48
+ * @defaultValue `new CalendarDate(2100, 12, 31)`
49
+ */
50
+ maxValue?: T;
51
+ /**
52
+ * If provided, there will be a button below the calendar for users to jump to today's date.
53
+ * @defaultValue `true`
54
+ * If `bottomContent is provided, this will be ignored.
55
+ */
56
+ showTodayButton?: boolean;
57
+ bottomContent?: ReactNode;
58
+ }
59
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,13 @@
1
+ import type { DateFormatterOptions } from "@react-aria/i18n";
2
+ import { CalendarDate } from "@internationalized/date";
3
+ export declare function getEraFormat(date: CalendarDate | undefined): "short" | undefined;
4
+ export declare function useLocalizedMonthYear(date: CalendarDate, timeZone: string): string;
5
+ export declare function useGenerateLocalizedMonths(timeZone: string, formatterOptions?: DateFormatterOptions): {
6
+ id: number;
7
+ textValue: string;
8
+ }[];
9
+ export declare function useGenerateLocalizedYears(yearStart: number, yearEnd: number, timeZone: string, formatterOptions?: DateFormatterOptions): {
10
+ id: number;
11
+ textValue: string;
12
+ }[];
13
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/calendar/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAGtD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,YAAY,GAAG,SAAS,GAC7B,OAAO,GAAG,SAAS,CAIrB;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAUzE;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,oBAAoB;;;IAmBxC;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,oBAAoB;;;IAmBxC"}
@@ -1,6 +1,6 @@
1
1
  import type { Key } from "react-aria";
2
2
  import type { SetRequired } from "type-fest";
3
- import type { ComboBoxItemSlots, SlotsToClasses } from "@opengovsg/oui-theme";
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<ComboBoxItemSlots> & SlotsToClasses<"highlight">;
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,iBAAiB,EACjB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAO7B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,a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ACZ,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 { ComboBoxItemSlots, ComboBoxItemVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
3
- export interface ComboBoxItemProps extends ListBoxItemProps, ComboBoxItemVariantProps {
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<ComboBoxItemSlots>;
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,iBAAiB,EACjB,wBAAwB,EACxB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAM7B,MAAM,WAAW,iBACf,SAAQ,gBAAgB,EACtB,wBAAwB;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC7B,UAAU,CAAC,EAAE,cAAc,CAAC,iBAAiB,CAAC,CAAA;CAC/C;AAED,eAAO,MAAM,YAAY,oHAgEvB,CAAA"}
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 +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;AAe9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAc7B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,CAC7C,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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C,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;;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"}
@@ -15,4 +15,8 @@ export * from "./banner";
15
15
  export * from "./tag-field";
16
16
  export * from "./select";
17
17
  export * from "./badge";
18
+ export * from "./calendar";
19
+ export * from "./range-calendar";
20
+ export * from "./menu";
21
+ export * from "./popover";
18
22
  //# sourceMappingURL=index.d.ts.map
@@ -15,4 +15,8 @@ export * from "./banner";
15
15
  export * from "./tag-field";
16
16
  export * from "./select";
17
17
  export * from "./badge";
18
+ export * from "./calendar";
19
+ export * from "./range-calendar";
20
+ export * from "./menu";
21
+ export * from "./popover";
18
22
  //# 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"}
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"}
@@ -0,0 +1,2 @@
1
+ export * from "./menu";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,2 @@
1
+ export * from "./popover";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,2 @@
1
+ export * from "./range-calendar";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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 +1 @@
1
- {"version":3,"file":"select-item.d.ts","sourceRoot":"","sources":["../../../src/select/select-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAI7D,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAM7B,UAAU,eAAe,CAAC,CAAC,SAAS,MAAM,CACxC,SAAQ,gBAAgB,CAAC,CAAC,CAAC,EACzB,sBAAsB;IACxB,UAAU,CAAC,EAAE,cAAc,CAAC,sBAAsB,CAAC,CAAA;CACpD;AAED,eAAO,MAAM,UAAU,EAwDjB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,YAAY,CAAA"}
1
+ {"version":3,"file":"select-item.d.ts","sourceRoot":"","sources":["../../../src/select/select-item.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAgB,YAAY,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAG7D,OAAO,KAAK,EACV,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAM7B,UAAU,eAAe,CAAC,CAAC,SAAS,MAAM,CACxC,SAAQ,gBAAgB,CAAC,CAAC,CAAC,EACzB,sBAAsB;IACxB,UAAU,CAAC,EAAE,cAAc,CAAC,sBAAsB,CAAC,CAAA;CACpD;AAED,eAAO,MAAM,UAAU,EA8CjB,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,YAAY,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
10
  label?: string;
11
11
  description?: string | null;
12
+ errorMessage?: string | ((validation: ValidationResult) => string);
12
13
  /** The list of Select options to render */
13
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,EAClB,MAAM,uBAAuB,CAAA;AAa9B,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,YAAY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AA;IAEzD;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAE3B,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAElE,2CAA2C;IAC3C,KAAK,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IAE5C,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;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;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,oBAAyB,GACjC,mBAAmB,CAAC,WAAW,CAAC,CA0BlC"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/system/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EACV,EAAE,EACF,WAAW,EACX,OAAO,EACP,sBAAsB,EACtB,cAAc,EACf,MAAM,SAAS,CAAA;AAEhB,MA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  export * from "./tag-field";
2
+ export * from "./tag-field-item";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tag-field/index.tsx"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tag-field/index.tsx"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import type { ListBoxItemSlots, SlotsToClasses } from "@opengovsg/oui-theme";
2
+ import type { TagFieldBaseItemProps, TagFieldListRenderProps } from "./types";
3
+ export interface TagFieldItemProps<T extends object> extends Omit<TagFieldListRenderProps<T>, "key" | "itemProps">, TagFieldBaseItemProps<T> {
4
+ classNames?: SlotsToClasses<ListBoxItemSlots>;
5
+ }
6
+ export declare const TagFieldItem: <T extends object>(props: TagFieldItemProps<T> & import("react").RefAttributes<HTMLLIElement>) => React.ReactNode;
7
+ //# sourceMappingURL=tag-field-item.d.ts.map
@@ -0,0 +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,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"}
@@ -2,7 +2,7 @@ import type { Virtualizer } from "@tanstack/react-virtual";
2
2
  import type { UseComboboxPropGetters } from "downshift";
3
3
  import type { ReactNode } from "react";
4
4
  import type { ContextValue, SlotProps } from "react-aria-components";
5
- import type { SlotsToClasses, TagFieldItemSlots } from "@opengovsg/oui-theme";
5
+ import type { TagFieldItemProps } from "./tag-field-item";
6
6
  import type { TagFieldListRenderProps } from "./types";
7
7
  export interface TagFieldListContextValue extends SlotProps, ReturnType<UseComboboxPropGetters<object>["getMenuProps"]> {
8
8
  rowVirtualizer: Virtualizer<HTMLElement, Element>;
@@ -10,13 +10,9 @@ export interface TagFieldListContextValue extends SlotProps, ReturnType<UseCombo
10
10
  export declare const TagFieldListContext: import("react").Context<ContextValue<TagFieldListContextValue, HTMLUListElement>>;
11
11
  interface TagFieldListProps<T extends object> extends Partial<TagFieldListContextValue> {
12
12
  className?: string;
13
- itemClassNames?: SlotsToClasses<TagFieldItemSlots>;
13
+ itemClassNames?: TagFieldItemProps<T>["classNames"];
14
14
  children?: ReactNode | ((values: TagFieldListRenderProps<T>) => ReactNode);
15
15
  }
16
- interface TagFieldListItemProps<T extends object> extends Omit<TagFieldListRenderProps<T>, "key"> {
17
- classNames?: TagFieldListProps<T>["itemClassNames"];
18
- }
19
- export declare const TagFieldListItem: <T extends object>(props: TagFieldListItemProps<T> & import("react").RefAttributes<HTMLLIElement>) => React.ReactNode;
20
16
  export declare const TagFieldList: <T extends object>(props: TagFieldListProps<T> & import("react").RefAttributes<HTMLUListElement>) => React.ReactNode;
21
17
  export {};
22
18
  //# sourceMappingURL=tag-field-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag-field-list.d.ts","sourceRoot":"","sources":["../../../src/tag-field/tag-field-list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,KA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,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,KAAK,EAAgB,SAAS,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAIpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAKtD,MAAM,WAAW,wBACf,SAAQ,SAAS,EACf,UAAU,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,CAAC;IAC5D,cAAc,EAAE,WAAW,CAAC,WAAW,EAAE,OAAO,CAAC,CAAA;CAClD;AAED,eAAO,MAAM,mBAAmB,mFAC+C,CAAA;AAE/E,UAAU,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAC1C,SAAQ,OAAO,CAAC,wBAAwB,CAAC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA;IACnD,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAA;CAC3E;AA2DD,eAAO,MAAM,YAAY,GAzDE,CAAC,SAAS,MAAM,oFAsBlB,MAAM,SAmCiC,CAAA"}
@@ -1,12 +1,11 @@
1
1
  import type { UseComboboxReturnValue, UseMultipleSelectionReturnValue } from "downshift";
2
2
  import type { TagFieldVariantProps } from "@opengovsg/oui-theme";
3
3
  import type { TagFieldState } from "./use-tag-field-state";
4
- interface TagFieldStateContextValue<T> extends TagFieldState<T>, Pick<UseComboboxReturnValue<T>, "getItemProps" | "highlightedIndex">, Pick<UseMultipleSelectionReturnValue<T>, "getSelectedItemProps" | "removeSelectedItem">, TagFieldVariantProps {
4
+ export interface TagFieldStateContextValue<T> extends TagFieldState<T>, Pick<UseComboboxReturnValue<T>, "getItemProps" | "highlightedIndex">, Pick<UseMultipleSelectionReturnValue<T>, "getSelectedItemProps" | "removeSelectedItem">, TagFieldVariantProps {
5
5
  isOpen: boolean;
6
6
  isInvalid: boolean;
7
7
  isDisabled: boolean;
8
8
  isReadOnly: boolean;
9
9
  }
10
10
  export declare const TagFieldStateContext: import("react").Context<TagFieldStateContextValue<any> | null>;
11
- export {};
12
11
  //# sourceMappingURL=tag-field-state-context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tag-field-state-context.d.ts","sourceRoot":"","sources":["../../../src/tag-field/tag-field-state-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,+BAA+B,EAChC,MAAM,WAAW,CAAA;AAGlB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1D,UAAU,yBAAyB,CAAC,CAAC,CACnC,SAAQ,aAAa,CAAC,CAAC,CAAC,EACtB,IAAI,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,cAAc,GAAG,kBAAkB,CAAC,EACpE,IAAI,CACF,+BAA+B,CAAC,CAAC,CAAC,EAClC,sBAAsB,GAAG,oBAAoB,CAC9C,EACD,oBAAoB;IACtB,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,EAAE,OAAO,CAAA;IAClB,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,oBAAoB,gEAE2B,CAAA"}
1
+ {"version":3,"file":"tag-field-state-context.d.ts","sourceRoot":"","sources":["../../../src/tag-field/tag-field-state-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,+BAA+B,EAChC,MAAM,WAAW,CAAA;AAGlB,OAAO,KAAK,EAAE,oBAAo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AC,CAAC,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;CACjE;AAED,eAAO,MAAM,eAAe,GAAI,CAAC,SAAS,MAAM,4BAG7C,oBAAoB,CAAC,CAAC,CAAC,iwBAwDzB,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;AAQ5C,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,EACzC,UAAU,EACV,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,CAAC,CAAC,2CA8ElB"}
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,26 +2,28 @@ 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 { SlotsToClasses, TagFieldItemSlots, TagFieldSlots, TagFieldVariantProps } from "@opengovsg/oui-theme";
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;
9
9
  /** The value of the TagField input. */
10
10
  inputValue: string;
11
11
  }
12
- export interface TagFieldListRenderProps<T> extends ReturnType<UseComboboxReturnValue<T>["getItemProps"]> {
12
+ export interface TagFieldBaseItemProps<T> extends ReturnType<UseComboboxReturnValue<T>["getItemProps"]> {
13
+ style?: React.CSSProperties;
14
+ }
15
+ export interface TagFieldListRenderProps<T> {
13
16
  item: T;
14
17
  key: VirtualItem["key"];
15
18
  isHighlighted: boolean;
16
- style?: React.CSSProperties;
17
- className?: string;
18
- itemClassNames?: SlotsToClasses<TagFieldItemSlots>;
19
+ classNames?: SlotsToClasses<ListBoxItemSlots>;
20
+ itemProps: TagFieldBaseItemProps<T>;
19
21
  }
20
22
  export interface TagFieldRenderProps<T> extends TagFieldListRenderProps<T> {
21
23
  }
22
24
  export interface TagFieldProps<T> extends Omit<MultipleSelection, "disallowEmptySelection" | "onSelectionChange" | "selectionMode" | "selectedKeys" | "defaultSelectedKeys">, InputBase, TextInputBase, Validation<TagFieldValidationValue>, FocusableProps<HTMLInputElement>, LabelableProps, HelpTextProps, TagFieldVariantProps {
23
25
  classNames?: SlotsToClasses<TagFieldSlots>;
24
- itemClassNames?: SlotsToClasses<TagFieldItemSlots>;
26
+ itemClassNames?: SlotsToClasses<ListBoxItemSlots>;
25
27
  children?: (values: TagFieldRenderProps<T>) => ReactNode;
26
28
  /** The filter function used to determine if a option should be included in the combo box list. */
27
29
  defaultFilter?: (textValue: string, inputValue: string) => boolean;