@bcgov/design-system-react-components 0.9.1-pr992 → 0.9.1-pr994
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
let react_aria = require("react-aria");
|
|
3
4
|
let react = require("react");
|
|
4
5
|
let _react_aria_datepicker = require("@react-aria/datepicker");
|
|
5
|
-
let _react_aria_i18n = require("@react-aria/i18n");
|
|
6
6
|
// src/hooks/useDateFormatLabel.tsx
|
|
7
7
|
function useDateFormatLabel(props) {
|
|
8
|
-
const formatter = (0,
|
|
8
|
+
const formatter = (0, react_aria.useDateFormatter)({ dateStyle: "short" });
|
|
9
9
|
const displayNames = (0, _react_aria_datepicker.useDisplayNames)();
|
|
10
10
|
return (0, react.useMemo)(() => {
|
|
11
11
|
if (props.showFormatHelpText) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: "Format: " }), formatter.formatToParts(/* @__PURE__ */ new Date()).map((s, i) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDateFormatLabel.cjs","names":["useDateFormatter","useDisplayNames","useMemo","_Fragment"],"sources":["../../../src/hooks/useDateFormatLabel.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useDisplayNames } from \"@react-aria/datepicker\";\nimport { useDateFormatter } from \"
|
|
1
|
+
{"version":3,"file":"useDateFormatLabel.cjs","names":["useDateFormatter","useDisplayNames","useMemo","_Fragment"],"sources":["../../../src/hooks/useDateFormatLabel.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useDisplayNames } from \"@react-aria/datepicker\";\nimport { useDateFormatter } from \"react-aria\";\n\n/* Generate format helper text, adapted from React Spectrum */\nexport default function useDateFormatLabel(props: {\n showFormatHelpText?: boolean;\n}): React.ReactNode {\n const formatter = useDateFormatter({ dateStyle: \"short\" });\n const displayNames = useDisplayNames();\n return useMemo(() => {\n if (props.showFormatHelpText) {\n return (\n <>\n <span>Format: </span>\n {formatter.formatToParts(new Date()).map((s, i) => {\n if (\n s.type === \"literal\" ||\n s.type === \"unknown\" ||\n (s.type as string) === \"yearName\"\n ) {\n return <span key={i}>{` ${s.value} `}</span>;\n }\n\n const type = (s.type as string) === \"relatedYear\" ? \"year\" : s.type;\n return (\n <span\n key={i}\n className=\"bcds-react-aria-DatePicker--FormatHelpText\"\n >\n {displayNames.of(type)}\n </span>\n );\n })}\n </>\n );\n }\n\n return \"\";\n }, [props.showFormatHelpText, formatter, displayNames]);\n}\n"],"mappings":";;;;;;AAKA,SAAwB,mBAAmB,OAEvB;CAClB,MAAM,aAAA,GAAYA,WAAAA,iBAAAA,CAAiB,EAAE,WAAW,QAAQ,CAAC;CACzD,MAAM,gBAAA,GAAeC,uBAAAA,gBAAAA,CAAgB;CACrC,QAAA,GAAOC,MAAAA,QAAAA,OAAc;EACnB,IAAI,MAAM,oBACR,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAAC,kBAAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAA,UAAM,WAAc,CAAA,GACnB,UAAU,8BAAc,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM;GACjD,IACE,EAAE,SAAS,aACX,EAAE,SAAS,aACV,EAAE,SAAoB,YAEvB,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD,EAAA,UAAe,IAAI,EAAE,MAAM,GAAS,GAAzB,CAAyB;GAG7C,MAAM,OAAQ,EAAE,SAAoB,gBAAgB,SAAS,EAAE;GAC/D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAEE,WAAU;IAET,UAAA,aAAa,GAAG,IAAI;GACjB,GAJC,CAID;EAEV,CAAC,CACD,EAAA,CAAA;EAIN,OAAO;CACT,GAAG;EAAC,MAAM;EAAoB;EAAW;CAAY,CAAC;AACxD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useDateFormatter } from "react-aria";
|
|
3
4
|
import { useMemo } from "react";
|
|
4
5
|
import { useDisplayNames } from "@react-aria/datepicker";
|
|
5
|
-
import { useDateFormatter } from "@react-aria/i18n";
|
|
6
6
|
// src/hooks/useDateFormatLabel.tsx
|
|
7
7
|
function useDateFormatLabel(props) {
|
|
8
8
|
const formatter = useDateFormatter({ dateStyle: "short" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDateFormatLabel.js","names":["_Fragment"],"sources":["../../../src/hooks/useDateFormatLabel.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useDisplayNames } from \"@react-aria/datepicker\";\nimport { useDateFormatter } from \"
|
|
1
|
+
{"version":3,"file":"useDateFormatLabel.js","names":["_Fragment"],"sources":["../../../src/hooks/useDateFormatLabel.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { useDisplayNames } from \"@react-aria/datepicker\";\nimport { useDateFormatter } from \"react-aria\";\n\n/* Generate format helper text, adapted from React Spectrum */\nexport default function useDateFormatLabel(props: {\n showFormatHelpText?: boolean;\n}): React.ReactNode {\n const formatter = useDateFormatter({ dateStyle: \"short\" });\n const displayNames = useDisplayNames();\n return useMemo(() => {\n if (props.showFormatHelpText) {\n return (\n <>\n <span>Format: </span>\n {formatter.formatToParts(new Date()).map((s, i) => {\n if (\n s.type === \"literal\" ||\n s.type === \"unknown\" ||\n (s.type as string) === \"yearName\"\n ) {\n return <span key={i}>{` ${s.value} `}</span>;\n }\n\n const type = (s.type as string) === \"relatedYear\" ? \"year\" : s.type;\n return (\n <span\n key={i}\n className=\"bcds-react-aria-DatePicker--FormatHelpText\"\n >\n {displayNames.of(type)}\n </span>\n );\n })}\n </>\n );\n }\n\n return \"\";\n }, [props.showFormatHelpText, formatter, displayNames]);\n}\n"],"mappings":";;;;;;AAKA,SAAwB,mBAAmB,OAEvB;CAClB,MAAM,YAAY,iBAAiB,EAAE,WAAW,QAAQ,CAAC;CACzD,MAAM,eAAe,gBAAgB;CACrC,OAAO,cAAc;EACnB,IAAI,MAAM,oBACR,OACE,qBAAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD,EAAA,UAAM,WAAc,CAAA,GACnB,UAAU,8BAAc,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,MAAM;GACjD,IACE,EAAE,SAAS,aACX,EAAE,SAAS,aACV,EAAE,SAAoB,YAEvB,OAAO,oBAAC,QAAD,EAAA,UAAe,IAAI,EAAE,MAAM,GAAS,GAAzB,CAAyB;GAG7C,MAAM,OAAQ,EAAE,SAAoB,gBAAgB,SAAS,EAAE;GAC/D,OACE,oBAAC,QAAD;IAEE,WAAU;IAET,UAAA,aAAa,GAAG,IAAI;GACjB,GAJC,CAID;EAEV,CAAC,CACD,EAAA,CAAA;EAIN,OAAO;CACT,GAAG;EAAC,MAAM;EAAoB;EAAW;CAAY,CAAC;AACxD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bcgov/design-system-react-components",
|
|
3
|
-
"version": "0.9.1-
|
|
3
|
+
"version": "0.9.1-pr994",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/bcgov/design-system.git",
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@bcgov/design-tokens": "5.1.0",
|
|
49
49
|
"@react-aria/datepicker": "3.17.1",
|
|
50
|
-
"@react-aria/i18n": "3.13.1",
|
|
51
50
|
"react-aria": "3.53.1",
|
|
52
51
|
"react-aria-components": "1.22.1"
|
|
53
52
|
},
|
|
@@ -60,43 +59,42 @@
|
|
|
60
59
|
"@eslint/js": "10.0.1",
|
|
61
60
|
"@figma/code-connect": "2.1.0",
|
|
62
61
|
"@internationalized/date": "3.12.4",
|
|
63
|
-
"@
|
|
64
|
-
"@storybook/addon-
|
|
65
|
-
"@storybook/addon-
|
|
66
|
-
"@storybook/addon-
|
|
67
|
-
"@storybook/addon-
|
|
68
|
-
"@storybook/
|
|
69
|
-
"@storybook/
|
|
70
|
-
"@
|
|
71
|
-
"@testing-library/jest-dom": "6.9.1",
|
|
62
|
+
"@storybook/addon-a11y": "10.6.6",
|
|
63
|
+
"@storybook/addon-docs": "10.6.6",
|
|
64
|
+
"@storybook/addon-links": "10.6.6",
|
|
65
|
+
"@storybook/addon-mcp": "10.6.6",
|
|
66
|
+
"@storybook/addon-vitest": "10.6.6",
|
|
67
|
+
"@storybook/mcp": "10.6.6",
|
|
68
|
+
"@storybook/react-vite": "10.6.6",
|
|
69
|
+
"@testing-library/jest-dom": "7.0.1",
|
|
72
70
|
"@testing-library/react": "16.3.3",
|
|
73
71
|
"@types/jsdom": "30.0.0",
|
|
74
|
-
"@types/node": "
|
|
72
|
+
"@types/node": "26.6.6",
|
|
75
73
|
"@types/react": "19.3.0",
|
|
76
74
|
"@types/react-dom": "19.3.0",
|
|
77
75
|
"@typescript-eslint/eslint-plugin": "8.72.1",
|
|
78
76
|
"@typescript-eslint/parser": "8.72.1",
|
|
79
77
|
"@vitejs/plugin-react": "6.3.0",
|
|
80
|
-
"@vitest/browser-playwright": "5.0
|
|
81
|
-
"@vitest/coverage-v8": "5.0
|
|
78
|
+
"@vitest/browser-playwright": "5.1.0",
|
|
79
|
+
"@vitest/coverage-v8": "5.1.0",
|
|
82
80
|
"eslint": "10.14.0",
|
|
83
81
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
84
82
|
"eslint-plugin-react-refresh": "0.5.7",
|
|
85
|
-
"eslint-plugin-storybook": "10.6.
|
|
83
|
+
"eslint-plugin-storybook": "10.6.6",
|
|
86
84
|
"globals": "17.14.0",
|
|
87
|
-
"jsdom": "
|
|
88
|
-
"playwright": "1.
|
|
85
|
+
"jsdom": "31.0.1",
|
|
86
|
+
"playwright": "1.65.0",
|
|
89
87
|
"prettier": "3.9.10",
|
|
90
88
|
"rolldown": "1.2.15",
|
|
91
89
|
"rolldown-plugin-dts": "0.29.0",
|
|
92
|
-
"storybook": "10.6.
|
|
90
|
+
"storybook": "10.6.6",
|
|
93
91
|
"stylelint": "18.0.0",
|
|
94
92
|
"stylelint-config-standard": "41.0.0",
|
|
95
93
|
"typescript": "6.0.3",
|
|
96
94
|
"typescript-eslint": "8.72.1",
|
|
97
95
|
"vite": "8.3.7",
|
|
98
96
|
"vite-plugin-css-injected-by-js": "5.0.3",
|
|
99
|
-
"vitest": "5.0
|
|
97
|
+
"vitest": "5.1.0"
|
|
100
98
|
},
|
|
101
99
|
"overrides": {
|
|
102
100
|
"eslint-plugin-react-hooks": {
|
|
@@ -104,6 +102,10 @@
|
|
|
104
102
|
}
|
|
105
103
|
},
|
|
106
104
|
"author": "Tyler Krys <Tyler.Krys@gov.bc.ca>",
|
|
105
|
+
"contributors": [
|
|
106
|
+
"Marcus Kernohan <Marcus.Kernohan@gov.bc.ca>",
|
|
107
|
+
"Trevor Richards <Trevor.Richards@gov.bc.ca>"
|
|
108
|
+
],
|
|
107
109
|
"license": "Apache-2.0",
|
|
108
110
|
"bugs": {
|
|
109
111
|
"url": "https://github.com/bcgov/design-system/issues"
|