@opengovsg/oui 0.0.0-snapshot-20250401072718 → 0.0.0-snapshot-20250511111650

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.
@@ -7,9 +7,9 @@ var react = require('react');
7
7
  var reactAria = require('react-aria');
8
8
  var reactStately = require('react-stately');
9
9
  var ouiTheme = require('@opengovsg/oui-theme');
10
- var button = require('../button/button.cjs');
11
10
  var circleAlert = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/circle-alert.cjs');
12
11
  var info = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/info.cjs');
12
+ var button = require('../button/button.cjs');
13
13
  var x = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.cjs');
14
14
 
15
15
  const i18nStrings = {
@@ -2,7 +2,6 @@
2
2
  'use strict';
3
3
 
4
4
  var useControllableState = require('./hooks/use-controllable-state.cjs');
5
- var button = require('./button/button.cjs');
6
5
  var govtBanner = require('./govt-banner/govt-banner.cjs');
7
6
  var ripple = require('./ripple/ripple.cjs');
8
7
  var useRipple = require('./ripple/use-ripple.cjs');
@@ -19,13 +18,11 @@ var comboBox = require('./combo-box/combo-box.cjs');
19
18
  var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
20
19
  var comboBoxItem = require('./combo-box/combo-box-item.cjs');
21
20
  var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
22
- var banner = require('./banner/banner.cjs');
23
21
  var tagField = require('./tag-field/tag-field.cjs');
24
22
  var tagFieldItem = require('./tag-field/tag-field-item.cjs');
25
23
  var select = require('./select/select.cjs');
26
24
  var selectItem = require('./select/select-item.cjs');
27
25
  var selectVariantContext = require('./select/select-variant-context.cjs');
28
- var badge = require('./badge/badge.cjs');
29
26
  var calendar = require('./calendar/calendar.cjs');
30
27
  var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
31
28
  var utils = require('./calendar/utils.cjs');
@@ -33,11 +30,14 @@ var date = require('@internationalized/date');
33
30
  var rangeCalendar = require('./range-calendar/range-calendar.cjs');
34
31
  var menu = require('./menu/menu.cjs');
35
32
  var popover = require('./popover/popover.cjs');
33
+ var tabs = require('./tabs/tabs.cjs');
34
+ var button = require('./button/button.cjs');
35
+ var banner = require('./banner/banner.cjs');
36
+ var badge = require('./badge/badge.cjs');
36
37
 
37
38
 
38
39
 
39
40
  exports.useControllableState = useControllableState.useControllableState;
40
- exports.Button = button.Button;
41
41
  exports.GovtBanner = govtBanner.GovtBanner;
42
42
  exports.Ripple = ripple.Ripple;
43
43
  exports.useRipple = useRipple.useRipple;
@@ -59,14 +59,12 @@ exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
59
59
  exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
60
60
  exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
61
61
  exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
62
- exports.Banner = banner.Banner;
63
62
  exports.TagField = tagField.TagField;
64
63
  exports.TagFieldItem = tagFieldItem.TagFieldItem;
65
64
  exports.Select = select.Select;
66
65
  exports.SelectItem = selectItem.SelectItem;
67
66
  exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
68
67
  exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
69
- exports.Badge = badge.Badge;
70
68
  exports.Calendar = calendar.Calendar;
71
69
  exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
72
70
  exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
@@ -91,3 +89,12 @@ exports.MenuVariantContext = menu.MenuVariantContext;
91
89
  exports.SubmenuTrigger = menu.SubmenuTrigger;
92
90
  exports.useMenuVariantContext = menu.useMenuVariantContext;
93
91
  exports.Popover = popover.Popover;
92
+ exports.Tab = tabs.Tab;
93
+ exports.TabList = tabs.TabList;
94
+ exports.TabPanel = tabs.TabPanel;
95
+ exports.Tabs = tabs.Tabs;
96
+ exports.TabsVariantContext = tabs.TabsVariantContext;
97
+ exports.useTabsVariantContext = tabs.useTabsVariantContext;
98
+ exports.Button = button.Button;
99
+ exports.Banner = banner.Banner;
100
+ exports.Badge = badge.Badge;
@@ -6,12 +6,12 @@ var jsxRuntime = require('react/jsx-runtime');
6
6
  var react = require('react');
7
7
  var reactAriaComponents = require('react-aria-components');
8
8
  var ouiTheme = require('@opengovsg/oui-theme');
9
- var button = require('../button/button.cjs');
10
9
  var field = require('../field/field.cjs');
11
10
  var popover = require('../popover/popover.cjs');
12
11
  var utils = require('../system/utils.cjs');
13
12
  var selectVariantContext = require('./select-variant-context.cjs');
14
13
  var chevronDown = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.cjs');
14
+ var button = require('../button/button.cjs');
15
15
 
16
16
  const calculateEstimatedRowHeight = (size) => {
17
17
  switch (size) {
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ 'use strict';
3
+
4
+ var tabs = require('./tabs.cjs');
5
+
6
+
7
+
8
+ exports.Tab = tabs.Tab;
9
+ exports.TabList = tabs.TabList;
10
+ exports.TabPanel = tabs.TabPanel;
11
+ exports.Tabs = tabs.Tabs;
12
+ exports.TabsVariantContext = tabs.TabsVariantContext;
13
+ exports.useTabsVariantContext = tabs.useTabsVariantContext;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ "use client";
3
+ 'use strict';
4
+
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+ var react = require('react');
7
+ var reactAriaComponents = require('react-aria-components');
8
+ var ouiTheme = require('@opengovsg/oui-theme');
9
+ var utils = require('../system/utils.cjs');
10
+ var context = require('../system/react-utils/context.cjs');
11
+
12
+ const [TabsVariantContext, useTabsVariantContext] = context.createContext({
13
+ name: "TabsVariantContext",
14
+ strict: true
15
+ });
16
+ function Tabs(originalProps) {
17
+ const [props, variantProps] = utils.mapPropsVariants(
18
+ originalProps,
19
+ ouiTheme.tabsStyles.variantKeys
20
+ );
21
+ return /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Provider, { values: [[TabsVariantContext, variantProps]], children: /* @__PURE__ */ jsxRuntime.jsx(
22
+ reactAriaComponents.Tabs,
23
+ {
24
+ ...props,
25
+ className: reactAriaComponents.composeRenderProps(
26
+ props.className,
27
+ (className, renderProps) => ouiTheme.tabsStyles({ ...renderProps, ...variantProps, className })
28
+ )
29
+ }
30
+ ) });
31
+ }
32
+ const TabList = utils.forwardRefGeneric(function TabList2(originalProps, ref) {
33
+ [originalProps, ref] = reactAriaComponents.useContextProps(
34
+ originalProps,
35
+ ref,
36
+ TabsVariantContext
37
+ );
38
+ const [props, variantProps] = utils.mapPropsVariants(
39
+ originalProps,
40
+ ouiTheme.tabListStyles.variantKeys
41
+ );
42
+ return /* @__PURE__ */ jsxRuntime.jsx(
43
+ reactAriaComponents.TabList,
44
+ {
45
+ ref,
46
+ ...props,
47
+ className: reactAriaComponents.composeRenderProps(
48
+ props.className,
49
+ (className, renderProps) => ouiTheme.tabListStyles({ ...renderProps, ...variantProps, className })
50
+ )
51
+ }
52
+ );
53
+ });
54
+ const Tab = react.forwardRef(function Tab2(originalProps, ref) {
55
+ [originalProps, ref] = reactAriaComponents.useContextProps(
56
+ originalProps,
57
+ ref,
58
+ TabsVariantContext
59
+ );
60
+ const [{ children, startContent, endContent, ...props }, variantProps] = utils.mapPropsVariants(originalProps, ouiTheme.tabStyles.variantKeys);
61
+ return /* @__PURE__ */ jsxRuntime.jsx(
62
+ reactAriaComponents.Tab,
63
+ {
64
+ ref,
65
+ ...props,
66
+ isDisabled: originalProps.isDisabled,
67
+ className: reactAriaComponents.composeRenderProps(
68
+ props.className,
69
+ (className, renderProps) => ouiTheme.tabStyles({ ...renderProps, ...variantProps, className })
70
+ ),
71
+ children: (renderProps) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
72
+ startContent,
73
+ typeof children === "function" ? children(renderProps) : children,
74
+ endContent
75
+ ] })
76
+ }
77
+ );
78
+ });
79
+ function TabPanel(props) {
80
+ return /* @__PURE__ */ jsxRuntime.jsx(
81
+ reactAriaComponents.TabPanel,
82
+ {
83
+ ...props,
84
+ className: reactAriaComponents.composeRenderProps(
85
+ props.className,
86
+ (className, renderProps) => ouiTheme.tabPanelStyles({ ...renderProps, className })
87
+ )
88
+ }
89
+ );
90
+ }
91
+
92
+ exports.Tab = Tab;
93
+ exports.TabList = TabList;
94
+ exports.TabPanel = TabPanel;
95
+ exports.Tabs = Tabs;
96
+ exports.TabsVariantContext = TabsVariantContext;
97
+ exports.useTabsVariantContext = useTabsVariantContext;
@@ -5,9 +5,9 @@ import { useMemo, useRef } from 'react';
5
5
  import { useMessageFormatter, useDisclosure } from 'react-aria';
6
6
  import { useDisclosureState } from 'react-stately';
7
7
  import { bannerStyles } from '@opengovsg/oui-theme';
8
- import { Button } from '../button/button.js';
9
8
  import CircleAlert from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/circle-alert.js';
10
9
  import Info from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/info.js';
10
+ import { Button } from '../button/button.js';
11
11
  import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.js';
12
12
 
13
13
  const i18nStrings = {
package/dist/esm/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  export { useControllableState } from './hooks/use-controllable-state.js';
3
- export { Button } from './button/button.js';
4
3
  export { GovtBanner } from './govt-banner/govt-banner.js';
5
4
  export { Ripple } from './ripple/ripple.js';
6
5
  export { useRipple } from './ripple/use-ripple.js';
@@ -17,13 +16,11 @@ export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
17
16
  export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
18
17
  export { ComboBoxItem } from './combo-box/combo-box-item.js';
19
18
  export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
20
- export { Banner } from './banner/banner.js';
21
19
  export { TagField } from './tag-field/tag-field.js';
22
20
  export { TagFieldItem } from './tag-field/tag-field-item.js';
23
21
  export { Select } from './select/select.js';
24
22
  export { SelectItem } from './select/select-item.js';
25
23
  export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
26
- export { Badge } from './badge/badge.js';
27
24
  export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
28
25
  export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
29
26
  export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
@@ -31,3 +28,7 @@ export { CalendarDate } from '@internationalized/date';
31
28
  export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
32
29
  export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
33
30
  export { Popover } from './popover/popover.js';
31
+ export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext } from './tabs/tabs.js';
32
+ export { Button } from './button/button.js';
33
+ export { Banner } from './banner/banner.js';
34
+ export { Badge } from './badge/badge.js';
@@ -4,12 +4,12 @@ import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import { useMemo } from 'react';
5
5
  import { Provider, Select as Select$1, SelectValue, Virtualizer, ListLayout, ListBox } from 'react-aria-components';
6
6
  import { selectStyles, composeRenderProps } from '@opengovsg/oui-theme';
7
- import { Button } from '../button/button.js';
8
7
  import { Label, Description, FieldError } from '../field/field.js';
9
8
  import { Popover } from '../popover/popover.js';
10
9
  import { mapPropsVariants } from '../system/utils.js';
11
10
  import { SelectVariantContext } from './select-variant-context.js';
12
11
  import ChevronDown from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
12
+ import { Button } from '../button/button.js';
13
13
 
14
14
  const calculateEstimatedRowHeight = (size) => {
15
15
  switch (size) {
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext } from './tabs.js';
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ "use client";
3
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
+ import { forwardRef } from 'react';
5
+ import { useContextProps, TabList as TabList$1, composeRenderProps, Tab as Tab$1, Provider, Tabs as Tabs$1, TabPanel as TabPanel$1 } from 'react-aria-components';
6
+ import { tabListStyles, tabStyles, tabsStyles, tabPanelStyles } from '@opengovsg/oui-theme';
7
+ import { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
8
+ import { createContext } from '../system/react-utils/context.js';
9
+
10
+ const [TabsVariantContext, useTabsVariantContext] = createContext({
11
+ name: "TabsVariantContext",
12
+ strict: true
13
+ });
14
+ function Tabs(originalProps) {
15
+ const [props, variantProps] = mapPropsVariants(
16
+ originalProps,
17
+ tabsStyles.variantKeys
18
+ );
19
+ return /* @__PURE__ */ jsx(Provider, { values: [[TabsVariantContext, variantProps]], children: /* @__PURE__ */ jsx(
20
+ Tabs$1,
21
+ {
22
+ ...props,
23
+ className: composeRenderProps(
24
+ props.className,
25
+ (className, renderProps) => tabsStyles({ ...renderProps, ...variantProps, className })
26
+ )
27
+ }
28
+ ) });
29
+ }
30
+ const TabList = forwardRefGeneric(function TabList2(originalProps, ref) {
31
+ [originalProps, ref] = useContextProps(
32
+ originalProps,
33
+ ref,
34
+ TabsVariantContext
35
+ );
36
+ const [props, variantProps] = mapPropsVariants(
37
+ originalProps,
38
+ tabListStyles.variantKeys
39
+ );
40
+ return /* @__PURE__ */ jsx(
41
+ TabList$1,
42
+ {
43
+ ref,
44
+ ...props,
45
+ className: composeRenderProps(
46
+ props.className,
47
+ (className, renderProps) => tabListStyles({ ...renderProps, ...variantProps, className })
48
+ )
49
+ }
50
+ );
51
+ });
52
+ const Tab = forwardRef(function Tab2(originalProps, ref) {
53
+ [originalProps, ref] = useContextProps(
54
+ originalProps,
55
+ ref,
56
+ TabsVariantContext
57
+ );
58
+ const [{ children, startContent, endContent, ...props }, variantProps] = mapPropsVariants(originalProps, tabStyles.variantKeys);
59
+ return /* @__PURE__ */ jsx(
60
+ Tab$1,
61
+ {
62
+ ref,
63
+ ...props,
64
+ isDisabled: originalProps.isDisabled,
65
+ className: composeRenderProps(
66
+ props.className,
67
+ (className, renderProps) => tabStyles({ ...renderProps, ...variantProps, className })
68
+ ),
69
+ children: (renderProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
70
+ startContent,
71
+ typeof children === "function" ? children(renderProps) : children,
72
+ endContent
73
+ ] })
74
+ }
75
+ );
76
+ });
77
+ function TabPanel(props) {
78
+ return /* @__PURE__ */ jsx(
79
+ TabPanel$1,
80
+ {
81
+ ...props,
82
+ className: composeRenderProps(
83
+ props.className,
84
+ (className, renderProps) => tabPanelStyles({ ...renderProps, className })
85
+ )
86
+ }
87
+ );
88
+ }
89
+
90
+ export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext };
@@ -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?: string;
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?: string | null;
10
- errorMessage?: string | ((validation: ValidationResult) => string);
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;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,MAAM,CAAA;IACd,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,EAAE,CAAA;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAClE,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,GACxC,cAAc,CAAC,aAAa,GAAG,YAAY,CAAC,CAAA;IAC9C;;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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Y,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"}
@@ -19,4 +19,5 @@ export * from "./calendar";
19
19
  export * from "./range-calendar";
20
20
  export * from "./menu";
21
21
  export * from "./popover";
22
+ export * from "./tabs";
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -19,4 +19,5 @@ export * from "./calendar";
19
19
  export * from "./range-calendar";
20
20
  export * from "./menu";
21
21
  export * from "./popover";
22
+ export * from "./tabs";
22
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;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,QAAQ,CAAA;AACtB,cAAc,WAAW,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"}
@@ -7,11 +7,11 @@ export interface SelectProps<T> extends Omit<AriaSelectProps, "children">, Varia
7
7
  * Any additional props to be spread to the list layout.
8
8
  */
9
9
  listLayoutOptions?: ListLayoutOptions;
10
- label?: string;
11
- description?: string | null;
12
- errorMessage?: string | ((validation: ValidationResult) => string);
10
+ label?: React.ReactNode;
11
+ description?: React.ReactNode | null;
12
+ errorMessage?: React.ReactNode | ((validation: ValidationResult) => React.ReactNode);
13
13
  /** The list of Select options to render */
14
- items: NonNullable<ListBoxProps<T>["items"]>;
14
+ items?: NonNullable<ListBoxProps<T>["items"]>;
15
15
  children?: ListBoxProps<T>["children"];
16
16
  }
17
17
  export declare function Select<T extends object>({ label, description, classNames, errorMessage, ...originalProps }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -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,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,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
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,IAAI,eAA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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"}
@@ -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?: string;
6
- description?: string;
7
- errorMessage?: string | ((validation: ValidationResult) => string);
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,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAClE,UAAU,CAAC,EAAE,cAAc,CACzB,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CACrD,CAAA;IACD,UAAU,CAAC,EAAE,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"}
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?: string;
6
- description?: string;
7
- errorMessage?: string | ((validation: ValidationResult) => string);
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,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAClE,UAAU,CAAC,EAAE,cAAc,CACzB,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,OAAO,CACrD,CAAA;IACD,UAAU,CAAC,EAAE,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"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengovsg/oui",
3
- "version": "0.0.0-snapshot-20250401072718",
3
+ "version": "0.0.0-snapshot-20250511111650",
4
4
  "sideEffects": false,
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",
@@ -34,8 +34,7 @@
34
34
  }
35
35
  },
36
36
  "devDependencies": {
37
- "@storybook/react": "8.6.4",
38
- "@storybook/test": "8.6.4",
37
+ "@storybook/react-vite": "9.0.0-beta.11",
39
38
  "@types/lodash-es": "^4.17.12",
40
39
  "@types/prop-types": "^15.7.14",
41
40
  "@types/react": "^19.0.12",
@@ -45,13 +44,14 @@
45
44
  "lucide-react": "^0.475.0",
46
45
  "motion": "^12.4.2",
47
46
  "prettier": "^3.5.0",
47
+ "storybook": "9.0.0-beta.11",
48
48
  "tsx": "^4.19.2",
49
49
  "typescript": "5.7.3",
50
- "@opengovsg/oui-theme": "0.0.0-snapshot-20250401072718",
50
+ "@opengovsg/oui-theme": "0.0.0-snapshot-20250511111650",
51
51
  "@oui/chromatic": "0.0.0",
52
52
  "@oui/prettier-config": "0.0.0",
53
- "@oui/typescript-config": "0.0.0",
54
- "@oui/eslint-config": "0.0.0"
53
+ "@oui/eslint-config": "0.0.0",
54
+ "@oui/typescript-config": "0.0.0"
55
55
  },
56
56
  "dependencies": {
57
57
  "@internationalized/date": "^3.7.0",
@@ -76,12 +76,12 @@
76
76
  "type-fest": "^4.34.1",
77
77
  "use-deep-compare": "^1.3.0"
78
78
  },
79
+ "prettier": "@oui/prettier-config",
79
80
  "peerDependencies": {
80
81
  "motion": ">=11.12.0 || >=12.0.0-alpha.1",
81
82
  "react-aria-components": "^1.7.1",
82
- "@opengovsg/oui-theme": "0.0.0-snapshot-20250401072718"
83
+ "@opengovsg/oui-theme": "0.0.0-snapshot-20250511111650"
83
84
  },
84
- "prettier": "@oui/prettier-config",
85
85
  "scripts": {
86
86
  "build": "tsx ../../tooling/build-scripts/main.ts --dts --clean",
87
87
  "changeset": "cd ../.. && pnpm changeset",