@opengovsg/oui 0.0.0-snapshot-20250327091959 → 0.0.0-snapshot-20250511111007

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 (36) hide show
  1. package/dist/cjs/banner/banner.cjs +1 -1
  2. package/dist/cjs/combo-box/combo-box.cjs +1 -1
  3. package/dist/cjs/index.cjs +49 -42
  4. package/dist/cjs/range-calendar/range-calendar.cjs +1 -1
  5. package/dist/cjs/select/select.cjs +4 -2
  6. package/dist/cjs/tabs/index.cjs +13 -0
  7. package/dist/cjs/tabs/tabs.cjs +97 -0
  8. package/dist/cjs/tag-field/tag-field.cjs +2 -2
  9. package/dist/cjs/text-area-field/text-area-field.cjs +1 -1
  10. package/dist/cjs/text-field/text-field.cjs +1 -1
  11. package/dist/esm/banner/banner.js +1 -1
  12. package/dist/esm/combo-box/combo-box.js +1 -1
  13. package/dist/esm/index.js +15 -14
  14. package/dist/esm/range-calendar/range-calendar.js +1 -1
  15. package/dist/esm/select/select.js +4 -2
  16. package/dist/esm/tabs/index.js +2 -0
  17. package/dist/esm/tabs/tabs.js +90 -0
  18. package/dist/esm/tag-field/tag-field.js +2 -2
  19. package/dist/esm/text-area-field/text-area-field.js +1 -1
  20. package/dist/esm/text-field/text-field.js +1 -1
  21. package/dist/types/combo-box/combo-box.d.ts +3 -3
  22. package/dist/types/combo-box/combo-box.d.ts.map +1 -1
  23. package/dist/types/index.d.mts +1 -0
  24. package/dist/types/index.d.ts +1 -0
  25. package/dist/types/index.d.ts.map +1 -1
  26. package/dist/types/select/select.d.ts +7 -6
  27. package/dist/types/select/select.d.ts.map +1 -1
  28. package/dist/types/tabs/index.d.ts +2 -0
  29. package/dist/types/tabs/index.d.ts.map +1 -0
  30. package/dist/types/tabs/tabs.d.ts +16 -0
  31. package/dist/types/tabs/tabs.d.ts.map +1 -0
  32. package/dist/types/text-area-field/text-area-field.d.ts +3 -3
  33. package/dist/types/text-area-field/text-area-field.d.ts.map +1 -1
  34. package/dist/types/text-field/text-field.d.ts +3 -3
  35. package/dist/types/text-field/text-field.d.ts.map +1 -1
  36. package/package.json +6 -6
@@ -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 = {
@@ -7,10 +7,10 @@ var react = require('react');
7
7
  var reactAria = require('react-aria');
8
8
  var reactAriaComponents = require('react-aria-components');
9
9
  var ouiTheme = require('@opengovsg/oui-theme');
10
- 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 comboBoxVariantContext = require('./combo-box-variant-context.cjs');
13
+ var field = require('../field/field.cjs');
14
14
  var chevronUp = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-up.cjs');
15
15
  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');
16
16
  var x = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.cjs');
@@ -1,84 +1,57 @@
1
1
  "use strict";
2
2
  'use strict';
3
3
 
4
- var useControllableState = require('./hooks/use-controllable-state.cjs');
5
- var button = require('./button/button.cjs');
6
- var govtBanner = require('./govt-banner/govt-banner.cjs');
7
4
  var ripple = require('./ripple/ripple.cjs');
8
5
  var useRipple = require('./ripple/use-ripple.cjs');
9
6
  var spinner = require('./spinner/spinner.cjs');
10
7
  var useSpinner = require('./spinner/use-spinner.cjs');
11
8
  var toggle = require('./toggle/toggle.cjs');
12
9
  var skipNavLink = require('./skip-nav-link/skip-nav-link.cjs');
13
- var input = require('./input/input.cjs');
14
10
  var textField = require('./text-field/text-field.cjs');
15
- var field = require('./field/field.cjs');
16
11
  var textArea = require('./text-area/text-area.cjs');
17
12
  var textAreaField = require('./text-area-field/text-area-field.cjs');
18
- var comboBox = require('./combo-box/combo-box.cjs');
19
- var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
20
- var comboBoxItem = require('./combo-box/combo-box-item.cjs');
21
- var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
22
- var banner = require('./banner/banner.cjs');
23
13
  var tagField = require('./tag-field/tag-field.cjs');
24
14
  var tagFieldItem = require('./tag-field/tag-field-item.cjs');
25
15
  var select = require('./select/select.cjs');
26
16
  var selectItem = require('./select/select-item.cjs');
27
17
  var selectVariantContext = require('./select/select-variant-context.cjs');
18
+ var rangeCalendar = require('./range-calendar/range-calendar.cjs');
19
+ var menu = require('./menu/menu.cjs');
20
+ var popover = require('./popover/popover.cjs');
21
+ var tabs = require('./tabs/tabs.cjs');
22
+ var useControllableState = require('./hooks/use-controllable-state.cjs');
23
+ var button = require('./button/button.cjs');
24
+ var govtBanner = require('./govt-banner/govt-banner.cjs');
25
+ var input = require('./input/input.cjs');
26
+ var field = require('./field/field.cjs');
27
+ var comboBox = require('./combo-box/combo-box.cjs');
28
+ var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
29
+ var comboBoxItem = require('./combo-box/combo-box-item.cjs');
30
+ var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
31
+ var banner = require('./banner/banner.cjs');
28
32
  var badge = require('./badge/badge.cjs');
33
+ var date = require('@internationalized/date');
29
34
  var calendar = require('./calendar/calendar.cjs');
30
35
  var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
31
36
  var utils = require('./calendar/utils.cjs');
32
- var date = require('@internationalized/date');
33
- var rangeCalendar = require('./range-calendar/range-calendar.cjs');
34
- var menu = require('./menu/menu.cjs');
35
- var popover = require('./popover/popover.cjs');
36
37
 
37
38
 
38
39
 
39
- exports.useControllableState = useControllableState.useControllableState;
40
- exports.Button = button.Button;
41
- exports.GovtBanner = govtBanner.GovtBanner;
42
40
  exports.Ripple = ripple.Ripple;
43
41
  exports.useRipple = useRipple.useRipple;
44
42
  exports.Spinner = spinner.Spinner;
45
43
  exports.useSpinner = useSpinner.useSpinner;
46
44
  exports.Toggle = toggle.Toggle;
47
45
  exports.SkipNavLink = skipNavLink.SkipNavLink;
48
- exports.Input = input.Input;
49
46
  exports.TextField = textField.TextField;
50
- exports.Description = field.Description;
51
- exports.FieldError = field.FieldError;
52
- exports.FieldGroup = field.FieldGroup;
53
- exports.Label = field.Label;
54
47
  exports.TextArea = textArea.TextArea;
55
48
  exports.TextAreaField = textAreaField.TextAreaField;
56
- exports.ComboBox = comboBox.ComboBox;
57
- exports.ComboBoxEmptyState = comboBox.ComboBoxEmptyState;
58
- exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
59
- exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
60
- exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
61
- exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
62
- exports.Banner = banner.Banner;
63
49
  exports.TagField = tagField.TagField;
64
50
  exports.TagFieldItem = tagFieldItem.TagFieldItem;
65
51
  exports.Select = select.Select;
66
52
  exports.SelectItem = selectItem.SelectItem;
67
53
  exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
68
54
  exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
69
- exports.Badge = badge.Badge;
70
- exports.Calendar = calendar.Calendar;
71
- exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
72
- exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
73
- exports.useCalendarStyleContext = calendarStyleContext.useCalendarStyleContext;
74
- exports.getEraFormat = utils.getEraFormat;
75
- exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
76
- exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
77
- exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
78
- Object.defineProperty(exports, "CalendarDate", {
79
- enumerable: true,
80
- get: function () { return date.CalendarDate; }
81
- });
82
55
  exports.RangeCalendar = rangeCalendar.RangeCalendar;
83
56
  exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
84
57
  exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
@@ -91,3 +64,37 @@ exports.MenuVariantContext = menu.MenuVariantContext;
91
64
  exports.SubmenuTrigger = menu.SubmenuTrigger;
92
65
  exports.useMenuVariantContext = menu.useMenuVariantContext;
93
66
  exports.Popover = popover.Popover;
67
+ exports.Tab = tabs.Tab;
68
+ exports.TabList = tabs.TabList;
69
+ exports.TabPanel = tabs.TabPanel;
70
+ exports.Tabs = tabs.Tabs;
71
+ exports.TabsVariantContext = tabs.TabsVariantContext;
72
+ exports.useTabsVariantContext = tabs.useTabsVariantContext;
73
+ exports.useControllableState = useControllableState.useControllableState;
74
+ exports.Button = button.Button;
75
+ exports.GovtBanner = govtBanner.GovtBanner;
76
+ exports.Input = input.Input;
77
+ exports.Description = field.Description;
78
+ exports.FieldError = field.FieldError;
79
+ exports.FieldGroup = field.FieldGroup;
80
+ exports.Label = field.Label;
81
+ exports.ComboBox = comboBox.ComboBox;
82
+ exports.ComboBoxEmptyState = comboBox.ComboBoxEmptyState;
83
+ exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
84
+ exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
85
+ exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
86
+ exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
87
+ exports.Banner = banner.Banner;
88
+ exports.Badge = badge.Badge;
89
+ Object.defineProperty(exports, "CalendarDate", {
90
+ enumerable: true,
91
+ get: function () { return date.CalendarDate; }
92
+ });
93
+ exports.Calendar = calendar.Calendar;
94
+ exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
95
+ exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
96
+ exports.useCalendarStyleContext = calendarStyleContext.useCalendarStyleContext;
97
+ exports.getEraFormat = utils.getEraFormat;
98
+ exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
99
+ exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
100
+ exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
@@ -8,12 +8,12 @@ var date = require('@internationalized/date');
8
8
  var reactAriaComponents = require('react-aria-components');
9
9
  var useDeepCompare = require('use-deep-compare');
10
10
  var ouiTheme = require('@opengovsg/oui-theme');
11
- var calendarStyleContext = require('../calendar/calendar-style-context.cjs');
12
11
  var agnosticCalendarStateContext = require('../calendar/agnostic-calendar-state-context.cjs');
13
12
  var calendarBottomContent = require('../calendar/calendar-bottom-content.cjs');
14
13
  var calendarGridHeader = require('../calendar/calendar-grid-header.cjs');
15
14
  var calendarHeader = require('../calendar/calendar-header.cjs');
16
15
  var utils = require('../system/utils.cjs');
16
+ var calendarStyleContext = require('../calendar/calendar-style-context.cjs');
17
17
 
18
18
  const RangeCalendar = react.forwardRef(function RangeCalendar2(originalProps, ref) {
19
19
  const [props, variantProps] = utils.mapPropsVariants(
@@ -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
- var field = require('../field/field.cjs');
11
9
  var popover = require('../popover/popover.cjs');
12
10
  var utils = require('../system/utils.cjs');
13
11
  var selectVariantContext = require('./select-variant-context.cjs');
12
+ var field = require('../field/field.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) {
@@ -27,6 +27,7 @@ function Select({
27
27
  label,
28
28
  description,
29
29
  classNames,
30
+ errorMessage,
30
31
  ...originalProps
31
32
  }) {
32
33
  const [_props, variantProps] = utils.mapPropsVariants(
@@ -91,6 +92,7 @@ function Select({
91
92
  children: description
92
93
  }
93
94
  ),
95
+ /* @__PURE__ */ jsxRuntime.jsx(field.FieldError, { size: variantProps.size, className: classNames?.error, children: errorMessage }),
94
96
  /* @__PURE__ */ jsxRuntime.jsx(popover.Popover, { className: styles.popover({ className: classNames?.popover }), children: /* @__PURE__ */ jsxRuntime.jsx(reactAriaComponents.Virtualizer, { layout: reactAriaComponents.ListLayout, layoutOptions, children: /* @__PURE__ */ jsxRuntime.jsx(
95
97
  reactAriaComponents.ListBox,
96
98
  {
@@ -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;
@@ -6,8 +6,6 @@ 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 field = require('../field/field.cjs');
10
- var input = require('../input/input.cjs');
11
9
  var popover = require('../popover/popover.cjs');
12
10
  var tagFieldItem = require('./tag-field-item.cjs');
13
11
  var tagFieldList = require('./tag-field-list.cjs');
@@ -15,6 +13,8 @@ var tagFieldRoot = require('./tag-field-root.cjs');
15
13
  var tagFieldTagList = require('./tag-field-tag-list.cjs');
16
14
  var tagFieldTrigger = require('./tag-field-trigger.cjs');
17
15
  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');
16
+ var field = require('../field/field.cjs');
17
+ var input = require('../input/input.cjs');
18
18
 
19
19
  function TagField({
20
20
  classNames,
@@ -5,8 +5,8 @@
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var reactAriaComponents = require('react-aria-components');
7
7
  var ouiTheme = require('@opengovsg/oui-theme');
8
- var field = require('../field/field.cjs');
9
8
  var textArea = require('../text-area/text-area.cjs');
9
+ var field = require('../field/field.cjs');
10
10
 
11
11
  function TextAreaField({
12
12
  label,
@@ -5,8 +5,8 @@
5
5
  var jsxRuntime = require('react/jsx-runtime');
6
6
  var reactAriaComponents = require('react-aria-components');
7
7
  var ouiTheme = require('@opengovsg/oui-theme');
8
- var field = require('../field/field.cjs');
9
8
  var input = require('../input/input.cjs');
9
+ var field = require('../field/field.cjs');
10
10
 
11
11
  function TextField({
12
12
  label,
@@ -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 = {
@@ -5,10 +5,10 @@ import { useMemo, useCallback } from 'react';
5
5
  import { useMessageFormatter } from 'react-aria';
6
6
  import { ListLayout, Provider, ComboBox as ComboBox$1, Input, Button, Virtualizer, ListBox } from 'react-aria-components';
7
7
  import { listBoxItemStyles, cn, comboBoxStyles, composeTailwindRenderProps, composeRenderProps, comboBoxClearButtonStyles } from '@opengovsg/oui-theme';
8
- import { Label, FieldGroup, 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 { ComboBoxVariantContext } from './combo-box-variant-context.js';
11
+ import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
12
12
  import ChevronUp from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-up.js';
13
13
  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';
14
14
  import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.js';
package/dist/esm/index.js CHANGED
@@ -1,33 +1,34 @@
1
1
  "use strict";
2
- export { useControllableState } from './hooks/use-controllable-state.js';
3
- export { Button } from './button/button.js';
4
- export { GovtBanner } from './govt-banner/govt-banner.js';
5
2
  export { Ripple } from './ripple/ripple.js';
6
3
  export { useRipple } from './ripple/use-ripple.js';
7
4
  export { Spinner } from './spinner/spinner.js';
8
5
  export { useSpinner } from './spinner/use-spinner.js';
9
6
  export { Toggle } from './toggle/toggle.js';
10
7
  export { SkipNavLink } from './skip-nav-link/skip-nav-link.js';
11
- export { Input } from './input/input.js';
12
8
  export { TextField } from './text-field/text-field.js';
13
- export { Description, FieldError, FieldGroup, Label } from './field/field.js';
14
9
  export { TextArea } from './text-area/text-area.js';
15
10
  export { TextAreaField } from './text-area-field/text-area-field.js';
16
- export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
17
- export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
18
- export { ComboBoxItem } from './combo-box/combo-box-item.js';
19
- export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
20
- export { Banner } from './banner/banner.js';
21
11
  export { TagField } from './tag-field/tag-field.js';
22
12
  export { TagFieldItem } from './tag-field/tag-field-item.js';
23
13
  export { Select } from './select/select.js';
24
14
  export { SelectItem } from './select/select-item.js';
25
15
  export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
16
+ export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
17
+ export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
18
+ export { Popover } from './popover/popover.js';
19
+ export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext } from './tabs/tabs.js';
20
+ export { useControllableState } from './hooks/use-controllable-state.js';
21
+ export { Button } from './button/button.js';
22
+ export { GovtBanner } from './govt-banner/govt-banner.js';
23
+ export { Input } from './input/input.js';
24
+ export { Description, FieldError, FieldGroup, Label } from './field/field.js';
25
+ export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
26
+ export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
27
+ export { ComboBoxItem } from './combo-box/combo-box-item.js';
28
+ export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
29
+ export { Banner } from './banner/banner.js';
26
30
  export { Badge } from './badge/badge.js';
31
+ export { CalendarDate } from '@internationalized/date';
27
32
  export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
28
33
  export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
29
34
  export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
30
- export { CalendarDate } from '@internationalized/date';
31
- export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
32
- export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
33
- export { Popover } from './popover/popover.js';
@@ -6,12 +6,12 @@ import { CalendarDate, today, getLocalTimeZone, getDayOfWeek } from '@internatio
6
6
  import { RangeCalendar as RangeCalendar$1, Provider, CalendarGrid, CalendarGridBody, Text, RangeCalendarStateContext, useLocale, CalendarCell } from 'react-aria-components';
7
7
  import { useDeepCompareMemo } from 'use-deep-compare';
8
8
  import { calendarStyles, composeRenderProps, cn, dataAttr } from '@opengovsg/oui-theme';
9
- import { CalendarStyleContext, useCalendarStyleContext } from '../calendar/calendar-style-context.js';
10
9
  import { AgnosticCalendarStateContext } from '../calendar/agnostic-calendar-state-context.js';
11
10
  import { CalendarBottomContent } from '../calendar/calendar-bottom-content.js';
12
11
  import { CalendarGridHeader } from '../calendar/calendar-grid-header.js';
13
12
  import { CalendarHeader } from '../calendar/calendar-header.js';
14
13
  import { mapPropsVariants } from '../system/utils.js';
14
+ import { CalendarStyleContext, useCalendarStyleContext } from '../calendar/calendar-style-context.js';
15
15
 
16
16
  const RangeCalendar = forwardRef(function RangeCalendar2(originalProps, ref) {
17
17
  const [props, variantProps] = mapPropsVariants(
@@ -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
- import { Label, Description } from '../field/field.js';
9
7
  import { Popover } from '../popover/popover.js';
10
8
  import { mapPropsVariants } from '../system/utils.js';
11
9
  import { SelectVariantContext } from './select-variant-context.js';
10
+ import { Label, Description, FieldError } from '../field/field.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) {
@@ -25,6 +25,7 @@ function Select({
25
25
  label,
26
26
  description,
27
27
  classNames,
28
+ errorMessage,
28
29
  ...originalProps
29
30
  }) {
30
31
  const [_props, variantProps] = mapPropsVariants(
@@ -89,6 +90,7 @@ function Select({
89
90
  children: description
90
91
  }
91
92
  ),
93
+ /* @__PURE__ */ jsx(FieldError, { size: variantProps.size, className: classNames?.error, children: errorMessage }),
92
94
  /* @__PURE__ */ jsx(Popover, { className: styles.popover({ className: classNames?.popover }), children: /* @__PURE__ */ jsx(Virtualizer, { layout: ListLayout, layoutOptions, children: /* @__PURE__ */ jsx(
93
95
  ListBox,
94
96
  {
@@ -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 };
@@ -4,8 +4,6 @@ import { jsxs, jsx } from 'react/jsx-runtime';
4
4
  import { createElement } from 'react';
5
5
  import { composeRenderProps } from 'react-aria-components';
6
6
  import { tagFieldStyles } from '@opengovsg/oui-theme';
7
- import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
8
- import { Input } from '../input/input.js';
9
7
  import { Popover } from '../popover/popover.js';
10
8
  import { TagFieldItem } from './tag-field-item.js';
11
9
  import { TagFieldList } from './tag-field-list.js';
@@ -13,6 +11,8 @@ import { TagFieldRoot } from './tag-field-root.js';
13
11
  import { TagFieldTagList } from './tag-field-tag-list.js';
14
12
  import { TagFieldTrigger } from './tag-field-trigger.js';
15
13
  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';
14
+ import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
15
+ import { Input } from '../input/input.js';
16
16
 
17
17
  function TagField({
18
18
  classNames,
@@ -3,8 +3,8 @@
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
4
  import { TextField } from 'react-aria-components';
5
5
  import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
6
- import { Label, Description, FieldError } from '../field/field.js';
7
6
  import { TextArea } from '../text-area/text-area.js';
7
+ import { Label, Description, FieldError } from '../field/field.js';
8
8
 
9
9
  function TextAreaField({
10
10
  label,
@@ -3,8 +3,8 @@
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
4
  import { TextField as TextField$1 } from 'react-aria-components';
5
5
  import { composeTailwindRenderProps } from '@opengovsg/oui-theme';
6
- import { Label, Description, FieldError } from '../field/field.js';
7
6
  import { Input } from '../input/input.js';
7
+ import { Label, Description, FieldError } from '../field/field.js';
8
8
 
9
9
  function TextField({
10
10
  label,
@@ -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,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"}
1
+ {"version":3,"file":"combo-box.d.ts","sourceRoot":"","sources":["../../../src/combo-box/combo-box.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,IAAI,iBAAiB,EAClC,YAAY,EAEZ,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAc9B,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAe7B,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,MAAM,CAC7C,SAAQ,oBAAoB,EAC1B,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC;IACxC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,iDAAiD;IACjD,YAAY,CAAC,EAAE,CAAC,EAAE,CAAA;IAClB,+CAA+C;IAC/C,KAAK,CAAC,EAAE,CAAC,EAAE,CAAA;IACX,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IACpC,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,MAAM,CAAC,CAAA;IAC3E,UAAU,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,GACxC,cAAc,CAAC,aAAa,GAAG,YAAY,CAAC,CAAA;IAC9C;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,mFAAmF;IACnF,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAA;IAE9C;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAEpB,gBAAgB,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAA;IAEtD,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;CACvC;AAkCD,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,SAAS,GACV,EAAE,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAY7D;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,CAAC,2CA6JzE"}
@@ -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"}
@@ -1,17 +1,18 @@
1
- import type { SelectProps as AriaSelectProps, ListBoxProps, ListLayoutOptions } from "react-aria-components";
1
+ import type { SelectProps as AriaSelectProps, ListBoxProps, ListLayoutOptions, ValidationResult } from "react-aria-components";
2
2
  import type { SelectVariantSlots, SlotsToClasses, VariantProps } from "@opengovsg/oui-theme";
3
3
  import { selectStyles } from "@opengovsg/oui-theme";
4
4
  export interface SelectProps<T> extends Omit<AriaSelectProps, "children">, VariantProps<typeof selectStyles> {
5
- classNames?: SlotsToClasses<SelectVariantSlots>;
5
+ classNames?: SlotsToClasses<SelectVariantSlots | "error">;
6
6
  /**
7
7
  * Any additional props to be spread to the list layout.
8
8
  */
9
9
  listLayoutOptions?: ListLayoutOptions;
10
- label?: string;
11
- description?: string | null;
10
+ label?: React.ReactNode;
11
+ description?: React.ReactNode | null;
12
+ errorMessage?: React.ReactNode | ((validation: ValidationResult) => React.ReactNode);
12
13
  /** The list of Select options to render */
13
- items: NonNullable<ListBoxProps<T>["items"]>;
14
+ items?: NonNullable<ListBoxProps<T>["items"]>;
14
15
  children?: ListBoxProps<T>["children"];
15
16
  }
16
- export declare function Select<T extends object>({ label, description, classNames, ...originalProps }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
17
+ export declare function Select<T extends object>({ label, description, classNames, errorMessage, ...originalProps }: SelectProps<T>): import("react/jsx-runtime").JSX.Element;
17
18
  //# sourceMappingURL=select.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,YAAY,EACZ,iBAAiB,EAClB,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,CAAC,CAAA;IAE/C;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAE3B,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,GAAG,aAAa,EACjB,EAAE,WAAW,CAAC,CAAC,CAAC,2CAkFhB"}
1
+ {"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,WAAW,IAAI,eAAe,EAC9B,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAY9B,OAAO,KAAK,EAEV,kBAAkB,EAClB,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAsB,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAQvE,MAAM,WAAW,WAAW,CAAC,CAAC,CAC5B,SAAQ,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,EACvC,YAAY,CAAC,OAAO,YAAY,CAAC;IACnC,UAAU,CAAC,EAAE,cAAc,CAAC,kBAAkB,GAAG,OAAO,CAAC,CAAA;IAEzD;;OAEG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IAErC,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAA;IAEpC,YAAY,CAAC,EACT,KAAK,CAAC,SAAS,GACf,CAAC,CAAC,UAAU,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAA;IAEvD,2CAA2C;IAC3C,KAAK,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IAE7C,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;CACvC;AAeD,wBAAgB,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,EACvC,KAAK,EACL,WAAW,EACX,UAAU,EACV,YAAY,EACZ,GAAG,aAAa,EACjB,EAAE,WAAW,CAAC,CAAC,CAAC,2CAqFhB"}
@@ -0,0 +1,2 @@
1
+ export * from "./tabs";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tabs/index.tsx"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAA"}
@@ -0,0 +1,16 @@
1
+ import type { TabListProps as AriaTabListProps, TabProps as AriaTabProps, TabsProps as AriaTabsProps, ContextValue, TabPanelProps } from "react-aria-components";
2
+ import type { TabListVariantProps, TabsVariantProps, TabVariantProps } from "@opengovsg/oui-theme";
3
+ export declare const TabsVariantContext: import("react").Context<ContextValue<TabsVariantProps, any>>, useTabsVariantContext: () => ContextValue<TabsVariantProps, any>;
4
+ export interface TabsProps extends AriaTabsProps, TabsVariantProps {
5
+ }
6
+ export declare function Tabs(originalProps: TabsProps): import("react/jsx-runtime").JSX.Element;
7
+ export interface TabListProps<T extends object> extends AriaTabListProps<T>, TabListVariantProps {
8
+ }
9
+ export declare const TabList: <T extends object>(props: TabListProps<T> & import("react").RefAttributes<HTMLDivElement>) => React.ReactNode;
10
+ export interface TabProps extends AriaTabProps, TabVariantProps {
11
+ startContent?: React.ReactNode;
12
+ endContent?: React.ReactNode;
13
+ }
14
+ export declare const Tab: import("react").ForwardRefExoticComponent<TabProps & import("react").RefAttributes<object>>;
15
+ export declare function TabPanel(props: TabPanelProps): import("react/jsx-runtime").JSX.Element;
16
+ //# sourceMappingURL=tabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../../src/tabs/tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,YAAY,IAAI,gBAAgB,EAChC,QAAQ,IAAI,YAAY,EACxB,SAAS,IAAI,aAAa,EAC1B,YAAY,EACZ,aAAa,EACd,MAAM,uBAAuB,CAAA;AAY9B,OAAO,KAAK,EACV,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAW7B,eAAO,MAAO,kBAAkB,gEAAE,qBAAqB,2CAMrD,CAAA;AAEF,MAAM,WAAW,SAAU,SAAQ,aAAa,EAAE,gBAAgB;CAAG;AAErE,wBAAgB,IAAI,CAAC,aAAa,EAAE,SAAS,2CAiB5C;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,MAAM,CAC5C,SAAQ,gBAAgB,CAAC,CAAC,CAAC,EACzB,mBAAmB;CAAG;AAE1B,eAAO,MAAM,OAAO,GAAsC,CAAC,SAAS,MAAM,6EAW5D,MAAO,SAYnB,CAAA;AAEF,MAAM,WAAW,QAAS,SAAQ,YAAY,EAAE,eAAe;IAC7D,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC7B;AAED,eAAO,MAAM,GAAG,6FA8Bd,CAAA;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,2CAS5C"}
@@ -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-20250327091959",
3
+ "version": "0.0.0-snapshot-20250511111007",
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,11 +44,12 @@
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
- "@oui/eslint-config": "0.0.0",
50
+ "@opengovsg/oui-theme": "0.0.0-snapshot-20250511111007",
51
51
  "@oui/chromatic": "0.0.0",
52
- "@opengovsg/oui-theme": "0.0.0-snapshot-20250327091959",
52
+ "@oui/eslint-config": "0.0.0",
53
53
  "@oui/prettier-config": "0.0.0",
54
54
  "@oui/typescript-config": "0.0.0"
55
55
  },
@@ -79,7 +79,7 @@
79
79
  "peerDependencies": {
80
80
  "motion": ">=11.12.0 || >=12.0.0-alpha.1",
81
81
  "react-aria-components": "^1.7.1",
82
- "@opengovsg/oui-theme": "0.0.0-snapshot-20250327091959"
82
+ "@opengovsg/oui-theme": "0.0.0-snapshot-20250511111007"
83
83
  },
84
84
  "prettier": "@oui/prettier-config",
85
85
  "scripts": {