@opengovsg/oui 0.0.0-snapshot-20250808095255 → 0.0.0-snapshot-20250812083020
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/combo-box/combo-box.cjs +1 -1
- package/dist/cjs/date-field/date-field.cjs +1 -1
- package/dist/cjs/date-picker/date-picker.cjs +1 -1
- package/dist/cjs/date-range-picker/date-range-picker.cjs +1 -1
- package/dist/cjs/govt-banner/govt-banner.cjs +24 -59
- package/dist/cjs/index.cjs +9 -9
- package/dist/cjs/select/select.cjs +1 -1
- package/dist/cjs/tag-field/tag-field.cjs +1 -1
- 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/combo-box/combo-box.js +1 -1
- package/dist/esm/date-field/date-field.js +1 -1
- package/dist/esm/date-picker/date-picker.js +1 -1
- package/dist/esm/date-range-picker/date-range-picker.js +1 -1
- package/dist/esm/govt-banner/govt-banner.js +25 -60
- package/dist/esm/index.js +3 -3
- package/dist/esm/select/select.js +1 -1
- package/dist/esm/tag-field/tag-field.js +1 -1
- 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/govt-banner/govt-banner.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -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');
|
|
@@ -6,8 +6,8 @@ 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
9
|
var utils = require('../system/utils.cjs');
|
|
10
|
+
var field = require('../field/field.cjs');
|
|
11
11
|
|
|
12
12
|
function DateField(originalProps) {
|
|
13
13
|
const [
|
|
@@ -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 field = require('../field/field.cjs');
|
|
10
9
|
var popover = require('../popover/popover.cjs');
|
|
11
10
|
var utils = require('../system/utils.cjs');
|
|
12
11
|
var dateField = require('../date-field/date-field.cjs');
|
|
13
12
|
var calendar = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.cjs');
|
|
14
13
|
var calendar$1 = require('../calendar/calendar.cjs');
|
|
14
|
+
var field = require('../field/field.cjs');
|
|
15
15
|
var button = require('../button/button.cjs');
|
|
16
16
|
|
|
17
17
|
function DatePicker(originalProps) {
|
|
@@ -7,11 +7,11 @@ var 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 field = require('../field/field.cjs');
|
|
11
10
|
var popover = require('../popover/popover.cjs');
|
|
12
11
|
var rangeCalendar = require('../range-calendar/range-calendar.cjs');
|
|
13
12
|
var utils = require('../system/utils.cjs');
|
|
14
13
|
var calendar = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.cjs');
|
|
14
|
+
var field = require('../field/field.cjs');
|
|
15
15
|
var dateField = require('../date-field/date-field.cjs');
|
|
16
16
|
var button = require('../button/button.cjs');
|
|
17
17
|
|
|
@@ -12,54 +12,11 @@ var landmark = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/
|
|
|
12
12
|
var externalLink = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/external-link.cjs');
|
|
13
13
|
var lock = require('../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/lock.cjs');
|
|
14
14
|
|
|
15
|
-
const i18nStrings = {
|
|
16
|
-
"en-SG": {
|
|
17
|
-
mainLabel: "A Singapore Government Agency Website",
|
|
18
|
-
identifyLabel: "How to identify",
|
|
19
|
-
environmentLabel: "[NOTE: THIS IS A {environment} WEBSITE]",
|
|
20
|
-
officialLinkHeader: "Official website links end with .gov.sg",
|
|
21
|
-
officialLinkContent: "Government agencies communicate via <boldThis>.gov.sg</boldThis> websites (e.g. go.gov.sg/open).",
|
|
22
|
-
officialLinkTrusted: "Trusted websites",
|
|
23
|
-
secureHeader: "Secure websites use HTTPS",
|
|
24
|
-
secureContent: "Look for a <boldThis>lock</boldThis> {icon} or https:// as an added precaution. Share sensitive information only on official, secure websites."
|
|
25
|
-
},
|
|
26
|
-
"zh-SG": {
|
|
27
|
-
mainLabel: "A Singapore Government Agency Website",
|
|
28
|
-
identifyLabel: "How to identify",
|
|
29
|
-
environmentLabel: "[NOTE: THIS IS A {environment} WEBSITE]",
|
|
30
|
-
officialLinkHeader: "Official website links end with .gov.sg",
|
|
31
|
-
officialLinkContent: "Government agencies communicate via <boldThis>.gov.sg</boldThis> websites (e.g. go.gov.sg/open).",
|
|
32
|
-
officialLinkTrusted: "Trusted websites",
|
|
33
|
-
secureHeader: "Secure websites use HTTPS",
|
|
34
|
-
secureContent: "Look for a <boldThis>lock</boldThis> {icon} or https:// as an added precaution. Share sensitive information only on official, secure websites."
|
|
35
|
-
},
|
|
36
|
-
"ms-SG": {
|
|
37
|
-
mainLabel: "A Singapore Government Agency Website",
|
|
38
|
-
identifyLabel: "How to identify",
|
|
39
|
-
environmentLabel: "[NOTE: THIS IS A {environment} WEBSITE]",
|
|
40
|
-
officialLinkHeader: "Official website links end with .gov.sg",
|
|
41
|
-
officialLinkContent: "Government agencies communicate via <boldThis>.gov.sg</boldThis> websites (e.g. go.gov.sg/open).",
|
|
42
|
-
officialLinkTrusted: "Trusted websites",
|
|
43
|
-
secureHeader: "Secure websites use HTTPS",
|
|
44
|
-
secureContent: "Look for a <boldThis>lock</boldThis> {icon} or https:// as an added precaution. Share sensitive information only on official, secure websites."
|
|
45
|
-
},
|
|
46
|
-
"ta-SG": {
|
|
47
|
-
mainLabel: "A Singapore Government Agency Website",
|
|
48
|
-
identifyLabel: "How to identify",
|
|
49
|
-
environmentLabel: "[NOTE: THIS IS A {environment} WEBSITE]",
|
|
50
|
-
officialLinkHeader: "Official website links end with .gov.sg",
|
|
51
|
-
officialLinkContent: "Government agencies communicate via <boldThis>.gov.sg</boldThis> websites (e.g. go.gov.sg/open).",
|
|
52
|
-
officialLinkTrusted: "Trusted websites",
|
|
53
|
-
secureHeader: "Secure websites use HTTPS",
|
|
54
|
-
secureContent: "Look for a <boldThis>lock</boldThis> {icon} or https:// as an added precaution. Share sensitive information only on official, secure websites."
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
15
|
function GovtBanner({
|
|
58
16
|
environment,
|
|
59
17
|
classNames,
|
|
60
18
|
...props
|
|
61
19
|
}) {
|
|
62
|
-
const formatMessage = reactAria.useMessageFormatter(i18nStrings);
|
|
63
20
|
const state = reactStately.useDisclosureState(props);
|
|
64
21
|
const panelRef = react.useRef(null);
|
|
65
22
|
const triggerRef = react.useRef(null);
|
|
@@ -106,10 +63,12 @@ function GovtBanner({
|
|
|
106
63
|
{
|
|
107
64
|
className: slots.mainContent({ className: classNames?.mainContent }),
|
|
108
65
|
children: [
|
|
109
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
110
|
-
environment ? /* @__PURE__ */ jsxRuntime.
|
|
111
|
-
|
|
112
|
-
|
|
66
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "A Singapore Government Agency Website" }),
|
|
67
|
+
environment ? /* @__PURE__ */ jsxRuntime.jsxs("b", { children: [
|
|
68
|
+
"[NOTE: THIS IS A ",
|
|
69
|
+
environment.toUpperCase(),
|
|
70
|
+
" WEBSITE]"
|
|
71
|
+
] }) : null,
|
|
113
72
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
114
73
|
"button",
|
|
115
74
|
{
|
|
@@ -121,7 +80,7 @@ function GovtBanner({
|
|
|
121
80
|
type: "button",
|
|
122
81
|
...reactAria.mergeProps(buttonProps, focusProps),
|
|
123
82
|
children: [
|
|
124
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: slots.link({ className: classNames?.link }), children:
|
|
83
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: slots.link({ className: classNames?.link }), children: "How to identify" }),
|
|
125
84
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
126
85
|
chevronDown.default,
|
|
127
86
|
{
|
|
@@ -164,13 +123,13 @@ function GovtBanner({
|
|
|
164
123
|
className: slots.panelHeader({
|
|
165
124
|
className: classNames?.panelHeader
|
|
166
125
|
}),
|
|
167
|
-
children:
|
|
126
|
+
children: "Official website links end with .gov.sg"
|
|
168
127
|
}
|
|
169
128
|
),
|
|
170
129
|
/* @__PURE__ */ jsxRuntime.jsxs("article", { children: [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
130
|
+
"Government agencies communicate via ",
|
|
131
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { children: ".gov.sg" }),
|
|
132
|
+
" websites (e.g. go.gov.sg/open).",
|
|
174
133
|
" ",
|
|
175
134
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
176
135
|
"a",
|
|
@@ -180,7 +139,7 @@ function GovtBanner({
|
|
|
180
139
|
rel: "noreferrer",
|
|
181
140
|
target: "_blank",
|
|
182
141
|
children: [
|
|
183
|
-
|
|
142
|
+
"Trusted websites",
|
|
184
143
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
185
144
|
externalLink.default,
|
|
186
145
|
{
|
|
@@ -226,12 +185,14 @@ function GovtBanner({
|
|
|
226
185
|
className: slots.panelHeader({
|
|
227
186
|
className: classNames?.panelHeader
|
|
228
187
|
}),
|
|
229
|
-
children:
|
|
188
|
+
children: "Secure websites use HTTPS"
|
|
230
189
|
}
|
|
231
190
|
),
|
|
232
|
-
/* @__PURE__ */ jsxRuntime.
|
|
233
|
-
|
|
234
|
-
|
|
191
|
+
/* @__PURE__ */ jsxRuntime.jsxs("article", { children: [
|
|
192
|
+
"Look for a ",
|
|
193
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { children: "lock" }),
|
|
194
|
+
" ",
|
|
195
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { "aria-hidden": true, children: [
|
|
235
196
|
"(",
|
|
236
197
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
237
198
|
lock.default,
|
|
@@ -242,8 +203,12 @@ function GovtBanner({
|
|
|
242
203
|
}
|
|
243
204
|
),
|
|
244
205
|
")"
|
|
245
|
-
] })
|
|
246
|
-
|
|
206
|
+
] }),
|
|
207
|
+
" ",
|
|
208
|
+
"or ",
|
|
209
|
+
/* @__PURE__ */ jsxRuntime.jsx("b", { children: "https://" }),
|
|
210
|
+
" as an added precaution. Share sensitive information only on official, secure websites."
|
|
211
|
+
] })
|
|
247
212
|
]
|
|
248
213
|
}
|
|
249
214
|
)
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -11,7 +11,6 @@ var toggle = require('./toggle/toggle.cjs');
|
|
|
11
11
|
var skipNavLink = require('./skip-nav-link/skip-nav-link.cjs');
|
|
12
12
|
var input = require('./input/input.cjs');
|
|
13
13
|
var textField = require('./text-field/text-field.cjs');
|
|
14
|
-
var field = require('./field/field.cjs');
|
|
15
14
|
var textArea = require('./text-area/text-area.cjs');
|
|
16
15
|
var textAreaField = require('./text-area-field/text-area-field.cjs');
|
|
17
16
|
var tagField = require('./tag-field/tag-field.cjs');
|
|
@@ -23,9 +22,8 @@ var rangeCalendar = require('./range-calendar/range-calendar.cjs');
|
|
|
23
22
|
var menu = require('./menu/menu.cjs');
|
|
24
23
|
var popover = require('./popover/popover.cjs');
|
|
25
24
|
var tabs = require('./tabs/tabs.cjs');
|
|
26
|
-
var datePicker = require('./date-picker/date-picker.cjs');
|
|
27
|
-
var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
|
|
28
25
|
var button = require('./button/button.cjs');
|
|
26
|
+
var field = require('./field/field.cjs');
|
|
29
27
|
var comboBox = require('./combo-box/combo-box.cjs');
|
|
30
28
|
var comboBoxFuzzy = require('./combo-box/combo-box-fuzzy.cjs');
|
|
31
29
|
var comboBoxItem = require('./combo-box/combo-box-item.cjs');
|
|
@@ -37,6 +35,8 @@ var calendar = require('./calendar/calendar.cjs');
|
|
|
37
35
|
var calendarStyleContext = require('./calendar/calendar-style-context.cjs');
|
|
38
36
|
var utils = require('./calendar/utils.cjs');
|
|
39
37
|
var dateField = require('./date-field/date-field.cjs');
|
|
38
|
+
var datePicker = require('./date-picker/date-picker.cjs');
|
|
39
|
+
var dateRangePicker = require('./date-range-picker/date-range-picker.cjs');
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
@@ -50,10 +50,6 @@ exports.Toggle = toggle.Toggle;
|
|
|
50
50
|
exports.SkipNavLink = skipNavLink.SkipNavLink;
|
|
51
51
|
exports.Input = input.Input;
|
|
52
52
|
exports.TextField = textField.TextField;
|
|
53
|
-
exports.Description = field.Description;
|
|
54
|
-
exports.FieldError = field.FieldError;
|
|
55
|
-
exports.FieldGroup = field.FieldGroup;
|
|
56
|
-
exports.Label = field.Label;
|
|
57
53
|
exports.TextArea = textArea.TextArea;
|
|
58
54
|
exports.TextAreaField = textAreaField.TextAreaField;
|
|
59
55
|
exports.TagField = tagField.TagField;
|
|
@@ -80,9 +76,11 @@ exports.TabPanel = tabs.TabPanel;
|
|
|
80
76
|
exports.Tabs = tabs.Tabs;
|
|
81
77
|
exports.TabsVariantContext = tabs.TabsVariantContext;
|
|
82
78
|
exports.useTabsVariantContext = tabs.useTabsVariantContext;
|
|
83
|
-
exports.DatePicker = datePicker.DatePicker;
|
|
84
|
-
exports.DateRangePicker = dateRangePicker.DateRangePicker;
|
|
85
79
|
exports.Button = button.Button;
|
|
80
|
+
exports.Description = field.Description;
|
|
81
|
+
exports.FieldError = field.FieldError;
|
|
82
|
+
exports.FieldGroup = field.FieldGroup;
|
|
83
|
+
exports.Label = field.Label;
|
|
86
84
|
exports.ComboBox = comboBox.ComboBox;
|
|
87
85
|
exports.ComboBoxEmptyState = comboBox.ComboBoxEmptyState;
|
|
88
86
|
exports.ComboBoxFuzzy = comboBoxFuzzy.ComboBoxFuzzy;
|
|
@@ -105,3 +103,5 @@ exports.useGenerateLocalizedYears = utils.useGenerateLocalizedYears;
|
|
|
105
103
|
exports.useLocalizedMonthYear = utils.useLocalizedMonthYear;
|
|
106
104
|
exports.DateField = dateField.DateField;
|
|
107
105
|
exports.DateInput = dateField.DateInput;
|
|
106
|
+
exports.DatePicker = datePicker.DatePicker;
|
|
107
|
+
exports.DateRangePicker = dateRangePicker.DateRangePicker;
|
|
@@ -6,10 +6,10 @@ 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
9
|
var popover = require('../popover/popover.cjs');
|
|
11
10
|
var utils = require('../system/utils.cjs');
|
|
12
11
|
var selectVariantContext = require('./select-variant-context.cjs');
|
|
12
|
+
var field = require('../field/field.cjs');
|
|
13
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
14
|
var button = require('../button/button.cjs');
|
|
15
15
|
|
|
@@ -6,7 +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
9
|
var input = require('../input/input.cjs');
|
|
11
10
|
var popover = require('../popover/popover.cjs');
|
|
12
11
|
var tagFieldItem = require('./tag-field-item.cjs');
|
|
@@ -15,6 +14,7 @@ var tagFieldRoot = require('./tag-field-root.cjs');
|
|
|
15
14
|
var tagFieldTagList = require('./tag-field-tag-list.cjs');
|
|
16
15
|
var tagFieldTrigger = require('./tag-field-trigger.cjs');
|
|
17
16
|
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');
|
|
17
|
+
var field = require('../field/field.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,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';
|
|
@@ -4,8 +4,8 @@ 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 [
|
|
@@ -4,12 +4,12 @@ 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 { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
8
7
|
import { Popover } from '../popover/popover.js';
|
|
9
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
10
9
|
import { DateInput } from '../date-field/date-field.js';
|
|
11
10
|
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
12
11
|
import { Calendar as Calendar$1 } from '../calendar/calendar.js';
|
|
12
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
13
13
|
import { Button } from '../button/button.js';
|
|
14
14
|
|
|
15
15
|
function DatePicker(originalProps) {
|
|
@@ -5,11 +5,11 @@ 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 { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
9
8
|
import { Popover } from '../popover/popover.js';
|
|
10
9
|
import { RangeCalendar } from '../range-calendar/range-calendar.js';
|
|
11
10
|
import { mapPropsVariants } from '../system/utils.js';
|
|
12
11
|
import Calendar from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/calendar.js';
|
|
12
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.js';
|
|
13
13
|
import { DateInput } from '../date-field/date-field.js';
|
|
14
14
|
import { Button } from '../button/button.js';
|
|
15
15
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useRef } from 'react';
|
|
5
|
-
import {
|
|
5
|
+
import { useDisclosure, useButton, useFocusRing, mergeProps } from 'react-aria';
|
|
6
6
|
import { useDisclosureState } from 'react-stately';
|
|
7
7
|
import { govtBannerStyles, dataAttr, twMerge } from '@opengovsg/oui-theme';
|
|
8
8
|
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';
|
|
@@ -10,54 +10,11 @@ import Landmark from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/no
|
|
|
10
10
|
import ExternalLink from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/external-link.js';
|
|
11
11
|
import Lock from '../node_modules/.pnpm/lucide-react@0.475.0_react@19.0.0/node_modules/lucide-react/dist/esm/icons/lock.js';
|
|
12
12
|
|
|
13
|
-
const i18nStrings = {
|
|
14
|
-
"en-SG": {
|
|
15
|
-
mainLabel: "A Singapore Government Agency Website",
|
|
16
|
-
identifyLabel: "How to identify",
|
|
17
|
-
environmentLabel: "[NOTE: THIS IS A {environment} WEBSITE]",
|
|
18
|
-
officialLinkHeader: "Official website links end with .gov.sg",
|
|
19
|
-
officialLinkContent: "Government agencies communicate via <boldThis>.gov.sg</boldThis> websites (e.g. go.gov.sg/open).",
|
|
20
|
-
officialLinkTrusted: "Trusted websites",
|
|
21
|
-
secureHeader: "Secure websites use HTTPS",
|
|
22
|
-
secureContent: "Look for a <boldThis>lock</boldThis> {icon} or https:// as an added precaution. Share sensitive information only on official, secure websites."
|
|
23
|
-
},
|
|
24
|
-
"zh-SG": {
|
|
25
|
-
mainLabel: "A Singapore Government Agency Website",
|
|
26
|
-
identifyLabel: "How to identify",
|
|
27
|
-
environmentLabel: "[NOTE: THIS IS A {environment} WEBSITE]",
|
|
28
|
-
officialLinkHeader: "Official website links end with .gov.sg",
|
|
29
|
-
officialLinkContent: "Government agencies communicate via <boldThis>.gov.sg</boldThis> websites (e.g. go.gov.sg/open).",
|
|
30
|
-
officialLinkTrusted: "Trusted websites",
|
|
31
|
-
secureHeader: "Secure websites use HTTPS",
|
|
32
|
-
secureContent: "Look for a <boldThis>lock</boldThis> {icon} or https:// as an added precaution. Share sensitive information only on official, secure websites."
|
|
33
|
-
},
|
|
34
|
-
"ms-SG": {
|
|
35
|
-
mainLabel: "A Singapore Government Agency Website",
|
|
36
|
-
identifyLabel: "How to identify",
|
|
37
|
-
environmentLabel: "[NOTE: THIS IS A {environment} WEBSITE]",
|
|
38
|
-
officialLinkHeader: "Official website links end with .gov.sg",
|
|
39
|
-
officialLinkContent: "Government agencies communicate via <boldThis>.gov.sg</boldThis> websites (e.g. go.gov.sg/open).",
|
|
40
|
-
officialLinkTrusted: "Trusted websites",
|
|
41
|
-
secureHeader: "Secure websites use HTTPS",
|
|
42
|
-
secureContent: "Look for a <boldThis>lock</boldThis> {icon} or https:// as an added precaution. Share sensitive information only on official, secure websites."
|
|
43
|
-
},
|
|
44
|
-
"ta-SG": {
|
|
45
|
-
mainLabel: "A Singapore Government Agency Website",
|
|
46
|
-
identifyLabel: "How to identify",
|
|
47
|
-
environmentLabel: "[NOTE: THIS IS A {environment} WEBSITE]",
|
|
48
|
-
officialLinkHeader: "Official website links end with .gov.sg",
|
|
49
|
-
officialLinkContent: "Government agencies communicate via <boldThis>.gov.sg</boldThis> websites (e.g. go.gov.sg/open).",
|
|
50
|
-
officialLinkTrusted: "Trusted websites",
|
|
51
|
-
secureHeader: "Secure websites use HTTPS",
|
|
52
|
-
secureContent: "Look for a <boldThis>lock</boldThis> {icon} or https:// as an added precaution. Share sensitive information only on official, secure websites."
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
13
|
function GovtBanner({
|
|
56
14
|
environment,
|
|
57
15
|
classNames,
|
|
58
16
|
...props
|
|
59
17
|
}) {
|
|
60
|
-
const formatMessage = useMessageFormatter(i18nStrings);
|
|
61
18
|
const state = useDisclosureState(props);
|
|
62
19
|
const panelRef = useRef(null);
|
|
63
20
|
const triggerRef = useRef(null);
|
|
@@ -104,10 +61,12 @@ function GovtBanner({
|
|
|
104
61
|
{
|
|
105
62
|
className: slots.mainContent({ className: classNames?.mainContent }),
|
|
106
63
|
children: [
|
|
107
|
-
/* @__PURE__ */ jsx("span", { children:
|
|
108
|
-
environment ? /* @__PURE__ */
|
|
109
|
-
|
|
110
|
-
|
|
64
|
+
/* @__PURE__ */ jsx("span", { children: "A Singapore Government Agency Website" }),
|
|
65
|
+
environment ? /* @__PURE__ */ jsxs("b", { children: [
|
|
66
|
+
"[NOTE: THIS IS A ",
|
|
67
|
+
environment.toUpperCase(),
|
|
68
|
+
" WEBSITE]"
|
|
69
|
+
] }) : null,
|
|
111
70
|
/* @__PURE__ */ jsxs(
|
|
112
71
|
"button",
|
|
113
72
|
{
|
|
@@ -119,7 +78,7 @@ function GovtBanner({
|
|
|
119
78
|
type: "button",
|
|
120
79
|
...mergeProps(buttonProps, focusProps),
|
|
121
80
|
children: [
|
|
122
|
-
/* @__PURE__ */ jsx("span", { className: slots.link({ className: classNames?.link }), children:
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: slots.link({ className: classNames?.link }), children: "How to identify" }),
|
|
123
82
|
/* @__PURE__ */ jsx(
|
|
124
83
|
ChevronDown,
|
|
125
84
|
{
|
|
@@ -162,13 +121,13 @@ function GovtBanner({
|
|
|
162
121
|
className: slots.panelHeader({
|
|
163
122
|
className: classNames?.panelHeader
|
|
164
123
|
}),
|
|
165
|
-
children:
|
|
124
|
+
children: "Official website links end with .gov.sg"
|
|
166
125
|
}
|
|
167
126
|
),
|
|
168
127
|
/* @__PURE__ */ jsxs("article", { children: [
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
128
|
+
"Government agencies communicate via ",
|
|
129
|
+
/* @__PURE__ */ jsx("b", { children: ".gov.sg" }),
|
|
130
|
+
" websites (e.g. go.gov.sg/open).",
|
|
172
131
|
" ",
|
|
173
132
|
/* @__PURE__ */ jsxs(
|
|
174
133
|
"a",
|
|
@@ -178,7 +137,7 @@ function GovtBanner({
|
|
|
178
137
|
rel: "noreferrer",
|
|
179
138
|
target: "_blank",
|
|
180
139
|
children: [
|
|
181
|
-
|
|
140
|
+
"Trusted websites",
|
|
182
141
|
/* @__PURE__ */ jsx(
|
|
183
142
|
ExternalLink,
|
|
184
143
|
{
|
|
@@ -224,12 +183,14 @@ function GovtBanner({
|
|
|
224
183
|
className: slots.panelHeader({
|
|
225
184
|
className: classNames?.panelHeader
|
|
226
185
|
}),
|
|
227
|
-
children:
|
|
186
|
+
children: "Secure websites use HTTPS"
|
|
228
187
|
}
|
|
229
188
|
),
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
|
|
232
|
-
|
|
189
|
+
/* @__PURE__ */ jsxs("article", { children: [
|
|
190
|
+
"Look for a ",
|
|
191
|
+
/* @__PURE__ */ jsx("b", { children: "lock" }),
|
|
192
|
+
" ",
|
|
193
|
+
/* @__PURE__ */ jsxs("span", { "aria-hidden": true, children: [
|
|
233
194
|
"(",
|
|
234
195
|
/* @__PURE__ */ jsx(
|
|
235
196
|
Lock,
|
|
@@ -240,8 +201,12 @@ function GovtBanner({
|
|
|
240
201
|
}
|
|
241
202
|
),
|
|
242
203
|
")"
|
|
243
|
-
] })
|
|
244
|
-
|
|
204
|
+
] }),
|
|
205
|
+
" ",
|
|
206
|
+
"or ",
|
|
207
|
+
/* @__PURE__ */ jsx("b", { children: "https://" }),
|
|
208
|
+
" as an added precaution. Share sensitive information only on official, secure websites."
|
|
209
|
+
] })
|
|
245
210
|
]
|
|
246
211
|
}
|
|
247
212
|
)
|
package/dist/esm/index.js
CHANGED
|
@@ -9,7 +9,6 @@ export { Toggle } from './toggle/toggle.js';
|
|
|
9
9
|
export { SkipNavLink } from './skip-nav-link/skip-nav-link.js';
|
|
10
10
|
export { Input } from './input/input.js';
|
|
11
11
|
export { TextField } from './text-field/text-field.js';
|
|
12
|
-
export { Description, FieldError, FieldGroup, Label } from './field/field.js';
|
|
13
12
|
export { TextArea } from './text-area/text-area.js';
|
|
14
13
|
export { TextAreaField } from './text-area-field/text-area-field.js';
|
|
15
14
|
export { TagField } from './tag-field/tag-field.js';
|
|
@@ -21,9 +20,8 @@ export { RangeCalendar, RangeCalendarCell, RangeCalendarStateWrapper } from './r
|
|
|
21
20
|
export { Menu, MenuItem, MenuSection, MenuSeparator, MenuTrigger, MenuVariantContext, SubmenuTrigger, useMenuVariantContext } from './menu/menu.js';
|
|
22
21
|
export { Popover } from './popover/popover.js';
|
|
23
22
|
export { Tab, TabList, TabPanel, Tabs, TabsVariantContext, useTabsVariantContext } from './tabs/tabs.js';
|
|
24
|
-
export { DatePicker } from './date-picker/date-picker.js';
|
|
25
|
-
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
26
23
|
export { Button } from './button/button.js';
|
|
24
|
+
export { Description, FieldError, FieldGroup, Label } from './field/field.js';
|
|
27
25
|
export { ComboBox, ComboBoxEmptyState } from './combo-box/combo-box.js';
|
|
28
26
|
export { ComboBoxFuzzy } from './combo-box/combo-box-fuzzy.js';
|
|
29
27
|
export { ComboBoxItem } from './combo-box/combo-box-item.js';
|
|
@@ -35,3 +33,5 @@ export { Calendar, CalendarStateWrapper } from './calendar/calendar.js';
|
|
|
35
33
|
export { CalendarStyleContext, useCalendarStyleContext } from './calendar/calendar-style-context.js';
|
|
36
34
|
export { getEraFormat, useGenerateLocalizedMonths, useGenerateLocalizedYears, useLocalizedMonthYear } from './calendar/utils.js';
|
|
37
35
|
export { DateField, DateInput } from './date-field/date-field.js';
|
|
36
|
+
export { DatePicker } from './date-picker/date-picker.js';
|
|
37
|
+
export { DateRangePicker } from './date-range-picker/date-range-picker.js';
|
|
@@ -4,10 +4,10 @@ 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
7
|
import { Popover } from '../popover/popover.js';
|
|
9
8
|
import { mapPropsVariants } from '../system/utils.js';
|
|
10
9
|
import { SelectVariantContext } from './select-variant-context.js';
|
|
10
|
+
import { Label, Description, FieldError } from '../field/field.js';
|
|
11
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
12
|
import { Button } from '../button/button.js';
|
|
13
13
|
|
|
@@ -4,7 +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
7
|
import { Input } from '../input/input.js';
|
|
9
8
|
import { Popover } from '../popover/popover.js';
|
|
10
9
|
import { TagFieldItem } from './tag-field-item.js';
|
|
@@ -13,6 +12,7 @@ import { TagFieldRoot } from './tag-field-root.js';
|
|
|
13
12
|
import { TagFieldTagList } from './tag-field-tag-list.js';
|
|
14
13
|
import { TagFieldTrigger } from './tag-field-trigger.js';
|
|
15
14
|
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';
|
|
15
|
+
import { Label, FieldGroup, Description, FieldError } from '../field/field.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"govt-banner.d.ts","sourceRoot":"","sources":["../../../src/govt-banner/govt-banner.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"govt-banner.d.ts","sourceRoot":"","sources":["../../../src/govt-banner/govt-banner.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAM7C,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG3E,UAAU,eAAgB,SAAQ,eAAe;IAC/C;;;;;OAKG;IACH,WAAW,CAAC,EAAE,YAAY,CACxB,YAAY,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAC5C,MAAM,CACP,CAAA;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAA;CAC7C;AAED,wBAAgB,UAAU,CAAC,EACzB,WAAW,EACX,UAAU,EACV,GAAG,KAAK,EACT,EAAE,eAAe,2CAkJjB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengovsg/oui",
|
|
3
|
-
"version": "0.0.0-snapshot-
|
|
3
|
+
"version": "0.0.0-snapshot-20250812083020",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@storybook/react-vite": "9.
|
|
37
|
+
"@storybook/react-vite": "9.1.1",
|
|
38
38
|
"@types/lodash-es": "^4.17.12",
|
|
39
39
|
"@types/prop-types": "^15.7.15",
|
|
40
40
|
"@types/react": "^19.0.12",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"lucide-react": "^0.475.0",
|
|
45
45
|
"motion": "^12.18.1",
|
|
46
46
|
"prettier": "^3.5.3",
|
|
47
|
-
"storybook": "9.
|
|
47
|
+
"storybook": "9.1.1",
|
|
48
48
|
"tsx": "^4.20.3",
|
|
49
49
|
"typescript": "5.7.3",
|
|
50
|
-
"@opengovsg/oui-theme": "0.0.0-snapshot-
|
|
50
|
+
"@opengovsg/oui-theme": "0.0.0-snapshot-20250812083020",
|
|
51
51
|
"@oui/chromatic": "0.0.0",
|
|
52
52
|
"@oui/eslint-config": "0.0.0",
|
|
53
|
-
"@oui/
|
|
54
|
-
"@oui/
|
|
53
|
+
"@oui/typescript-config": "0.0.0",
|
|
54
|
+
"@oui/prettier-config": "0.0.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@internationalized/date": "^3.8.2",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"motion": ">=11.12.0 || >=12.0.0-alpha.1",
|
|
82
82
|
"react-aria-components": "^1.10.1",
|
|
83
|
-
"@opengovsg/oui-theme": "0.0.0-snapshot-
|
|
83
|
+
"@opengovsg/oui-theme": "0.0.0-snapshot-20250812083020"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"build": "tsx ../../tooling/build-scripts/main.ts --dts --clean",
|