@mittwald/flow-react-components 0.2.0-alpha.807 → 0.2.0-alpha.808
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/CHANGELOG.md +4 -0
- package/dist/assets/doc-properties.json +10495 -10514
- package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs +0 -1
- package/dist/js/packages/components/src/components/CountryOptions/CountryOptions.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Option/Option.mjs +5 -5
- package/dist/js/packages/components/src/components/Option/Option.mjs.map +1 -1
- package/dist/types/components/CountryOptions/CountryOptions.d.ts.map +1 -1
- package/dist/types/components/Option/Option.d.ts +1 -1
- package/dist/types/components/Option/Option.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountryOptions.mjs","sources":["../../../../../../../src/components/CountryOptions/CountryOptions.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useMemo } from \"react\";\nimport type { ListBoxProps } from \"react-aria-components\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport locales from \"./locales/*.locale.json\";\nimport { all, type CountryData } from \"country-codes-list\";\nimport { Option } from \"@/components/Option\";\n\nexport type Country = CountryData & {\n name: string;\n code: string;\n};\n\nexport type CountryFilterFn = (country: Country) => boolean;\nexport type CountrySortFn = (left: Country, right: Country) => number;\n\nexport interface CountryOptionsProps<T = object>\n extends\n PropsWithChildren<Omit<ListBoxProps<T>, \"children\">>,\n FlowComponentProps {\n filterBy?: CountryFilterFn;\n sortBy?: CountrySortFn;\n}\n\nconst defaultSortBy: CountrySortFn = (left, right) =>\n left.name.localeCompare(right.name);\nconst defaultFilterBy: CountryFilterFn = () => true;\n\nexport const CountryOptions: FC<CountryOptionsProps> = (props) => {\n const { filterBy = defaultFilterBy, sortBy = defaultSortBy } = props;\n const stringFormatter = useLocalizedStringFormatter(\n locales,\n \"CountryOptions\",\n );\n\n return useMemo(() => {\n return all()\n .map((countryData) => ({\n ...countryData,\n code: countryData.countryCode,\n name: stringFormatter.format(`countryCode.${countryData.countryCode}`),\n }))\n .filter(filterBy)\n .sort(sortBy)\n .map((country) => (\n <Option\n key={country.countryNameEn}\n
|
|
1
|
+
{"version":3,"file":"CountryOptions.mjs","sources":["../../../../../../../src/components/CountryOptions/CountryOptions.tsx"],"sourcesContent":["import type { FC, PropsWithChildren } from \"react\";\nimport { useMemo } from \"react\";\nimport type { ListBoxProps } from \"react-aria-components\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport locales from \"./locales/*.locale.json\";\nimport { all, type CountryData } from \"country-codes-list\";\nimport { Option } from \"@/components/Option\";\n\nexport type Country = CountryData & {\n name: string;\n code: string;\n};\n\nexport type CountryFilterFn = (country: Country) => boolean;\nexport type CountrySortFn = (left: Country, right: Country) => number;\n\nexport interface CountryOptionsProps<T = object>\n extends\n PropsWithChildren<Omit<ListBoxProps<T>, \"children\">>,\n FlowComponentProps {\n filterBy?: CountryFilterFn;\n sortBy?: CountrySortFn;\n}\n\nconst defaultSortBy: CountrySortFn = (left, right) =>\n left.name.localeCompare(right.name);\nconst defaultFilterBy: CountryFilterFn = () => true;\n\nexport const CountryOptions: FC<CountryOptionsProps> = (props) => {\n const { filterBy = defaultFilterBy, sortBy = defaultSortBy } = props;\n const stringFormatter = useLocalizedStringFormatter(\n locales,\n \"CountryOptions\",\n );\n\n return useMemo(() => {\n return all()\n .map((countryData) => ({\n ...countryData,\n code: countryData.countryCode,\n name: stringFormatter.format(`countryCode.${countryData.countryCode}`),\n }))\n .filter(filterBy)\n .sort(sortBy)\n .map((country) => (\n <Option\n key={country.countryNameEn}\n value={country.countryCode}\n textValue={country.name}\n >\n {country.name}\n </Option>\n ));\n }, [stringFormatter]);\n};\n\nexport default CountryOptions;\n"],"names":[],"mappings":";;;;;;;AAyBA,MAAM,aAAA,GAA+B,CAAC,IAAA,EAAM,KAAA,KAC1C,KAAK,IAAA,CAAK,aAAA,CAAc,MAAM,IAAI,CAAA;AACpC,MAAM,kBAAmC,MAAM,IAAA;AAExC,MAAM,cAAA,GAA0C,CAAC,KAAA,KAAU;AAChE,EAAA,MAAM,EAAE,QAAA,GAAW,eAAA,EAAiB,MAAA,GAAS,eAAc,GAAI,KAAA;AAC/D,EAAA,MAAM,eAAA,GAAkB,2BAAA;AAAA,IACtB,OAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAA,OAAO,GAAA,EAAI,CACR,GAAA,CAAI,CAAC,WAAA,MAAiB;AAAA,MACrB,GAAG,WAAA;AAAA,MACH,MAAM,WAAA,CAAY,WAAA;AAAA,MAClB,MAAM,eAAA,CAAgB,MAAA,CAAO,CAAA,YAAA,EAAe,WAAA,CAAY,WAAW,CAAA,CAAE;AAAA,KACvE,CAAE,CAAA,CACD,MAAA,CAAO,QAAQ,CAAA,CACf,KAAK,MAAM,CAAA,CACX,GAAA,CAAI,CAAC,OAAA,qBACJ,GAAA;AAAA,MAAC,MAAA;AAAA,MAAA;AAAA,QAEC,OAAO,OAAA,CAAQ,WAAA;AAAA,QACf,WAAW,OAAA,CAAQ,IAAA;AAAA,QAElB,QAAA,EAAA,OAAA,CAAQ;AAAA,OAAA;AAAA,MAJJ,OAAA,CAAQ;AAAA,KAMhB,CAAA;AAAA,EACL,CAAA,EAAG,CAAC,eAAe,CAAC,CAAA;AACtB;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
/* */
|
|
3
|
-
import {
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { Children } from 'react';
|
|
4
5
|
import * as Aria from 'react-aria-components';
|
|
5
6
|
import clsx from 'clsx';
|
|
6
7
|
import styles from './Option.module.scss.mjs';
|
|
@@ -18,7 +19,7 @@ const Option = flowComponent("Option", (props) => {
|
|
|
18
19
|
} = props;
|
|
19
20
|
const rootClassName = clsx(styles.option, className);
|
|
20
21
|
const hasChildren = Children.count(children) >= 1;
|
|
21
|
-
return /* @__PURE__ */
|
|
22
|
+
return /* @__PURE__ */ jsx(
|
|
22
23
|
Aria.ListBoxItem,
|
|
23
24
|
{
|
|
24
25
|
className: rootClassName,
|
|
@@ -26,9 +27,8 @@ const Option = flowComponent("Option", (props) => {
|
|
|
26
27
|
id: value,
|
|
27
28
|
...rest,
|
|
28
29
|
textValue,
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
hasChildren ? children : textValue
|
|
30
|
+
children: hasChildren ? children : textValue
|
|
31
|
+
}
|
|
32
32
|
);
|
|
33
33
|
});
|
|
34
34
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.mjs","sources":["../../../../../../../src/components/Option/Option.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport React, { Children } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"./Option.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { extractTextFromFirstChild } from \"@/lib/react/remote\";\n\nexport interface OptionProps\n extends\n Omit<Aria.ListBoxItemProps, \"children\" | \"value\">,\n PropsWithChildren,\n FlowComponentProps {\n value?: string | number;\n}\n\n/** @flr-generate all */\nexport const Option = flowComponent(\"Option\", (props) => {\n const {\n className,\n children,\n textValue = extractTextFromFirstChild(children),\n value = textValue,\n ref,\n ...rest\n } = props;\n\n const rootClassName = clsx(styles.option, className);\n const hasChildren = Children.count(children) >= 1;\n\n return (\n <Aria.ListBoxItem\n className={rootClassName}\n ref={ref}\n id={value}\n {...rest}\n textValue={textValue}\n
|
|
1
|
+
{"version":3,"file":"Option.mjs","sources":["../../../../../../../src/components/Option/Option.tsx"],"sourcesContent":["import { type PropsWithChildren } from \"react\";\nimport React, { Children } from \"react\";\nimport * as Aria from \"react-aria-components\";\nimport clsx from \"clsx\";\nimport styles from \"./Option.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { extractTextFromFirstChild } from \"@/lib/react/remote\";\n\nexport interface OptionProps\n extends\n Omit<Aria.ListBoxItemProps, \"children\" | \"value\" | \"id\">,\n PropsWithChildren,\n FlowComponentProps {\n value?: string | number;\n}\n\n/** @flr-generate all */\nexport const Option = flowComponent(\"Option\", (props) => {\n const {\n className,\n children,\n textValue = extractTextFromFirstChild(children),\n value = textValue,\n ref,\n ...rest\n } = props;\n\n const rootClassName = clsx(styles.option, className);\n const hasChildren = Children.count(children) >= 1;\n\n return (\n <Aria.ListBoxItem\n className={rootClassName}\n ref={ref}\n id={value}\n {...rest}\n textValue={textValue}\n >\n {hasChildren ? children : textValue}\n </Aria.ListBoxItem>\n );\n});\n\nexport default Option;\n"],"names":[],"mappings":";;;;;;;;AAkBO,MAAM,MAAA,GAAS,aAAA,CAAc,QAAA,EAAU,CAAC,KAAA,KAAU;AACvD,EAAA,MAAM;AAAA,IACJ,SAAA;AAAA,IACA,QAAA;AAAA,IACA,SAAA,GAAY,0BAA0B,QAAQ,CAAA;AAAA,IAC9C,KAAA,GAAQ,SAAA;AAAA,IACR,GAAA;AAAA,IACA,GAAG;AAAA,GACL,GAAI,KAAA;AAEJ,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,MAAA,CAAO,MAAA,EAAQ,SAAS,CAAA;AACnD,EAAA,MAAM,WAAA,GAAc,QAAA,CAAS,KAAA,CAAM,QAAQ,CAAA,IAAK,CAAA;AAEhD,EAAA,uBACE,GAAA;AAAA,IAAC,IAAA,CAAK,WAAA;AAAA,IAAL;AAAA,MACC,SAAA,EAAW,aAAA;AAAA,MACX,GAAA;AAAA,MACA,EAAA,EAAI,KAAA;AAAA,MACH,GAAG,IAAA;AAAA,MACJ,SAAA;AAAA,MAEC,wBAAc,QAAA,GAAW;AAAA;AAAA,GAC5B;AAEJ,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountryOptions.d.ts","sourceRoot":"","sources":["../../../../src/components/CountryOptions/CountryOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAO,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;AAEtE,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,MAAM,CAC7C,SACE,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EACpD,kBAAkB;IACpB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAMD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"CountryOptions.d.ts","sourceRoot":"","sources":["../../../../src/components/CountryOptions/CountryOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,EAAO,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;AAEtE,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,MAAM,CAC7C,SACE,iBAAiB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,EACpD,kBAAkB;IACpB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAMD,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CA0BlD,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren, default as React } from 'react';
|
|
2
2
|
import { FlowComponentProps } from '../../lib/componentFactory/flowComponent';
|
|
3
3
|
import * as Aria from "react-aria-components";
|
|
4
|
-
export interface OptionProps extends Omit<Aria.ListBoxItemProps, "children" | "value">, PropsWithChildren, FlowComponentProps {
|
|
4
|
+
export interface OptionProps extends Omit<Aria.ListBoxItemProps, "children" | "value" | "id">, PropsWithChildren, FlowComponentProps {
|
|
5
5
|
value?: string | number;
|
|
6
6
|
}
|
|
7
7
|
/** @flr-generate all */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../src/components/Option/Option.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAG9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAI/E,MAAM,WAAW,WACf,SACE,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../../src/components/Option/Option.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,uBAAuB,CAAC;AAG9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAI/E,MAAM,WAAW,WACf,SACE,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC,EACxD,iBAAiB,EACjB,kBAAkB;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAED,wBAAwB;AACxB,eAAO,MAAM,MAAM,4EAwBjB,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.808",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://mittwald.github.io/flow",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@codemirror/lint": "^6.9.5",
|
|
61
61
|
"@internationalized/string": "^3.2.7",
|
|
62
62
|
"@lezer/highlight": "^1.2.3",
|
|
63
|
-
"@mittwald/flow-icons": "0.2.0-alpha.
|
|
63
|
+
"@mittwald/flow-icons": "0.2.0-alpha.808",
|
|
64
64
|
"@mittwald/password-tools-js": "3.0.0-alpha.29",
|
|
65
|
-
"@mittwald/react-tunnel": "0.2.0-alpha.
|
|
65
|
+
"@mittwald/react-tunnel": "0.2.0-alpha.808",
|
|
66
66
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
67
67
|
"@react-aria/form": "^3.1.3",
|
|
68
68
|
"@react-aria/i18n": "^3.12.16",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"@lezer/generator": "^1.8.0",
|
|
117
117
|
"@lezer/lr": "^1.4.8",
|
|
118
118
|
"@mittwald/flow-core": "",
|
|
119
|
-
"@mittwald/flow-design-tokens": "0.2.0-alpha.
|
|
119
|
+
"@mittwald/flow-design-tokens": "0.2.0-alpha.808",
|
|
120
120
|
"@mittwald/flow-icons-base": "",
|
|
121
121
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
122
122
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@internationalized/date": "^3.10.0",
|
|
172
|
-
"@mittwald/flow-icons-pro": "0.2.0-alpha.
|
|
172
|
+
"@mittwald/flow-icons-pro": "0.2.0-alpha.807",
|
|
173
173
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
174
174
|
"next": "*",
|
|
175
175
|
"react": "^19.2.0",
|
|
@@ -190,5 +190,5 @@
|
|
|
190
190
|
"optional": true
|
|
191
191
|
}
|
|
192
192
|
},
|
|
193
|
-
"gitHead": "
|
|
193
|
+
"gitHead": "f1c927b10fcbfa6934ee1213ccaa00ac5784b1b7"
|
|
194
194
|
}
|