@opengovsg/oui 0.0.44 → 0.0.46

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 (100) hide show
  1. package/dist/cjs/field/field.cjs +15 -12
  2. package/dist/cjs/index.cjs +40 -0
  3. package/dist/cjs/phone-number-field/constants.cjs +500 -0
  4. package/dist/cjs/phone-number-field/context.cjs +11 -0
  5. package/dist/cjs/phone-number-field/i18n.cjs +1043 -0
  6. package/dist/cjs/phone-number-field/index.cjs +32 -0
  7. package/dist/cjs/phone-number-field/phone-number-field.cjs +299 -0
  8. package/dist/cjs/phone-number-field/types.cjs +3 -0
  9. package/dist/cjs/select/i18n.cjs +23 -0
  10. package/dist/cjs/select/select.cjs +45 -45
  11. package/dist/cjs/sidebar/context.cjs +24 -0
  12. package/dist/cjs/sidebar/i18n.cjs +23 -0
  13. package/dist/cjs/sidebar/index.cjs +17 -0
  14. package/dist/cjs/sidebar/sidebar-header.cjs +40 -0
  15. package/dist/cjs/sidebar/sidebar-item.cjs +61 -0
  16. package/dist/cjs/sidebar/sidebar-list.cjs +213 -0
  17. package/dist/cjs/sidebar/sidebar-root.cjs +63 -0
  18. package/dist/cjs/sidebar/sidebar.cjs +31 -0
  19. package/dist/cjs/sidebar/types.cjs +3 -0
  20. package/dist/cjs/sidebar/utils.cjs +12 -0
  21. package/dist/cjs/system/l10n.cjs +18 -0
  22. package/dist/cjs/system/react-utils/sizing.cjs +21 -0
  23. package/dist/cjs/tooltip/index.cjs +9 -0
  24. package/dist/cjs/tooltip/tooltip.cjs +54 -0
  25. package/dist/esm/field/field.js +18 -15
  26. package/dist/esm/index.js +8 -0
  27. package/dist/esm/phone-number-field/constants.js +497 -0
  28. package/dist/esm/phone-number-field/context.js +8 -0
  29. package/dist/esm/phone-number-field/i18n.js +1041 -0
  30. package/dist/esm/phone-number-field/index.js +3 -0
  31. package/dist/esm/phone-number-field/phone-number-field.js +294 -0
  32. package/dist/esm/phone-number-field/types.js +1 -0
  33. package/dist/esm/select/i18n.js +21 -0
  34. package/dist/esm/select/select.js +45 -45
  35. package/dist/esm/sidebar/context.js +17 -0
  36. package/dist/esm/sidebar/i18n.js +21 -0
  37. package/dist/esm/sidebar/index.js +6 -0
  38. package/dist/esm/sidebar/sidebar-header.js +38 -0
  39. package/dist/esm/sidebar/sidebar-item.js +59 -0
  40. package/dist/esm/sidebar/sidebar-list.js +211 -0
  41. package/dist/esm/sidebar/sidebar-root.js +61 -0
  42. package/dist/esm/sidebar/sidebar.js +28 -0
  43. package/dist/esm/sidebar/types.js +1 -0
  44. package/dist/esm/sidebar/utils.js +9 -0
  45. package/dist/esm/system/l10n.js +16 -0
  46. package/dist/esm/system/react-utils/sizing.js +19 -0
  47. package/dist/esm/tooltip/index.js +2 -0
  48. package/dist/esm/tooltip/tooltip.js +51 -0
  49. package/dist/types/field/field.d.ts +1 -1
  50. package/dist/types/field/field.d.ts.map +1 -1
  51. package/dist/types/index.d.mts +3 -0
  52. package/dist/types/index.d.ts +3 -0
  53. package/dist/types/index.d.ts.map +1 -1
  54. package/dist/types/phone-number-field/constants.d.ts +495 -0
  55. package/dist/types/phone-number-field/constants.d.ts.map +1 -0
  56. package/dist/types/phone-number-field/context.d.ts +15 -0
  57. package/dist/types/phone-number-field/context.d.ts.map +1 -0
  58. package/dist/types/phone-number-field/i18n.d.ts +1039 -0
  59. package/dist/types/phone-number-field/i18n.d.ts.map +1 -0
  60. package/dist/types/phone-number-field/index.d.ts +9 -0
  61. package/dist/types/phone-number-field/index.d.ts.map +1 -0
  62. package/dist/types/phone-number-field/phone-number-field.d.ts +42 -0
  63. package/dist/types/phone-number-field/phone-number-field.d.ts.map +1 -0
  64. package/dist/types/phone-number-field/types.d.ts +21 -0
  65. package/dist/types/phone-number-field/types.d.ts.map +1 -0
  66. package/dist/types/select/i18n.d.ts +19 -0
  67. package/dist/types/select/i18n.d.ts.map +1 -0
  68. package/dist/types/select/select.d.ts +11 -1
  69. package/dist/types/select/select.d.ts.map +1 -1
  70. package/dist/types/sidebar/context.d.ts +22 -0
  71. package/dist/types/sidebar/context.d.ts.map +1 -0
  72. package/dist/types/sidebar/i18n.d.ts +19 -0
  73. package/dist/types/sidebar/i18n.d.ts.map +1 -0
  74. package/dist/types/sidebar/index.d.ts +7 -0
  75. package/dist/types/sidebar/index.d.ts.map +1 -0
  76. package/dist/types/sidebar/sidebar-header.d.ts +6 -0
  77. package/dist/types/sidebar/sidebar-header.d.ts.map +1 -0
  78. package/dist/types/sidebar/sidebar-item.d.ts +3 -0
  79. package/dist/types/sidebar/sidebar-item.d.ts.map +1 -0
  80. package/dist/types/sidebar/sidebar-list.d.ts +3 -0
  81. package/dist/types/sidebar/sidebar-list.d.ts.map +1 -0
  82. package/dist/types/sidebar/sidebar-root.d.ts +17 -0
  83. package/dist/types/sidebar/sidebar-root.d.ts.map +1 -0
  84. package/dist/types/sidebar/sidebar.d.ts +8 -0
  85. package/dist/types/sidebar/sidebar.d.ts.map +1 -0
  86. package/dist/types/sidebar/types.d.ts +48 -0
  87. package/dist/types/sidebar/types.d.ts.map +1 -0
  88. package/dist/types/sidebar/utils.d.ts +4 -0
  89. package/dist/types/sidebar/utils.d.ts.map +1 -0
  90. package/dist/types/system/l10n.d.ts +10 -0
  91. package/dist/types/system/l10n.d.ts.map +1 -0
  92. package/dist/types/system/react-utils/children.d.ts +1 -2
  93. package/dist/types/system/react-utils/children.d.ts.map +1 -1
  94. package/dist/types/system/react-utils/sizing.d.ts +8 -0
  95. package/dist/types/system/react-utils/sizing.d.ts.map +1 -0
  96. package/dist/types/tooltip/index.d.ts +2 -0
  97. package/dist/types/tooltip/index.d.ts.map +1 -0
  98. package/dist/types/tooltip/tooltip.d.ts +16 -0
  99. package/dist/types/tooltip/tooltip.d.ts.map +1 -0
  100. package/package.json +7 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/phone-number-field/i18n.ts"],"names":[],"mappings":"AAGA,eAAO,MA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;;;;;;;;;;;;;;;;;;;;CAghCI,CAAA"}
@@ -0,0 +1,9 @@
1
+ export { PhoneNumberField, CountrySelect, FlagComponent, PhoneInput, } from "./phone-number-field";
2
+ export type { PhoneNumberFieldProps, CountrySelectProps, FlagComponentProps, PhoneInputProps, } from "./phone-number-field";
3
+ export { formatPhoneNumber, formatPhoneNumberIntl, parsePhoneNumber, isPossiblePhoneNumber,
4
+ /**
5
+ * @deprecated Use `isPossiblePhoneNumber` instead. The rationale is that telephone numbering plans can and sometimes do change, meaning that `isValidPhoneNumber()` function may one day become outdated on a website that isn't actively maintained anymore.
6
+ */
7
+ isValidPhoneNumber, } from "react-phone-number-input";
8
+ export type { Value as E164Number } from "react-phone-number-input";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/phone-number-field/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,UAAU,GACX,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GAChB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB;AACrB;;GAEG;AACH,kBAAkB,GACnB,MAAM,0BAA0B,CAAA;AAEjC,YAAY,EAAE,KAAK,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,42 @@
1
+ import type { FocusEvents } from "react-aria";
2
+ import type { InputProps as AriaInputProps, TextFieldProps, ValidationResult } from "react-aria-components";
3
+ import type { Props as ComponentPhoneInputProps, Country, Value as E164Number, ExternalValue, FlagProps } from "react-phone-number-input";
4
+ import type { SetOptional } from "type-fest";
5
+ import type { PhoneNumberFieldSlots, PhoneNumberFieldVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
6
+ import type { InputProps } from "../input";
7
+ import type { BasePhoneInputProps } from "./types";
8
+ export interface PhoneInputProps extends InputProps {
9
+ onClear?: () => void;
10
+ }
11
+ export declare const PhoneInput: ({ onClear, onKeyDown, ...props }: PhoneInputProps) => import("react/jsx-runtime").JSX.Element;
12
+ export interface PhoneNumberFieldProps extends Omit<Partial<ComponentPhoneInputProps<Omit<AriaInputProps, "size">>>, "disabled">, BasePhoneInputProps, PhoneNumberFieldVariantProps {
13
+ label?: React.ReactNode;
14
+ description?: React.ReactNode;
15
+ errorMessage?: React.ReactNode | ((validation: ValidationResult) => string);
16
+ isInvalid?: TextFieldProps["isInvalid"];
17
+ classNames?: SlotsToClasses<PhoneNumberFieldSlots>;
18
+ defaultValue?: ExternalValue | E164Number;
19
+ /**
20
+ * Whether to use the international phone input with country select (default) or a non-international phone input with a fixed country code.
21
+ * When the variant is `local`, the formatting of the phone number will be based on the `defaultCountry` prop.
22
+ */
23
+ variant?: PhoneNumberFieldVariantProps["variant"];
24
+ }
25
+ export declare const PhoneNumberField: (originalProps: PhoneNumberFieldProps) => import("react/jsx-runtime").JSX.Element;
26
+ type CountryItem = {
27
+ label: string;
28
+ value: Country | undefined;
29
+ };
30
+ export interface CountrySelectProps extends Pick<FocusEvents, "onBlur" | "onFocus"> {
31
+ value: string;
32
+ options: CountryItem[];
33
+ onChange: (country: Country) => void;
34
+ disabled?: boolean;
35
+ }
36
+ export declare function CountrySelect(props: CountrySelectProps): import("react/jsx-runtime").JSX.Element;
37
+ export interface FlagComponentProps extends SetOptional<FlagProps, "country"> {
38
+ className?: string;
39
+ }
40
+ export declare const FlagComponent: ({ country, countryName, className, }: FlagComponentProps) => import("react/jsx-runtime").JSX.Element;
41
+ export {};
42
+ //# sourceMappingURL=phone-number-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-number-field.d.ts","sourceRoot":"","sources":["../../../src/phone-number-field/phone-number-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,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AO,MAAM,gBAAgB,kBAAmB,qBAAqB,4CAiIpE,CAAA;AAED,KAAK,WAAW,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,GAAG,SAAS,CAAA;CAAE,CAAA;AAEhE,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,2CA0EtD;AAED,MAAM,WAAW,kBAAmB,SAAQ,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC;IAC3E,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,aAAa,yCAIvB,kBAAkB,4CAMpB,CAAA"}
@@ -0,0 +1,21 @@
1
+ import type { Country } from "react-phone-number-input";
2
+ export interface BasePhoneInputProps {
3
+ /**
4
+ * Set the input's placeholder to an example number for the selected country,
5
+ * and update it if the country changes.
6
+ *
7
+ * By default it is set to "polite", which means it will only set the
8
+ * placeholder if the input doesn't already have one. You can also set it to
9
+ * "aggressive", which will replace any existing placeholder, or "off" to not
10
+ * show any example numbers in the placeholder.
11
+ */
12
+ placeholderMode?: "polite" | "aggressive" | "off";
13
+ /**
14
+ * Examples to retrieve placeholder number from, if any. Defaults to
15
+ * `MOBILE_EXAMPLES` if none provided.
16
+ */
17
+ examples?: {
18
+ [country in Country]: string;
19
+ };
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/phone-number-field/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAEvD,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAA;IAEjD;;;OAGG;IACH,QAAQ,CAAC,EAAE;SAAG,OAAO,IAAI,OAAO,GAAG,MAAM;KAAE,CAAA;CAC5C"}
@@ -0,0 +1,19 @@
1
+ export declare const i18nStrings: {
2
+ "en-SG": {
3
+ "Search...": string;
4
+ "Search options": string;
5
+ };
6
+ "zh-SG": {
7
+ "Search...": string;
8
+ "Search options": string;
9
+ };
10
+ "ms-SG": {
11
+ "Search...": string;
12
+ "Search options": string;
13
+ };
14
+ "ta-SG": {
15
+ "Search...": string;
16
+ "Search options": string;
17
+ };
18
+ };
19
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/select/i18n.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAiBI,CAAA"}
@@ -1,6 +1,8 @@
1
- import type { SelectProps as AriaSelectProps, ListBoxProps, ListLayoutOptions, ValidationResult } from "react-aria-components";
1
+ import type { SelectProps as AriaSelectProps, ListBoxProps, ListLayoutOptions, SelectValueRenderProps, 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
+ import type { PopoverProps } from "../popover";
5
+ import type { ChildrenOrFunction } from "../system/react-utils/children";
4
6
  export interface SelectProps<T> extends Omit<AriaSelectProps, "children">, VariantProps<typeof selectStyles> {
5
7
  classNames?: SlotsToClasses<SelectVariantSlots | "error">;
6
8
  /**
@@ -27,6 +29,14 @@ export interface SelectProps<T> extends Omit<AriaSelectProps, "children">, Varia
27
29
  * Icon to display in the search field. If not provided, no icon will be displayed.
28
30
  */
29
31
  searchIcon?: React.ReactNode;
32
+ /**
33
+ * Custom renderer for the selected value displayed in the trigger button.
34
+ * If not provided, the default renderer will display the selected option's text.
35
+ * The render prop function receives the same props as the children of SelectValue.
36
+ * You can use these props to conditionally render based on the selected option's state (e.g. isPlaceholder).
37
+ */
38
+ renderSelectValue?: ChildrenOrFunction<SelectValueRenderProps<T>>;
39
+ popoverProps?: Partial<PopoverProps>;
30
40
  }
31
41
  export declare function Select<T extends object>({ label, description, classNames, errorMessage, ...originalProps }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
32
42
  //# sourceMappingURL=select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAiB9B,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAA0B,YAAY,EAAE,MAAM,sBAAsB,CAAA;AA2B3E,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,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,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;IAEtC;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAE5B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAA;IAEjE,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;CACrC;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,2CA+JhB"}
@@ -0,0 +1,22 @@
1
+ import type { TooltipProps, TooltipTriggerComponentProps } from "react-aria-components";
2
+ import type { SidebarSlots, sidebarStyles, SlotsToClasses } from "@opengovsg/oui-theme";
3
+ export interface UseProvideSidebarStylesReturn {
4
+ slots: ReturnType<typeof sidebarStyles>;
5
+ classNames?: SlotsToClasses<SidebarSlots>;
6
+ }
7
+ export declare const SidebarStyleContext: import("react").Context<UseProvideSidebarStylesReturn>, useSidebarStyleContext: () => UseProvideSidebarStylesReturn;
8
+ export interface SidebarCollapseContextProps {
9
+ isCollapsed: boolean;
10
+ setCollapsed?: (collapsed: boolean) => void;
11
+ tooltipProps?: Partial<TooltipProps>;
12
+ tooltipTriggerProps?: Partial<TooltipTriggerComponentProps>;
13
+ }
14
+ export type SidebarCollapseContextReturn = SidebarCollapseContextProps;
15
+ export declare const SidebarCollapseContext: import("react").Context<SidebarCollapseContextProps>, useSidebarCollapseContext: () => SidebarCollapseContextProps;
16
+ export interface SidebarNestContextProps {
17
+ isNested: boolean;
18
+ isExpanded: boolean;
19
+ }
20
+ export type SidebarNestContextReturn = SidebarNestContextProps;
21
+ export declare const SidebarNestContext: import("react").Context<SidebarNestContextProps | undefined>, useSidebarNestContext: () => SidebarNestContextProps | undefined;
22
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/sidebar/context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,EACZ,4BAA4B,EAC7B,MAAM,uBAAuB,CAAA;AAE9B,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACf,MAAM,sBAAsB,CAAA;AAI7B,MAAM,WAAW,6BAA6B;IAC5C,KAAK,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;IACvC,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;CAC1C;AAED,eAAO,MAAO,mBAAmB,0DAAE,sBAAsB,qCAGrD,CAAA;AAEJ,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAE3C,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAA;CAC5D;AAED,MAAM,MAAM,4BAA4B,GAAG,2BAA2B,CAAA;AAEtE,eAAO,MAAO,sBAAsB,wDAAE,yBAAyB,mCAG3D,CAAA;AAEJ,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,MAAM,wBAAwB,GAAG,uBAAuB,CAAA;AAE9D,eAAO,MAAO,kBAAkB,gEAAE,qBAAqB,2CAOrD,CAAA"}
@@ -0,0 +1,19 @@
1
+ export declare const i18nStrings: {
2
+ "en-SG": {
3
+ "Expand sidebar section": string;
4
+ "Collapse sidebar section": string;
5
+ };
6
+ "zh-SG": {
7
+ "Expand sidebar section": string;
8
+ "Collapse sidebar section": string;
9
+ };
10
+ "ms-SG": {
11
+ "Expand sidebar section": string;
12
+ "Collapse sidebar section": string;
13
+ };
14
+ "ta-SG": {
15
+ "Expand sidebar section": string;
16
+ "Collapse sidebar section": string;
17
+ };
18
+ };
19
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/sidebar/i18n.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAiBI,CAAA"}
@@ -0,0 +1,7 @@
1
+ export * from "./sidebar";
2
+ export * from "./sidebar-root";
3
+ export * from "./sidebar-item";
4
+ export * from "./sidebar-list";
5
+ export * from "./sidebar-header";
6
+ export type { SidebarItemProps, SidebarListProps, SidebarHeaderProps, GeneratedSidebarItem, } from "./types";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sidebar/index.tsx"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,YAAY,EACV,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,SAAS,CAAA"}
@@ -0,0 +1,6 @@
1
+ export declare const SidebarHeader: import("../system/utils").InternalForwardRefRenderFunction<"div", {
2
+ startContent?: React.ReactNode;
3
+ endContent?: React.ReactNode;
4
+ tooltip?: string;
5
+ }, never>;
6
+ //# sourceMappingURL=sidebar-header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-header.d.ts","sourceRoot":"","sources":["../../../src/sidebar/sidebar-header.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa;mBAJY,MAAO,SAAS;iBACjD,MAAO,SAAS;;SA2BpB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { SidebarItemProps } from "./types";
2
+ export declare const SidebarItem: import("../system/utils").InternalForwardRefRenderFunction<"li", SidebarItemProps, never>;
3
+ //# sourceMappingURL=sidebar-item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-item.d.ts","sourceRoot":"","sources":["../../../src/sidebar/sidebar-item.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAU/C,eAAO,MAAM,WAAW,2FAsDvB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { SidebarListProps } from "./types";
2
+ export declare const SidebarList: import("../system/utils").InternalForwardRefRenderFunction<"li", SidebarListProps, never>;
3
+ //# sourceMappingURL=sidebar-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-list.d.ts","sourceRoot":"","sources":["../../../src/sidebar/sidebar-list.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AA+G/C,eAAO,MAAM,WAAW,2FAsFvB,CAAA"}
@@ -0,0 +1,17 @@
1
+ import type { PropsWithChildren } from "react";
2
+ import type { TooltipProps, TooltipTriggerComponentProps } from "react-aria-components";
3
+ import type { SidebarSlots, SidebarVariantProps, SlotsToClasses } from "@opengovsg/oui-theme";
4
+ export interface SidebarRootProps extends PropsWithChildren<SidebarVariantProps> {
5
+ className?: string;
6
+ classNames?: SlotsToClasses<SidebarSlots>;
7
+ /** Whether the sidebar is collapsed (controlled). */
8
+ isCollapsed?: boolean;
9
+ /** Whether the sidebar is collapsed by default (uncontrolled). */
10
+ defaultCollapsed?: boolean;
11
+ /** Handler that is called when the sidebar's collapsed state changes. */
12
+ onCollapsedChange?: (isCollapsed: boolean) => void;
13
+ tooltipProps?: Partial<TooltipProps>;
14
+ tooltipTriggerProps?: Partial<TooltipTriggerComponentProps>;
15
+ }
16
+ export declare const SidebarRoot: ({ className, classNames, defaultCollapsed, onCollapsedChange, tooltipProps, tooltipTriggerProps, ...originalProps }: SidebarRootProps) => import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=sidebar-root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-root.d.ts","sourceRoot":"","sources":["../../../src/sidebar/sidebar-root.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,EACV,YAAY,EACZ,4BAA4B,EAC7B,MAAM,uBAAuB,CAAA;AAI9B,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAM7B,MAAM,WAAW,gBACf,SAAQ,iBAAiB,CAAC,mBAAmB,CAAC;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;IAEzC,qDAAqD;IACrD,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;IAElD,YAAY,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAA;IACpC,mBAAmB,CAAC,EAAE,OAAO,CAAC,4BAA4B,CAAC,CAAA;CAC5D;AAED,eAAO,MAAM,WAAW,wHAQrB,gBAAgB,4CAuClB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { SidebarRootProps } from "./sidebar-root";
2
+ import type { GeneratedSidebarItem } from "./types";
3
+ export declare const generateSidebarItems: (items: GeneratedSidebarItem[]) => import("react/jsx-runtime").JSX.Element[];
4
+ export interface SidebarProps extends SidebarRootProps {
5
+ items: GeneratedSidebarItem[];
6
+ }
7
+ export declare const Sidebar: ({ items, ...props }: SidebarProps) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=sidebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/sidebar/sidebar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAQnD,eAAO,MAAM,oBAAoB,UAAW,oBAAoB,EAAE,8CAgBjE,CAAA;AAED,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,KAAK,EAAE,oBAAoB,EAAE,CAAA;CAC9B;AAED,eAAO,MAAM,OAAO,wBAAyB,YAAY,4CAGxD,CAAA"}
@@ -0,0 +1,48 @@
1
+ import type { LinkProps } from "react-aria-components";
2
+ type BaseSidebarItemProps = {
3
+ startContent?: React.ReactNode;
4
+ endContent?: React.ReactNode;
5
+ /**
6
+ * Will be used as the accessible label when the sidebar is collapsed
7
+ */
8
+ tooltip?: string;
9
+ };
10
+ export interface SidebarItemProps extends BaseSidebarItemProps, LinkProps {
11
+ /** Whether the element is currently selected */
12
+ isSelected?: boolean | (() => boolean);
13
+ }
14
+ export type SidebarHeaderProps = BaseSidebarItemProps;
15
+ export interface SidebarListProps extends SidebarItemProps {
16
+ label: React.ReactNode;
17
+ /** Controlled state for expansion of section */
18
+ isExpanded?: boolean;
19
+ /** Uncontrolled state for expansion of section */
20
+ defaultIsExpanded?: boolean;
21
+ /** Controlled callback for when section's expansion state changes */
22
+ onExpand?: (nextState: boolean) => void;
23
+ /** Only allow toggling of expand state when clicking the caret.
24
+ * Could be useful if user wants to use the list item as a link.
25
+ *
26
+ * @default false
27
+ */
28
+ onlyCaretToggle?: boolean;
29
+ children: React.ReactNode;
30
+ /**
31
+ * Props to be passed to the link component when the sidebar list is used as a link.
32
+ * @note Will not be used if `onlyCaretToggle` is false, since the entire list item will be a trigger for the expansion.
33
+ */
34
+ linkProps?: LinkProps;
35
+ }
36
+ interface GeneratedBase extends BaseSidebarItemProps, Pick<SidebarItemProps, "isSelected"> {
37
+ }
38
+ export interface GeneratedItem extends GeneratedBase, SidebarItemProps {
39
+ }
40
+ export interface GeneratedHeader extends SidebarHeaderProps {
41
+ type: "header";
42
+ }
43
+ export interface GeneratedList extends Omit<GeneratedBase, "children">, SidebarListProps {
44
+ subItems: (GeneratedList | GeneratedItem | GeneratedHeader)[];
45
+ }
46
+ export type GeneratedSidebarItem = GeneratedList | GeneratedItem | GeneratedHeader;
47
+ export {};
48
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEtD,KAAK,oBAAoB,GAAG;IAC1B,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,WAAW,gBAAiB,SAAQ,oBAAoB,EAAE,SAAS;IACvE,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAA;CACvC;AAED,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AAErD,MAAM,WAAW,gBAAiB,SAAQ,gBAAgB;IACxD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB,gDAAgD;IAChD,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IACvC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,UAAU,aACR,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC;CAAG;AAC3C,MAAM,WAAW,aAAc,SAAQ,aAAa,EAAE,gBAAgB;CAAG;AACzE,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,IAAI,EAAE,QAAQ,CAAA;CACf;AACD,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,CAAC,EACrC,gBAAgB;IAClB,QAAQ,EAAE,CAAC,aAAa,GAAG,aAAa,GAAG,eAAe,CAAC,EAAE,CAAA;CAC9D;AAED,MAAM,MAAM,oBAAoB,GAC5B,aAAa,GACb,aAAa,GACb,eAAe,CAAA"}
@@ -0,0 +1,4 @@
1
+ import type { GeneratedHeader, GeneratedList, GeneratedSidebarItem } from "./types";
2
+ export declare const isNestableItem: (item: GeneratedSidebarItem) => item is GeneratedList;
3
+ export declare const isHeaderItem: (item: GeneratedSidebarItem) => item is GeneratedHeader;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/sidebar/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAEhB,eAAO,MAAM,cAAc,SACnB,oBAAoB,KACzB,IAAI,IAAI,aAEV,CAAA;AACD,eAAO,MAAM,YAAY,SACjB,oBAAoB,KACzB,IAAI,IAAI,eAEV,CAAA"}
@@ -0,0 +1,10 @@
1
+ import type { LocalizedString, LocalizedStrings } from "@internationalized/string";
2
+ import { LocalizedStringFormatter } from "@internationalized/string";
3
+ /**
4
+ * Provides localized string formatting for the current locale. Supports interpolating variables,
5
+ * selecting the correct pluralization, and formatting numbers. Automatically updates when the locale changes.
6
+ *
7
+ * @param strings - A mapping of languages to localized strings by key.
8
+ */
9
+ export declare function useLocalizedStringFormatter<K extends string = string, T extends LocalizedString = string>(strings: LocalizedStrings<K, T>, packageName?: string): LocalizedStringFormatter<K, T>;
10
+ //# sourceMappingURL=l10n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"l10n.d.ts","sourceRoot":"","sources":["../../../src/system/l10n.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EACjB,MAAM,2BAA2B,CAAA;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAIpE;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,CAAC,SAAS,MAAM,GAAG,MAAM,EACzB,CAAC,SAAS,eAAe,GAAG,MAAM,EAElC,OAAO,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,EAC/B,WAAW,CAAC,EAAE,MAAM,GACnB,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAOhC"}
@@ -1,5 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
- type ChildrenOrFunction<T> = ReactNode | ((values: T) => ReactNode);
2
+ export type ChildrenOrFunction<T> = ReactNode | ((values: T) => ReactNode);
3
3
  /**
4
4
  * Gets only the valid children of a component,
5
5
  * and ignores any nullish or falsy child.
@@ -9,5 +9,4 @@ type ChildrenOrFunction<T> = ReactNode | ((values: T) => ReactNode);
9
9
  export declare function getValidChildren(children: React.ReactNode): React.ReactElement[];
10
10
  export declare const pickChildren: <T = ReactNode>(children: T | undefined, targetChild: React.ElementType) => [T | undefined, T[] | undefined];
11
11
  export declare const renderChildren: <T>(renderProps: T, children: ChildrenOrFunction<T>) => ReactNode;
12
- export {};
13
12
  //# sourceMappingURL=children.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"children.d.ts","sourceRoot":"","sources":["../../../../src/system/react-utils/children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,KAAK,kBAAkB,CAAC,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,SAAS,CAAC,CAAA;AAEnE;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,GAGnD,KAAK,CAAC,YAAY,EAAE,CAC1B;AAED,eAAO,MAAM,YAAY,GAAI,CAAC,wBAClB,CAAC,GAAG,SAAS,eACV,KAAK,CAAC,WAAW,KAC7B,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,GAAG,SAAS,CAiBjC,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,eACjB,CAAC,YACJ,kBAAkB,CAAC,CAAC,CAAC,cAOhC,CAAA"}
1
+ {"version":3,"file":"children.d.ts","sourceRoot":"","sources":["../../../../src/system/react-utils/children.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,SAAS,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,SAAS,CAAC,CAAA;AAE1E;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,GAGnD,KAAK,CAAC,YAAY,EAAE,CAC1B;AAED,eAAO,MAAM,YAAY,GAAI,CAAC,wBAClB,CAAC,GAAG,SAAS,eACV,KAAK,CAAC,WAAW,KAC7B,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,GAAG,SAAS,CAiBjC,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,CAAC,eACjB,CAAC,YACJ,kBAAkB,CAAC,CAAC,CAAC,cAOhC,CAAA"}
@@ -0,0 +1,8 @@
1
+ import type { RefObject } from "react";
2
+ /**
3
+ * Extracted from Select.tsx in react-aria-components. Used as a workaround for https://github.com/adobe/react-spectrum/issues/9451
4
+ *
5
+ * @see https://github.com/adobe/react-spectrum/blob/245a7031367d5f1d1264071b5dd84cc7b367513e/packages/react-aria-components/src/Select.tsx#L166-L176
6
+ */
7
+ export declare function useElementWidth(ref: RefObject<Element | null> | undefined): string | null;
8
+ //# sourceMappingURL=sizing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sizing.d.ts","sourceRoot":"","sources":["../../../../src/system/react-utils/sizing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,iBAezE"}
@@ -0,0 +1,2 @@
1
+ export * from "./tooltip";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tooltip/index.tsx"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { TooltipProps as AriaTooltipProps, TooltipRenderProps, TooltipTriggerComponentProps } from "react-aria-components";
2
+ import type { SlotsToClassesWithRenderProps, TooltipSlots, TooltipVariantProps } from "@opengovsg/oui-theme";
3
+ export interface TooltipProps extends Omit<AriaTooltipProps, "children">, TooltipVariantProps {
4
+ children: React.ReactNode;
5
+ /**
6
+ * Whether to show the arrow pointing to the trigger element.
7
+ * @default true
8
+ */
9
+ showArrow?: boolean;
10
+ classNames?: SlotsToClassesWithRenderProps<TooltipSlots, TooltipRenderProps>;
11
+ }
12
+ export declare function Tooltip(originalProps: TooltipProps): import("react/jsx-runtime").JSX.Element;
13
+ export interface TooltipTriggerProps extends TooltipTriggerComponentProps {
14
+ }
15
+ export declare function TooltipTrigger(props: TooltipTriggerProps): import("react/jsx-runtime").JSX.Element;
16
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../src/tooltip/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,uBAAuB,CAAA;AAO9B,OAAO,KAAK,EACV,6BAA6B,EAC7B,YAAY,EACZ,mBAAmB,EACpB,MAAM,sBAAsB,CAAA;AAK7B,MAAM,WAAW,YACf,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,EACxC,mBAAmB;IACrB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB,UAAU,CAAC,EAAE,6BAA6B,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAA;CAC7E;AAED,wBAAgB,OAAO,CAAC,aAAa,EAAE,YAAY,2CA+ClD;AAGD,MAAM,WAAW,mBAAoB,SAAQ,4BAA4B;CAAG;AAE5E,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAExD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengovsg/oui",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "sideEffects": false,
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",
@@ -50,14 +50,15 @@
50
50
  "storybook": "10.1.10",
51
51
  "tsx": "^4.21.0",
52
52
  "typescript": "5.7.3",
53
- "@opengovsg/oui-theme": "0.0.44",
53
+ "@opengovsg/oui-theme": "0.0.46",
54
54
  "@oui/chromatic": "0.0.0",
55
55
  "@oui/eslint-config": "0.0.0",
56
- "@oui/typescript-config": "0.0.0",
57
- "@oui/prettier-config": "0.0.0"
56
+ "@oui/prettier-config": "0.0.0",
57
+ "@oui/typescript-config": "0.0.0"
58
58
  },
59
59
  "dependencies": {
60
60
  "@internationalized/date": "^3.10.1",
61
+ "@internationalized/string": "^3.2.7",
61
62
  "@react-aria/calendar": "^3.9.2",
62
63
  "@react-aria/focus": "^3.21.2",
63
64
  "@react-aria/i18n": "^3.12.13",
@@ -76,6 +77,7 @@
76
77
  "nanoid": "^5.1.5",
77
78
  "react-aria": "^3.41.1",
78
79
  "react-dropzone": "^14.3.8",
80
+ "react-phone-number-input": "^3.4.14",
79
81
  "react-stately": "^3.41.0",
80
82
  "scroll-into-view-if-needed": "^3.1.0",
81
83
  "sonner": "^2.0.7",
@@ -88,7 +90,7 @@
88
90
  "motion": ">=11.12.0 || >=12.0.0-alpha.1",
89
91
  "react": ">= 18",
90
92
  "react-aria-components": "^1.14.0",
91
- "@opengovsg/oui-theme": "0.0.44"
93
+ "@opengovsg/oui-theme": "0.0.46"
92
94
  },
93
95
  "scripts": {
94
96
  "build": "tsx ../../tooling/build-scripts/main.ts --dts --clean",