@opengovsg/oui 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/button/button.cjs +1 -1
- package/dist/cjs/calendar/calendar-month-day-selector.cjs +2 -2
- package/dist/cjs/checkbox/checkbox.cjs +1 -1
- package/dist/cjs/combo-box/combo-box.cjs +2 -2
- package/dist/cjs/date-field/date-field.cjs +13 -4
- package/dist/cjs/date-picker/date-picker.cjs +4 -5
- package/dist/cjs/date-range-picker/date-range-picker.cjs +4 -4
- package/dist/cjs/field/field.cjs +19 -5
- package/dist/cjs/field/index.cjs +1 -0
- package/dist/cjs/index.cjs +14 -13
- package/dist/cjs/menu/menu.cjs +1 -1
- package/dist/cjs/range-calendar/range-calendar.cjs +1 -1
- package/dist/cjs/select/select.cjs +2 -2
- package/dist/cjs/tag-field/tag-field.cjs +3 -3
- package/dist/cjs/text-area-field/text-area-field.cjs +1 -1
- package/dist/cjs/text-field/text-field.cjs +1 -1
- package/dist/esm/button/button.js +1 -1
- package/dist/esm/calendar/calendar-month-day-selector.js +2 -2
- package/dist/esm/checkbox/checkbox.js +1 -1
- package/dist/esm/combo-box/combo-box.js +2 -2
- package/dist/esm/date-field/date-field.js +13 -4
- package/dist/esm/date-picker/date-picker.js +4 -5
- package/dist/esm/date-range-picker/date-range-picker.js +4 -4
- package/dist/esm/field/field.js +19 -6
- package/dist/esm/field/index.js +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/menu/menu.js +1 -1
- package/dist/esm/range-calendar/range-calendar.js +1 -1
- package/dist/esm/select/select.js +2 -2
- package/dist/esm/tag-field/tag-field.js +3 -3
- package/dist/esm/text-area-field/text-area-field.js +1 -1
- package/dist/esm/text-field/text-field.js +1 -1
- package/dist/types/date-field/date-field.d.ts +1 -0
- package/dist/types/date-field/date-field.d.ts.map +1 -1
- package/dist/types/field/field.d.ts +4 -1
- package/dist/types/field/field.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -7,9 +7,9 @@ var $670gB$react = require('react');
|
|
|
7
7
|
var utils = require('@react-aria/utils');
|
|
8
8
|
var reactAriaComponents = require('react-aria-components');
|
|
9
9
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
10
|
-
var ripple = require('../ripple/ripple.cjs');
|
|
11
10
|
var useRipple = require('../ripple/use-ripple.cjs');
|
|
12
11
|
var spinner = require('../spinner/spinner.cjs');
|
|
12
|
+
var ripple = require('../ripple/ripple.cjs');
|
|
13
13
|
|
|
14
14
|
const Button = $670gB$react.forwardRef(
|
|
15
15
|
({
|
|
@@ -6,11 +6,11 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
7
|
var date = require('@internationalized/date');
|
|
8
8
|
var reactAriaComponents = require('react-aria-components');
|
|
9
|
-
var select = require('../select/select.cjs');
|
|
10
|
-
var selectItem = require('../select/select-item.cjs');
|
|
11
9
|
var agnosticCalendarStateContext = require('./agnostic-calendar-state-context.cjs');
|
|
12
10
|
var calendarStyleContext = require('./calendar-style-context.cjs');
|
|
13
11
|
var useCalendarSelectors = require('./hooks/use-calendar-selectors.cjs');
|
|
12
|
+
var select = require('../select/select.cjs');
|
|
13
|
+
var selectItem = require('../select/select-item.cjs');
|
|
14
14
|
var useCalendarI18n = require('./hooks/use-calendar-i18n.cjs');
|
|
15
15
|
|
|
16
16
|
const CalendarMonthDaySelector = () => {
|
|
@@ -5,11 +5,11 @@
|
|
|
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 utils = require('../system/utils.cjs');
|
|
10
9
|
var checkboxGroupStyleContext = require('./checkbox-group-style-context.cjs');
|
|
11
10
|
var minus = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.cjs');
|
|
12
11
|
var check = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.cjs');
|
|
12
|
+
var field = require('../field/field.cjs');
|
|
13
13
|
|
|
14
14
|
const Checkbox = ({
|
|
15
15
|
classNames,
|
|
@@ -7,13 +7,13 @@ var $670gB$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
|
-
var popover = require('../popover/popover.cjs');
|
|
12
10
|
var utils = require('../system/utils.cjs');
|
|
13
11
|
var comboBoxVariantContext = require('./combo-box-variant-context.cjs');
|
|
12
|
+
var field = require('../field/field.cjs');
|
|
14
13
|
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
14
|
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
15
|
var x = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.cjs');
|
|
16
|
+
var popover = require('../popover/popover.cjs');
|
|
17
17
|
|
|
18
18
|
const calculateEstimatedRowHeight = (size) => {
|
|
19
19
|
switch (size) {
|
|
@@ -6,12 +6,20 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$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
9
|
var utils = require('../system/utils.cjs');
|
|
10
|
+
var field = require('../field/field.cjs');
|
|
11
11
|
|
|
12
12
|
function DateField(originalProps) {
|
|
13
13
|
const [
|
|
14
|
-
{
|
|
14
|
+
{
|
|
15
|
+
inputProps,
|
|
16
|
+
label,
|
|
17
|
+
description,
|
|
18
|
+
errorMessage,
|
|
19
|
+
className,
|
|
20
|
+
classNames,
|
|
21
|
+
...props
|
|
22
|
+
},
|
|
15
23
|
variantProps
|
|
16
24
|
] = $670gB$react.useMemo(
|
|
17
25
|
() => utils.mapPropsVariants(originalProps, ouiTheme.dateFieldStyles.variantKeys),
|
|
@@ -28,11 +36,11 @@ function DateField(originalProps) {
|
|
|
28
36
|
isDisabled: variantProps.isDisabled,
|
|
29
37
|
className: ouiTheme.composeTailwindRenderProps(
|
|
30
38
|
className ?? classNames?.base,
|
|
31
|
-
"flex flex-col gap-2"
|
|
39
|
+
"flex w-full flex-col gap-2"
|
|
32
40
|
),
|
|
33
41
|
children: [
|
|
34
42
|
label && /* @__PURE__ */ jsxRuntime.jsx(field.Label, { size: variantProps.size, className: classNames?.label, children: label }),
|
|
35
|
-
/* @__PURE__ */ jsxRuntime.jsx(DateInput, { size: variantProps.size, className: styles }),
|
|
43
|
+
/* @__PURE__ */ jsxRuntime.jsx(DateInput, { size: variantProps.size, className: styles, ...inputProps }),
|
|
36
44
|
description && /* @__PURE__ */ jsxRuntime.jsx(
|
|
37
45
|
field.Description,
|
|
38
46
|
{
|
|
@@ -67,6 +75,7 @@ function DateInput(originalProps) {
|
|
|
67
75
|
className: ouiTheme.composeRenderProps(
|
|
68
76
|
classNames?.segment,
|
|
69
77
|
(className2, renderProps) => styles.segment({
|
|
78
|
+
isEditable: segment.isEditable,
|
|
70
79
|
...renderProps,
|
|
71
80
|
className: className2
|
|
72
81
|
})
|
|
@@ -6,14 +6,13 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
7
|
var reactAriaComponents = require('react-aria-components');
|
|
8
8
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
9
|
-
var calendar$1 = require('../calendar/calendar.cjs');
|
|
10
|
-
require('@internationalized/date');
|
|
11
|
-
var dateField = require('../date-field/date-field.cjs');
|
|
12
|
-
var field = require('../field/field.cjs');
|
|
13
|
-
var popover = require('../popover/popover.cjs');
|
|
14
9
|
var utils = require('../system/utils.cjs');
|
|
10
|
+
var dateField = require('../date-field/date-field.cjs');
|
|
15
11
|
var calendar = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.cjs');
|
|
12
|
+
var calendar$1 = require('../calendar/calendar.cjs');
|
|
13
|
+
var field = require('../field/field.cjs');
|
|
16
14
|
var button = require('../button/button.cjs');
|
|
15
|
+
var popover = require('../popover/popover.cjs');
|
|
17
16
|
|
|
18
17
|
function DatePicker(originalProps) {
|
|
19
18
|
const [
|
|
@@ -7,13 +7,13 @@ var $670gB$react = require('react');
|
|
|
7
7
|
var date = require('@internationalized/date');
|
|
8
8
|
var reactAriaComponents = require('react-aria-components');
|
|
9
9
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
10
|
-
var dateField = require('../date-field/date-field.cjs');
|
|
11
|
-
var field = require('../field/field.cjs');
|
|
12
|
-
var popover = require('../popover/popover.cjs');
|
|
13
|
-
var rangeCalendar = require('../range-calendar/range-calendar.cjs');
|
|
14
10
|
var utils = require('../system/utils.cjs');
|
|
15
11
|
var calendar = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.cjs');
|
|
12
|
+
var rangeCalendar = require('../range-calendar/range-calendar.cjs');
|
|
13
|
+
var field = require('../field/field.cjs');
|
|
14
|
+
var dateField = require('../date-field/date-field.cjs');
|
|
16
15
|
var button = require('../button/button.cjs');
|
|
16
|
+
var popover = require('../popover/popover.cjs');
|
|
17
17
|
|
|
18
18
|
function DateRangePicker(originalProps) {
|
|
19
19
|
const [
|
package/dist/cjs/field/field.cjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var $670gB$react = require('react');
|
|
6
7
|
var reactAriaComponents = require('react-aria-components');
|
|
7
8
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
8
9
|
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');
|
|
@@ -20,6 +21,13 @@ function Description({ size, className, ...props }) {
|
|
|
20
21
|
}
|
|
21
22
|
);
|
|
22
23
|
}
|
|
24
|
+
function FieldErrorIcon({
|
|
25
|
+
size,
|
|
26
|
+
className
|
|
27
|
+
}) {
|
|
28
|
+
const styles = ouiTheme.fieldErrorStyles({ size });
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(circleAlert.default, { className: styles.icon({ className }) });
|
|
30
|
+
}
|
|
23
31
|
function FieldError({
|
|
24
32
|
children,
|
|
25
33
|
className,
|
|
@@ -28,7 +36,15 @@ function FieldError({
|
|
|
28
36
|
...props
|
|
29
37
|
}) {
|
|
30
38
|
const styles = ouiTheme.fieldErrorStyles({ size });
|
|
31
|
-
|
|
39
|
+
const childrenFromProps = $670gB$react.useMemo(() => {
|
|
40
|
+
if (typeof children === "string") {
|
|
41
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
42
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldErrorIcon, { className: classNames?.icon, size }),
|
|
43
|
+
children
|
|
44
|
+
] });
|
|
45
|
+
}
|
|
46
|
+
return children;
|
|
47
|
+
}, [children, classNames?.icon, size]);
|
|
32
48
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
49
|
reactAriaComponents.FieldError,
|
|
34
50
|
{
|
|
@@ -37,10 +53,7 @@ function FieldError({
|
|
|
37
53
|
className ?? classNames?.text,
|
|
38
54
|
(className2, renderProps) => styles.text({ ...renderProps, className: className2 })
|
|
39
55
|
),
|
|
40
|
-
children:
|
|
41
|
-
/* @__PURE__ */ jsxRuntime.jsx(circleAlert.default, { className: styles.icon({ className: classNames?.icon }) }),
|
|
42
|
-
children
|
|
43
|
-
] })
|
|
56
|
+
children: childrenFromProps
|
|
44
57
|
}
|
|
45
58
|
);
|
|
46
59
|
}
|
|
@@ -59,5 +72,6 @@ function FieldGroup(props) {
|
|
|
59
72
|
|
|
60
73
|
exports.Description = Description;
|
|
61
74
|
exports.FieldError = FieldError;
|
|
75
|
+
exports.FieldErrorIcon = FieldErrorIcon;
|
|
62
76
|
exports.FieldGroup = FieldGroup;
|
|
63
77
|
exports.Label = Label;
|
package/dist/cjs/field/index.cjs
CHANGED
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
+
var toggle = require('./toggle/toggle.cjs');
|
|
4
5
|
var useControllableState = require('./hooks/use-controllable-state.cjs');
|
|
6
|
+
var button = require('./button/button.cjs');
|
|
5
7
|
var govtBanner = require('./govt-banner/govt-banner.cjs');
|
|
6
8
|
var ripple = require('./ripple/ripple.cjs');
|
|
7
9
|
var useRipple = require('./ripple/use-ripple.cjs');
|
|
8
10
|
var spinner = require('./spinner/spinner.cjs');
|
|
9
11
|
var useSpinner = require('./spinner/use-spinner.cjs');
|
|
10
|
-
var toggle = require('./toggle/toggle.cjs');
|
|
11
12
|
var skipNavLink = require('./skip-nav-link/skip-nav-link.cjs');
|
|
12
13
|
var input = require('./input/input.cjs');
|
|
13
14
|
var textField = require('./text-field/text-field.cjs');
|
|
@@ -18,16 +19,17 @@ var comboBox = require('./combo-box/combo-box.cjs');
|
|
|
18
19
|
var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
|
|
19
20
|
var comboBoxItem = require('./combo-box/combo-box-item.cjs');
|
|
20
21
|
var comboBoxVariantContext = require('./combo-box/combo-box-variant-context.cjs');
|
|
22
|
+
var banner = require('./banner/banner.cjs');
|
|
21
23
|
var tagField = require('./tag-field/tag-field.cjs');
|
|
22
24
|
var tagFieldItem = require('./tag-field/tag-field-item.cjs');
|
|
23
25
|
var select = require('./select/select.cjs');
|
|
24
26
|
var selectItem = require('./select/select-item.cjs');
|
|
25
27
|
var selectVariantContext = require('./select/select-variant-context.cjs');
|
|
26
28
|
var badge = require('./badge/badge.cjs');
|
|
29
|
+
var date = require('@internationalized/date');
|
|
27
30
|
var calendar = require('./calendar/calendar.cjs');
|
|
28
31
|
var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
|
|
29
32
|
var utils = require('./calendar/utils.cjs');
|
|
30
|
-
var date = require('@internationalized/date');
|
|
31
33
|
var rangeCalendar = require('./range-calendar/range-calendar.cjs');
|
|
32
34
|
var menu = require('./menu/menu.cjs');
|
|
33
35
|
var popover = require('./popover/popover.cjs');
|
|
@@ -37,28 +39,28 @@ var datePicker = require('./date-picker/date-picker.cjs');
|
|
|
37
39
|
var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
|
|
38
40
|
var checkbox = require('./checkbox/checkbox.cjs');
|
|
39
41
|
var checkboxGroupStyleContext = require('./checkbox/checkbox-group-style-context.cjs');
|
|
42
|
+
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
40
43
|
var pagination = require('./pagination/pagination.cjs');
|
|
41
44
|
var paginationCursor = require('./pagination/pagination-cursor.cjs');
|
|
42
45
|
var paginationItem = require('./pagination/pagination-item.cjs');
|
|
43
|
-
var usePagination = require('./pagination/hooks/use-pagination.cjs');
|
|
44
46
|
var usePagination$1 = require('./pagination/use-pagination.cjs');
|
|
45
|
-
var button = require('./button/button.cjs');
|
|
46
|
-
var banner = require('./banner/banner.cjs');
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
+
exports.Toggle = toggle.Toggle;
|
|
50
51
|
exports.useControllableState = useControllableState.useControllableState;
|
|
52
|
+
exports.Button = button.Button;
|
|
51
53
|
exports.GovtBanner = govtBanner.GovtBanner;
|
|
52
54
|
exports.Ripple = ripple.Ripple;
|
|
53
55
|
exports.useRipple = useRipple.useRipple;
|
|
54
56
|
exports.Spinner = spinner.Spinner;
|
|
55
57
|
exports.useSpinner = useSpinner.useSpinner;
|
|
56
|
-
exports.Toggle = toggle.Toggle;
|
|
57
58
|
exports.SkipNavLink = skipNavLink.SkipNavLink;
|
|
58
59
|
exports.Input = input.Input;
|
|
59
60
|
exports.TextField = textField.TextField;
|
|
60
61
|
exports.Description = field.Description;
|
|
61
62
|
exports.FieldError = field.FieldError;
|
|
63
|
+
exports.FieldErrorIcon = field.FieldErrorIcon;
|
|
62
64
|
exports.FieldGroup = field.FieldGroup;
|
|
63
65
|
exports.Label = field.Label;
|
|
64
66
|
exports.TextArea = textArea.TextArea;
|
|
@@ -69,6 +71,7 @@ exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
|
|
|
69
71
|
exports.ComboBoxItem = comboBoxItem.ComboBoxItem;
|
|
70
72
|
exports.ComboBoxVariantContext = comboBoxVariantContext.ComboBoxVariantContext;
|
|
71
73
|
exports.useComboBoxVariantContext = comboBoxVariantContext.useComboBoxVariantContext;
|
|
74
|
+
exports.Banner = banner.Banner;
|
|
72
75
|
exports.TagField = tagField.TagField;
|
|
73
76
|
exports.TagFieldItem = tagFieldItem.TagFieldItem;
|
|
74
77
|
exports.Select = select.Select;
|
|
@@ -76,6 +79,10 @@ exports.SelectItem = selectItem.SelectItem;
|
|
|
76
79
|
exports.SelectVariantContext = selectVariantContext.SelectVariantContext;
|
|
77
80
|
exports.useSelectVariantContext = selectVariantContext.useSelectVariantContext;
|
|
78
81
|
exports.Badge = badge.Badge;
|
|
82
|
+
Object.defineProperty(exports, "CalendarDate", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () { return date.CalendarDate; }
|
|
85
|
+
});
|
|
79
86
|
exports.Calendar = calendar.Calendar;
|
|
80
87
|
exports.CalendarStateWrapper = calendar.CalendarStateWrapper;
|
|
81
88
|
exports.CalendarStyleContext = calendarStyleContext.CalendarStyleContext;
|
|
@@ -84,10 +91,6 @@ exports.getEraFormat = utils.getEraFormat;
|
|
|
84
91
|
exports.useGenerateLocalizedMonths = utils.useGenerateLocalizedMonths;
|
|
85
92
|
exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
|
|
86
93
|
exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
|
|
87
|
-
Object.defineProperty(exports, "CalendarDate", {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () { return date.CalendarDate; }
|
|
90
|
-
});
|
|
91
94
|
exports.RangeCalendar = rangeCalendar.RangeCalendar;
|
|
92
95
|
exports.RangeCalendarCell = rangeCalendar.RangeCalendarCell;
|
|
93
96
|
exports.RangeCalendarStateWrapper = rangeCalendar.RangeCalendarStateWrapper;
|
|
@@ -114,11 +117,9 @@ exports.Checkbox = checkbox.Checkbox;
|
|
|
114
117
|
exports.CheckboxGroup = checkbox.CheckboxGroup;
|
|
115
118
|
exports.CheckboxGroupStyleContext = checkboxGroupStyleContext.CheckboxGroupStyleContext;
|
|
116
119
|
exports.useCheckboxGroupStyleContext = checkboxGroupStyleContext.useCheckboxGroupStyleContext;
|
|
120
|
+
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
117
121
|
exports.Pagination = pagination.Pagination;
|
|
118
122
|
exports.PaginationCursor = paginationCursor.PaginationCursor;
|
|
119
123
|
exports.PaginationItem = paginationItem.PaginationItem;
|
|
120
|
-
exports.PaginationItemType = usePagination.PaginationItemType;
|
|
121
124
|
exports.CURSOR_TRANSITION_TIMEOUT = usePagination$1.CURSOR_TRANSITION_TIMEOUT;
|
|
122
125
|
exports.usePagination = usePagination$1.usePagination;
|
|
123
|
-
exports.Button = button.Button;
|
|
124
|
-
exports.Banner = banner.Banner;
|
package/dist/cjs/menu/menu.cjs
CHANGED
|
@@ -6,11 +6,11 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$react = require('react');
|
|
7
7
|
var reactAriaComponents = require('react-aria-components');
|
|
8
8
|
var ouiTheme = require('@opengovsg/oui-theme');
|
|
9
|
-
var popover = require('../popover/popover.cjs');
|
|
10
9
|
var utils = require('../system/utils.cjs');
|
|
11
10
|
var check = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.cjs');
|
|
12
11
|
var chevronRight = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-right.cjs');
|
|
13
12
|
var context = require('../system/react-utils/context.cjs');
|
|
13
|
+
var popover = require('../popover/popover.cjs');
|
|
14
14
|
|
|
15
15
|
const [MenuVariantContext, useMenuVariantContext] = context.createContext({
|
|
16
16
|
name: "MenuVariantContext",
|
|
@@ -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 = utils.forwardRefGeneric(function RangeCalendar2(originalProps, ref) {
|
|
19
19
|
const [props, variantProps] = utils.mapPropsVariants(
|
|
@@ -6,11 +6,11 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$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 popover = require('../popover/popover.cjs');
|
|
11
9
|
var utils = require('../system/utils.cjs');
|
|
12
10
|
var selectVariantContext = require('./select-variant-context.cjs');
|
|
11
|
+
var field = require('../field/field.cjs');
|
|
13
12
|
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');
|
|
13
|
+
var popover = require('../popover/popover.cjs');
|
|
14
14
|
var button = require('../button/button.cjs');
|
|
15
15
|
|
|
16
16
|
const calculateEstimatedRowHeight = (size) => {
|
|
@@ -6,15 +6,15 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var $670gB$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
|
-
var popover = require('../popover/popover.cjs');
|
|
12
9
|
var tagFieldItem = require('./tag-field-item.cjs');
|
|
13
10
|
var tagFieldList = require('./tag-field-list.cjs');
|
|
14
11
|
var tagFieldRoot = require('./tag-field-root.cjs');
|
|
15
12
|
var tagFieldTagList = require('./tag-field-tag-list.cjs');
|
|
16
13
|
var tagFieldTrigger = require('./tag-field-trigger.cjs');
|
|
17
14
|
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');
|
|
15
|
+
var field = require('../field/field.cjs');
|
|
16
|
+
var input = require('../input/input.cjs');
|
|
17
|
+
var popover = require('../popover/popover.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 { forwardRef, useMemo } from 'react';
|
|
|
5
5
|
import { chain } from '@react-aria/utils';
|
|
6
6
|
import { Button as Button$1, composeRenderProps } from 'react-aria-components';
|
|
7
7
|
import { buttonStyles } from '@opengovsg/oui-theme';
|
|
8
|
-
import { Ripple } from '../ripple/ripple.js';
|
|
9
8
|
import { useRipple } from '../ripple/use-ripple.js';
|
|
10
9
|
import { Spinner } from '../spinner/spinner.js';
|
|
10
|
+
import { Ripple } from '../ripple/ripple.js';
|
|
11
11
|
|
|
12
12
|
const Button = forwardRef(
|
|
13
13
|
({
|
|
@@ -4,11 +4,11 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useContext } from 'react';
|
|
5
5
|
import { CalendarDate } from '@internationalized/date';
|
|
6
6
|
import { Group } from 'react-aria-components';
|
|
7
|
-
import { Select } from '../select/select.js';
|
|
8
|
-
import { SelectItem } from '../select/select-item.js';
|
|
9
7
|
import { AgnosticCalendarStateContext } from './agnostic-calendar-state-context.js';
|
|
10
8
|
import { useCalendarStyleContext } from './calendar-style-context.js';
|
|
11
9
|
import { useCalendarSelectors } from './hooks/use-calendar-selectors.js';
|
|
10
|
+
import { Select } from '../select/select.js';
|
|
11
|
+
import { SelectItem } from '../select/select-item.js';
|
|
12
12
|
import { useCalendarI18n } from './hooks/use-calendar-i18n.js';
|
|
13
13
|
|
|
14
14
|
const CalendarMonthDaySelector = () => {
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { Checkbox as Checkbox$1, composeRenderProps, Provider, CheckboxGroup as CheckboxGroup$1 } from 'react-aria-components';
|
|
5
5
|
import { checkboxStyles, checkboxGroupStyles } from '@opengovsg/oui-theme';
|
|
6
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
7
6
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
7
|
import { useCheckboxGroupStyleContext, CheckboxGroupStyleContext } from './checkbox-group-style-context.js';
|
|
9
8
|
import Minus from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/minus.js';
|
|
10
9
|
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.js';
|
|
10
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
11
11
|
|
|
12
12
|
const Checkbox = ({
|
|
13
13
|
classNames,
|
|
@@ -5,13 +5,13 @@ 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
|
-
import { Popover } from '../popover/popover.js';
|
|
10
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
11
9
|
import { ComboBoxVariantContext } from './combo-box-variant-context.js';
|
|
10
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
11
|
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
12
|
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
13
|
import X from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/x.js';
|
|
14
|
+
import { Popover } from '../popover/popover.js';
|
|
15
15
|
|
|
16
16
|
const calculateEstimatedRowHeight = (size) => {
|
|
17
17
|
switch (size) {
|
|
@@ -4,12 +4,20 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { DateField as DateField$1, DateInput as DateInput$1, DateSegment } from 'react-aria-components';
|
|
6
6
|
import { dateFieldStyles, composeTailwindRenderProps, dateInputStyles, composeRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
-
import { Label, Description, FieldError } from '../field/field.js';
|
|
8
7
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
9
9
|
|
|
10
10
|
function DateField(originalProps) {
|
|
11
11
|
const [
|
|
12
|
-
{
|
|
12
|
+
{
|
|
13
|
+
inputProps,
|
|
14
|
+
label,
|
|
15
|
+
description,
|
|
16
|
+
errorMessage,
|
|
17
|
+
className,
|
|
18
|
+
classNames,
|
|
19
|
+
...props
|
|
20
|
+
},
|
|
13
21
|
variantProps
|
|
14
22
|
] = useMemo(
|
|
15
23
|
() => mapPropsVariants(originalProps, dateFieldStyles.variantKeys),
|
|
@@ -26,11 +34,11 @@ function DateField(originalProps) {
|
|
|
26
34
|
isDisabled: variantProps.isDisabled,
|
|
27
35
|
className: composeTailwindRenderProps(
|
|
28
36
|
className ?? classNames?.base,
|
|
29
|
-
"flex flex-col gap-2"
|
|
37
|
+
"flex w-full flex-col gap-2"
|
|
30
38
|
),
|
|
31
39
|
children: [
|
|
32
40
|
label && /* @__PURE__ */ jsx(Label, { size: variantProps.size, className: classNames?.label, children: label }),
|
|
33
|
-
/* @__PURE__ */ jsx(DateInput, { size: variantProps.size, className: styles }),
|
|
41
|
+
/* @__PURE__ */ jsx(DateInput, { size: variantProps.size, className: styles, ...inputProps }),
|
|
34
42
|
description && /* @__PURE__ */ jsx(
|
|
35
43
|
Description,
|
|
36
44
|
{
|
|
@@ -65,6 +73,7 @@ function DateInput(originalProps) {
|
|
|
65
73
|
className: composeRenderProps(
|
|
66
74
|
classNames?.segment,
|
|
67
75
|
(className2, renderProps) => styles.segment({
|
|
76
|
+
isEditable: segment.isEditable,
|
|
68
77
|
...renderProps,
|
|
69
78
|
className: className2
|
|
70
79
|
})
|
|
@@ -4,14 +4,13 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
4
4
|
import { useMemo } from 'react';
|
|
5
5
|
import { DatePicker as DatePicker$1, Dialog } from 'react-aria-components';
|
|
6
6
|
import { datePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
7
|
-
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
8
|
-
import '@internationalized/date';
|
|
9
|
-
import { DateInput } from '../date-field/date-field.js';
|
|
10
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
11
|
-
import { Popover } from '../popover/popover.js';
|
|
12
7
|
import { mapPropsVariants } from '../system/utils.js';
|
|
8
|
+
import { DateInput } from '../date-field/date-field.js';
|
|
13
9
|
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
10
|
+
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
11
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
14
12
|
import { Button } from '../button/button.js';
|
|
13
|
+
import { Popover } from '../popover/popover.js';
|
|
15
14
|
|
|
16
15
|
function DatePicker(originalProps) {
|
|
17
16
|
const [
|
|
@@ -5,13 +5,13 @@ import { useMemo } from 'react';
|
|
|
5
5
|
import { CalendarDate } from '@internationalized/date';
|
|
6
6
|
import { DateRangePicker as DateRangePicker$1, Dialog } from 'react-aria-components';
|
|
7
7
|
import { dateRangePickerStyles, composeTailwindRenderProps } from '@opengovsg/oui-theme';
|
|
8
|
-
import { DateInput } from '../date-field/date-field.js';
|
|
9
|
-
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
10
|
-
import { Popover } from '../popover/popover.js';
|
|
11
|
-
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
12
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
13
9
|
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
10
|
+
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
11
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
12
|
+
import { DateInput } from '../date-field/date-field.js';
|
|
14
13
|
import { Button } from '../button/button.js';
|
|
14
|
+
import { Popover } from '../popover/popover.js';
|
|
15
15
|
|
|
16
16
|
function DateRangePicker(originalProps) {
|
|
17
17
|
const [
|
package/dist/esm/field/field.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
import { useMemo } from 'react';
|
|
4
5
|
import { Label as Label$1, Text, FieldError as FieldError$1, Group } from 'react-aria-components';
|
|
5
6
|
import { labelStyles, descriptionStyles, fieldErrorStyles, composeRenderProps, fieldGroupStyles } from '@opengovsg/oui-theme';
|
|
6
7
|
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';
|
|
@@ -18,6 +19,13 @@ function Description({ size, className, ...props }) {
|
|
|
18
19
|
}
|
|
19
20
|
);
|
|
20
21
|
}
|
|
22
|
+
function FieldErrorIcon({
|
|
23
|
+
size,
|
|
24
|
+
className
|
|
25
|
+
}) {
|
|
26
|
+
const styles = fieldErrorStyles({ size });
|
|
27
|
+
return /* @__PURE__ */ jsx(CircleAlert, { className: styles.icon({ className }) });
|
|
28
|
+
}
|
|
21
29
|
function FieldError({
|
|
22
30
|
children,
|
|
23
31
|
className,
|
|
@@ -26,7 +34,15 @@ function FieldError({
|
|
|
26
34
|
...props
|
|
27
35
|
}) {
|
|
28
36
|
const styles = fieldErrorStyles({ size });
|
|
29
|
-
|
|
37
|
+
const childrenFromProps = useMemo(() => {
|
|
38
|
+
if (typeof children === "string") {
|
|
39
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
/* @__PURE__ */ jsx(FieldErrorIcon, { className: classNames?.icon, size }),
|
|
41
|
+
children
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
return children;
|
|
45
|
+
}, [children, classNames?.icon, size]);
|
|
30
46
|
return /* @__PURE__ */ jsx(
|
|
31
47
|
FieldError$1,
|
|
32
48
|
{
|
|
@@ -35,10 +51,7 @@ function FieldError({
|
|
|
35
51
|
className ?? classNames?.text,
|
|
36
52
|
(className2, renderProps) => styles.text({ ...renderProps, className: className2 })
|
|
37
53
|
),
|
|
38
|
-
children:
|
|
39
|
-
/* @__PURE__ */ jsx(CircleAlert, { className: styles.icon({ className: classNames?.icon }) }),
|
|
40
|
-
children
|
|
41
|
-
] })
|
|
54
|
+
children: childrenFromProps
|
|
42
55
|
}
|
|
43
56
|
);
|
|
44
57
|
}
|
|
@@ -55,4 +68,4 @@ function FieldGroup(props) {
|
|
|
55
68
|
);
|
|
56
69
|
}
|
|
57
70
|
|
|
58
|
-
export { Description, FieldError, FieldGroup, Label };
|
|
71
|
+
export { Description, FieldError, FieldErrorIcon, FieldGroup, Label };
|
package/dist/esm/field/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
export { Description, FieldError, FieldGroup, Label } from './field.js';
|
|
2
|
+
export { Description, FieldError, FieldErrorIcon, FieldGroup, Label } from './field.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
export { Toggle } from './toggle/toggle.js';
|
|
2
3
|
export { useControllableState } from './hooks/use-controllable-state.js';
|
|
4
|
+
export { Button } from './button/button.js';
|
|
3
5
|
export { GovtBanner } from './govt-banner/govt-banner.js';
|
|
4
6
|
export { Ripple } from './ripple/ripple.js';
|
|
5
7
|
export { useRipple } from './ripple/use-ripple.js';
|
|
6
8
|
export { Spinner } from './spinner/spinner.js';
|
|
7
9
|
export { useSpinner } from './spinner/use-spinner.js';
|
|
8
|
-
export { Toggle } from './toggle/toggle.js';
|
|
9
10
|
export { SkipNavLink } from './skip-nav-link/skip-nav-link.js';
|
|
10
11
|
export { Input } from './input/input.js';
|
|
11
12
|
export { TextField } from './text-field/text-field.js';
|
|
12
|
-
export { Description, FieldError, FieldGroup, Label } from './field/field.js';
|
|
13
|
+
export { Description, FieldError, FieldErrorIcon, FieldGroup, Label } from './field/field.js';
|
|
13
14
|
export { TextArea } from './text-area/text-area.js';
|
|
14
15
|
export { TextAreaField } from './text-area-field/text-area-field.js';
|
|
15
16
|
export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
16
17
|
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
17
18
|
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
18
19
|
export { ComboBoxVariantContext, useComboBoxVariantContext } from './combo-box/combo-box-variant-context.js';
|
|
20
|
+
export { Banner } from './banner/banner.js';
|
|
19
21
|
export { TagField } from './tag-field/tag-field.js';
|
|
20
22
|
export { TagFieldItem } from './tag-field/tag-field-item.js';
|
|
21
23
|
export { Select } from './select/select.js';
|
|
22
24
|
export { SelectItem } from './select/select-item.js';
|
|
23
25
|
export { SelectVariantContext, useSelectVariantContext } from './select/select-variant-context.js';
|
|
24
26
|
export { Badge } from './badge/badge.js';
|
|
27
|
+
export { CalendarDate } from '@internationalized/date';
|
|
25
28
|
export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
26
29
|
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
27
30
|
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
28
|
-
export { CalendarDate } from '@internationalized/date';
|
|
29
31
|
export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './range-calendar/range-calendar.js';
|
|
30
32
|
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
|
|
31
33
|
export { Popover } from './popover/popover.js';
|
|
@@ -35,10 +37,8 @@ export { DatePicker } from './date-picker/date-picker.js';
|
|
|
35
37
|
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
36
38
|
export { Checkbox, CheckboxGroup } from './checkbox/checkbox.js';
|
|
37
39
|
export { CheckboxGroupStyleContext, useCheckboxGroupStyleContext } from './checkbox/checkbox-group-style-context.js';
|
|
40
|
+
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
38
41
|
export { Pagination } from './pagination/pagination.js';
|
|
39
42
|
export { PaginationCursor } from './pagination/pagination-cursor.js';
|
|
40
43
|
export { PaginationItem } from './pagination/pagination-item.js';
|
|
41
|
-
export { PaginationItemType } from './pagination/hooks/use-pagination.js';
|
|
42
44
|
export { CURSOR_TRANSITION_TIMEOUT, usePagination } from './pagination/use-pagination.js';
|
|
43
|
-
export { Button } from './button/button.js';
|
|
44
|
-
export { Banner } from './banner/banner.js';
|
package/dist/esm/menu/menu.js
CHANGED
|
@@ -4,11 +4,11 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
4
4
|
import { forwardRef, useMemo, useCallback } from 'react';
|
|
5
5
|
import { useContextProps, MenuItem as MenuItem$1, composeRenderProps, Provider, Menu as Menu$1, MenuSection as MenuSection$1, Header, Collection, MenuTrigger as MenuTrigger$1, SubmenuTrigger as SubmenuTrigger$1, Separator } from 'react-aria-components';
|
|
6
6
|
import { listBoxItemStyles, menuItemStyles, menuStyles, menuSectionStyles, menuDividerStyles } from '@opengovsg/oui-theme';
|
|
7
|
-
import { Popover } from '../popover/popover.js';
|
|
8
7
|
import { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
|
|
9
8
|
import Check from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/check.js';
|
|
10
9
|
import ChevronRight from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/chevron-right.js';
|
|
11
10
|
import { createContext } from '../system/react-utils/context.js';
|
|
11
|
+
import { Popover } from '../popover/popover.js';
|
|
12
12
|
|
|
13
13
|
const [MenuVariantContext, useMenuVariantContext] = createContext({
|
|
14
14
|
name: "MenuVariantContext",
|
|
@@ -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 { forwardRefGeneric, mapPropsVariants } from '../system/utils.js';
|
|
14
|
+
import { CalendarStyleContext, useCalendarStyleContext } from '../calendar/calendar-style-context.js';
|
|
15
15
|
|
|
16
16
|
const RangeCalendar = forwardRefGeneric(function RangeCalendar2(originalProps, ref) {
|
|
17
17
|
const [props, variantProps] = mapPropsVariants(
|
|
@@ -4,11 +4,11 @@ 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 { Label, Description, FieldError } from '../field/field.js';
|
|
8
|
-
import { Popover } from '../popover/popover.js';
|
|
9
7
|
import { mapPropsVariants } from '../system/utils.js';
|
|
10
8
|
import { SelectVariantContext } from './select-variant-context.js';
|
|
9
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
11
10
|
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';
|
|
11
|
+
import { Popover } from '../popover/popover.js';
|
|
12
12
|
import { Button } from '../button/button.js';
|
|
13
13
|
|
|
14
14
|
const calculateEstimatedRowHeight = (size) => {
|
|
@@ -4,15 +4,15 @@ 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
|
-
import { Popover } from '../popover/popover.js';
|
|
10
7
|
import { TagFieldItem } from './tag-field-item.js';
|
|
11
8
|
import { TagFieldList } from './tag-field-list.js';
|
|
12
9
|
import { TagFieldRoot } from './tag-field-root.js';
|
|
13
10
|
import { TagFieldTagList } from './tag-field-tag-list.js';
|
|
14
11
|
import { TagFieldTrigger } from './tag-field-trigger.js';
|
|
15
12
|
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';
|
|
13
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
14
|
+
import { Input } from '../input/input.js';
|
|
15
|
+
import { Popover } from '../popover/popover.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,
|
|
@@ -6,6 +6,7 @@ interface DateFieldProps<T extends DateValue> extends AriaDateFieldProps<T>, Var
|
|
|
6
6
|
description?: string;
|
|
7
7
|
errorMessage?: string | ((validation: ValidationResult) => string);
|
|
8
8
|
classNames?: SlotsToClasses<"base" | "label" | "input" | "description" | "error">;
|
|
9
|
+
inputProps?: DateInputProps;
|
|
9
10
|
}
|
|
10
11
|
export declare function DateField<T extends DateValue>(originalProps: DateFieldProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
interface DateInputProps extends Omit<AriaDateInputProps, "children">, VariantProps<typeof dateInputStyles> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-field.d.ts","sourceRoot":"","sources":["../../../src/date-field/date-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,cAAc,IAAI,kBAAkB,EACpC,SAAS,EACT,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAQ9B,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"date-field.d.ts","sourceRoot":"","sources":["../../../src/date-field/date-field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,IAAI,kBAAkB,EACpC,cAAc,IAAI,kBAAkB,EACpC,SAAS,EACT,gBAAgB,EACjB,MAAM,uBAAuB,CAAA;AAQ9B,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,YAAY,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAIL,eAAe,EACf,eAAe,EAChB,MAAM,sBAAsB,CAAA;AAK7B,UAAU,cAAc,CAAC,CAAC,SAAS,SAAS,CAC1C,SAAQ,kBAAkB,CAAC,CAAC,CAAC,EAC3B,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,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,cAAc,CAAA;CAC5B;AAED,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,EAC3C,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,2CAmDjC;AAED,UAAU,cACR,SAAQ,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,EAC1C,YAAY,CAAC,OAAO,eAAe,CAAC;IACtC,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,CAAC,cAAc,CAAC,CAAA;CAC5C;AAED,wBAAgB,SAAS,CAAC,aAAa,EAAE,cAAc,2CA+BtD"}
|
|
@@ -9,6 +9,9 @@ export declare function Description({ size, className, ...props }: DescriptionPr
|
|
|
9
9
|
export interface FieldErrorProps extends AriaFieldErrorProps, FieldErrorVariantProps {
|
|
10
10
|
classNames?: SlotsToClasses<FieldErrorSlots>;
|
|
11
11
|
}
|
|
12
|
-
export declare function
|
|
12
|
+
export declare function FieldErrorIcon({ size, className, }: Pick<FieldErrorProps, "size"> & {
|
|
13
|
+
className?: string;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function FieldError({ children, className, size, classNames, ...props }: FieldErrorProps): import("react/jsx-runtime").JSX.Element;
|
|
13
16
|
export declare function FieldGroup(props: GroupProps): import("react/jsx-runtime").JSX.Element;
|
|
14
17
|
//# sourceMappingURL=field.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/field/field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,UAAU,IAAI,cAAc,EAC5B,UAAU,EACV,SAAS,EACV,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../src/field/field.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,IAAI,mBAAmB,EACtC,UAAU,IAAI,cAAc,EAC5B,UAAU,EACV,SAAS,EACV,MAAM,uBAAuB,CAAA;AAU9B,OAAO,KAAK,EACV,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACf,MAAM,sBAAsB,CAAA;AAS7B,MAAM,WAAW,UAAW,SAAQ,cAAc,EAAE,iBAAiB;CAAG;AAExE,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAE9D;AAED,MAAM,WAAW,gBAAiB,SAAQ,SAAS,EAAE,uBAAuB;CAAG;AAE/E,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAQ1E;AAED,MAAM,WAAW,eACf,SAAQ,mBAAmB,EACzB,sBAAsB;IACxB,UAAU,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAA;CAC7C;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,SAAS,GACV,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CAIxD;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,EACJ,UAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CA0BjB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,2CAS3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengovsg/oui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"storybook": "9.1.6",
|
|
50
50
|
"tsx": "^4.20.3",
|
|
51
51
|
"typescript": "5.7.3",
|
|
52
|
-
"@oui
|
|
52
|
+
"@opengovsg/oui-theme": "0.0.21",
|
|
53
53
|
"@oui/chromatic": "0.0.0",
|
|
54
|
-
"@
|
|
54
|
+
"@oui/eslint-config": "0.0.0",
|
|
55
55
|
"@oui/prettier-config": "0.0.0",
|
|
56
56
|
"@oui/typescript-config": "0.0.0"
|
|
57
57
|
},
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"motion": ">=11.12.0 || >=12.0.0-alpha.1",
|
|
84
84
|
"react": ">= 18",
|
|
85
85
|
"react-aria-components": "^1.12.2",
|
|
86
|
-
"@opengovsg/oui-theme": "0.0.
|
|
86
|
+
"@opengovsg/oui-theme": "0.0.21"
|
|
87
87
|
},
|
|
88
88
|
"scripts": {
|
|
89
89
|
"build": "tsx ../../tooling/build-scripts/main.ts --dts --clean",
|