@inventreedb/ui 0.0.2 → 0.0.4
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 +9 -1
- package/README.md +18 -7
- package/dist/.vite/manifest.json +672 -1
- package/dist/_virtual/errors.js +5 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/index.js +6 -0
- package/dist/_virtual/index.js.map +1 -0
- package/dist/_virtual/index2.js +5 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/jsx-runtime.js +6 -0
- package/dist/_virtual/jsx-runtime.js.map +1 -0
- package/dist/_virtual/jsx-runtime2.js +5 -0
- package/dist/_virtual/jsx-runtime2.js.map +1 -0
- package/dist/_virtual/lexer.js +5 -0
- package/dist/_virtual/lexer.js.map +1 -0
- package/dist/_virtual/moo.js +5 -0
- package/dist/_virtual/moo.js.map +1 -0
- package/dist/_virtual/parser.js +6 -0
- package/dist/_virtual/parser.js.map +1 -0
- package/dist/_virtual/parser2.js +5 -0
- package/dist/_virtual/parser2.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.development.js +5 -0
- package/dist/_virtual/react-jsx-runtime.development.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.production.min.js +5 -0
- package/dist/_virtual/react-jsx-runtime.production.min.js.map +1 -0
- package/dist/components/StylishText.d.ts +5 -0
- package/dist/components/StylishText.js +36 -0
- package/dist/components/StylishText.js.map +1 -0
- package/dist/enums/ModelInformation.d.ts +20 -0
- package/dist/enums/ModelInformation.js +590 -0
- package/dist/enums/ModelInformation.js.map +1 -0
- package/dist/functions/Events.d.ts +1 -0
- package/dist/functions/Events.js +10 -0
- package/dist/functions/Events.js.map +1 -0
- package/dist/functions/Navigation.d.ts +8 -0
- package/dist/functions/Navigation.js +46 -0
- package/dist/functions/Navigation.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/node_modules/@lingui/core/dist/index.js +405 -0
- package/dist/node_modules/@lingui/core/dist/index.js.map +1 -0
- package/dist/node_modules/@lingui/message-utils/dist/compileMessage.js +326 -0
- package/dist/node_modules/@lingui/message-utils/dist/compileMessage.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.js +94 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.js +6 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js +2 -0
- package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/Box.js +83 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/Box.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/get-box-mod/get-box-mod.js +33 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/get-box-mod/get-box-mod.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/get-box-style/get-box-style.js +29 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/get-box-style/get-box-style.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/extract-style-props/extract-style-props.js +123 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/extract-style-props/extract-style-props.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/parse-style-props.js +88 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/parse-style-props.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/sort-media-queries.js +15 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/sort-media-queries.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.js +21 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/color-resolver/color-resolver.js +25 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/color-resolver/color-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-family-resolver/font-family-resolver.js +17 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-family-resolver/font-family-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js +23 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/identity-resolver/identity-resolver.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/identity-resolver/identity-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/index.js +23 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/index.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/line-height-resolver/line-height-resolver.js +14 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/line-height-resolver/line-height-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/size-resolver/size-resolver.js +13 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/size-resolver/size-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js +21 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/style-props-data.js +55 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/style-props/style-props-data.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/use-random-classname/use-random-classname.js +9 -0
- package/dist/node_modules/@mantine/core/esm/core/Box/use-random-classname/use-random-classname.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/InlineStyles.js +19 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/InlineStyles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/css-object-to-string/css-object-to-string.js +14 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/css-object-to-string/css-object-to-string.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/styles-to-string/styles-to-string.js +13 -0
- package/dist/node_modules/@mantine/core/esm/core/InlineStyles/styles-to-string/styles-to-string.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/Mantine.context.js +40 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/Mantine.context.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js +17 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/darken/darken.js +14 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/darken/darken.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-gradient/get-gradient.js +15 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-gradient/get-gradient.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-primary-shade/get-primary-shade.js +13 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-primary-shade/get-primary-shade.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-theme-color/get-theme-color.js +9 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-theme-color/get-theme-color.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/luminance/luminance.js +32 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/luminance/luminance.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.js +78 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/to-rgba/to-rgba.js +116 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/to-rgba/to-rgba.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.js +15 -0
- package/dist/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/create-polymorphic-component.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/create-polymorphic-component.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/factory.js +9 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/factory.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/polymorphic-factory.js +18 -0
- package/dist/node_modules/@mantine/core/esm/core/factory/polymorphic-factory.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/create-vars-resolver/create-vars-resolver.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/create-vars-resolver/create-vars-resolver.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-class-name.js +48 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-class-name.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-global-class-names/get-global-class-names.js +17 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-global-class-names/get-global-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.js +19 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.js +14 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-root-class-name/get-root-class-name.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-root-class-name/get-root-class-name.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-selector-class-name/get-selector-class-name.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-selector-class-name/get-selector-class-name.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.js +15 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-theme-class-names/get-theme-class-names.js +24 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-theme-class-names/get-theme-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.js +12 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.js +26 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-style.js +32 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-style.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-theme-styles/get-theme-styles.js +24 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-theme-styles/get-theme-styles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-style/resolve-style.js +19 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-style/resolve-style.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js +13 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.js +17 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/resolve-vars.js +25 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/resolve-vars.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-styles.js +70 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-styles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-transformed-styles.js +34 -0
- package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-transformed-styles.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/camel-to-kebab-case/camel-to-kebab-case.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/camel-to-kebab-case/camel-to-kebab-case.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/filter-props/filter-props.js +12 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/filter-props/filter-props.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/get-size/get-size.js +20 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/get-size/get-size.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/is-number-like/is-number-like.js +18 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/is-number-like/is-number-like.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/keys/keys.js +7 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/keys/keys.js.map +1 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/units-converters/rem.js +47 -0
- package/dist/node_modules/@mantine/core/esm/core/utils/units-converters/rem.js.map +1 -0
- package/dist/node_modules/@messageformat/parser/lib/lexer.js +74 -0
- package/dist/node_modules/@messageformat/parser/lib/lexer.js.map +1 -0
- package/dist/node_modules/@messageformat/parser/lib/parser.js +223 -0
- package/dist/node_modules/@messageformat/parser/lib/parser.js.map +1 -0
- package/dist/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/moo/moo.js +539 -0
- package/dist/node_modules/moo/moo.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +891 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +1 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +34 -0
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js.map +1 -0
- package/dist/node_modules/react/jsx-runtime.js +18 -0
- package/dist/node_modules/react/jsx-runtime.js.map +1 -0
- package/dist/node_modules/unraw/dist/errors.js +39 -0
- package/dist/node_modules/unraw/dist/errors.js.map +1 -0
- package/dist/node_modules/unraw/dist/index.js +112 -0
- package/dist/node_modules/unraw/dist/index.js.map +1 -0
- package/dist/types/Icons.d.ts +5 -0
- package/dist/types/Plugins.js +1 -1
- package/lib/components/StylishText.tsx +45 -0
- package/lib/enums/ModelInformation.tsx +279 -0
- package/lib/functions/Events.tsx +6 -0
- package/lib/functions/Navigation.tsx +70 -0
- package/lib/index.ts +9 -0
- package/lib/types/Icons.tsx +9 -0
- package/package.json +4 -1
|
@@ -0,0 +1,326 @@
|
|
|
1
|
+
import { p as parserExports } from "../../../../_virtual/parser.js";
|
|
2
|
+
class DateFormatError extends Error {
|
|
3
|
+
/** @internal */
|
|
4
|
+
constructor(msg, token, type) {
|
|
5
|
+
super(msg);
|
|
6
|
+
this.token = token;
|
|
7
|
+
this.type = type || "error";
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const alpha = (width) => width < 4 ? "short" : width === 4 ? "long" : "narrow";
|
|
11
|
+
const numeric = (width) => width % 2 === 0 ? "2-digit" : "numeric";
|
|
12
|
+
function yearOptions(token, onError) {
|
|
13
|
+
switch (token.char) {
|
|
14
|
+
case "y":
|
|
15
|
+
return { year: numeric(token.width) };
|
|
16
|
+
case "r":
|
|
17
|
+
return { calendar: "gregory", year: "numeric" };
|
|
18
|
+
case "u":
|
|
19
|
+
case "U":
|
|
20
|
+
case "Y":
|
|
21
|
+
default:
|
|
22
|
+
onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING);
|
|
23
|
+
return { year: "numeric" };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function monthStyle(token, onError) {
|
|
27
|
+
switch (token.width) {
|
|
28
|
+
case 1:
|
|
29
|
+
return "numeric";
|
|
30
|
+
case 2:
|
|
31
|
+
return "2-digit";
|
|
32
|
+
case 3:
|
|
33
|
+
return "short";
|
|
34
|
+
case 4:
|
|
35
|
+
return "long";
|
|
36
|
+
case 5:
|
|
37
|
+
return "narrow";
|
|
38
|
+
default:
|
|
39
|
+
onError(`${token.desc} is not supported with width ${token.width}`);
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function dayStyle(token, onError) {
|
|
44
|
+
const { char, desc, width } = token;
|
|
45
|
+
if (char === "d") {
|
|
46
|
+
return numeric(width);
|
|
47
|
+
} else {
|
|
48
|
+
onError(`${desc} is not supported`);
|
|
49
|
+
return void 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function weekdayStyle(token, onError) {
|
|
53
|
+
const { char, desc, width } = token;
|
|
54
|
+
if ((char === "c" || char === "e") && width < 3) {
|
|
55
|
+
const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`;
|
|
56
|
+
onError(msg, DateFormatError.WARNING);
|
|
57
|
+
}
|
|
58
|
+
return alpha(width);
|
|
59
|
+
}
|
|
60
|
+
function hourOptions(token) {
|
|
61
|
+
const hour = numeric(token.width);
|
|
62
|
+
let hourCycle;
|
|
63
|
+
switch (token.char) {
|
|
64
|
+
case "h":
|
|
65
|
+
hourCycle = "h12";
|
|
66
|
+
break;
|
|
67
|
+
case "H":
|
|
68
|
+
hourCycle = "h23";
|
|
69
|
+
break;
|
|
70
|
+
case "k":
|
|
71
|
+
hourCycle = "h24";
|
|
72
|
+
break;
|
|
73
|
+
case "K":
|
|
74
|
+
hourCycle = "h11";
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
return hourCycle ? { hour, hourCycle } : { hour };
|
|
78
|
+
}
|
|
79
|
+
function timeZoneNameStyle(token, onError) {
|
|
80
|
+
const { char, desc, width } = token;
|
|
81
|
+
switch (char) {
|
|
82
|
+
case "v":
|
|
83
|
+
case "z":
|
|
84
|
+
return width === 4 ? "long" : "short";
|
|
85
|
+
case "V":
|
|
86
|
+
if (width === 4)
|
|
87
|
+
return "long";
|
|
88
|
+
onError(`${desc} is not supported with width ${width}`);
|
|
89
|
+
return void 0;
|
|
90
|
+
case "X":
|
|
91
|
+
onError(`${desc} is not supported`);
|
|
92
|
+
return void 0;
|
|
93
|
+
}
|
|
94
|
+
return "short";
|
|
95
|
+
}
|
|
96
|
+
function compileOptions(token, onError) {
|
|
97
|
+
switch (token.field) {
|
|
98
|
+
case "era":
|
|
99
|
+
return { era: alpha(token.width) };
|
|
100
|
+
case "year":
|
|
101
|
+
return yearOptions(token, onError);
|
|
102
|
+
case "month":
|
|
103
|
+
return { month: monthStyle(token, onError) };
|
|
104
|
+
case "day":
|
|
105
|
+
return { day: dayStyle(token, onError) };
|
|
106
|
+
case "weekday":
|
|
107
|
+
return { weekday: weekdayStyle(token, onError) };
|
|
108
|
+
case "period":
|
|
109
|
+
return void 0;
|
|
110
|
+
case "hour":
|
|
111
|
+
return hourOptions(token);
|
|
112
|
+
case "min":
|
|
113
|
+
return { minute: numeric(token.width) };
|
|
114
|
+
case "sec":
|
|
115
|
+
return { second: numeric(token.width) };
|
|
116
|
+
case "tz":
|
|
117
|
+
return { timeZoneName: timeZoneNameStyle(token, onError) };
|
|
118
|
+
case "quarter":
|
|
119
|
+
case "week":
|
|
120
|
+
case "sec-frac":
|
|
121
|
+
case "ms":
|
|
122
|
+
onError(`${token.desc} is not supported`);
|
|
123
|
+
}
|
|
124
|
+
return void 0;
|
|
125
|
+
}
|
|
126
|
+
function getDateFormatOptions(tokens, timeZone, onError = (error) => {
|
|
127
|
+
throw error;
|
|
128
|
+
}) {
|
|
129
|
+
const options = {
|
|
130
|
+
timeZone
|
|
131
|
+
};
|
|
132
|
+
const fields2 = [];
|
|
133
|
+
for (const token of tokens) {
|
|
134
|
+
const { error, field, str } = token;
|
|
135
|
+
if (error) {
|
|
136
|
+
const dte = new DateFormatError(error.message, token);
|
|
137
|
+
dte.stack = error.stack;
|
|
138
|
+
onError(dte);
|
|
139
|
+
}
|
|
140
|
+
if (str) {
|
|
141
|
+
const msg = `Ignoring string part: ${str}`;
|
|
142
|
+
onError(new DateFormatError(msg, token, DateFormatError.WARNING));
|
|
143
|
+
}
|
|
144
|
+
if (field) {
|
|
145
|
+
if (fields2.indexOf(field) === -1)
|
|
146
|
+
fields2.push(field);
|
|
147
|
+
else
|
|
148
|
+
onError(new DateFormatError(`Duplicate ${field} token`, token));
|
|
149
|
+
}
|
|
150
|
+
const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning)));
|
|
151
|
+
if (opt)
|
|
152
|
+
Object.assign(options, opt);
|
|
153
|
+
}
|
|
154
|
+
return options;
|
|
155
|
+
}
|
|
156
|
+
const fields = {
|
|
157
|
+
G: { field: "era", desc: "Era" },
|
|
158
|
+
y: { field: "year", desc: "Year" },
|
|
159
|
+
Y: { field: "year", desc: 'Year of "Week of Year"' },
|
|
160
|
+
u: { field: "year", desc: "Extended year" },
|
|
161
|
+
U: { field: "year", desc: "Cyclic year name" },
|
|
162
|
+
r: { field: "year", desc: "Related Gregorian year" },
|
|
163
|
+
Q: { field: "quarter", desc: "Quarter" },
|
|
164
|
+
q: { field: "quarter", desc: "Stand-alone quarter" },
|
|
165
|
+
M: { field: "month", desc: "Month in year" },
|
|
166
|
+
L: { field: "month", desc: "Stand-alone month in year" },
|
|
167
|
+
w: { field: "week", desc: "Week of year" },
|
|
168
|
+
W: { field: "week", desc: "Week of month" },
|
|
169
|
+
d: { field: "day", desc: "Day in month" },
|
|
170
|
+
D: { field: "day", desc: "Day of year" },
|
|
171
|
+
F: { field: "day", desc: "Day of week in month" },
|
|
172
|
+
g: { field: "day", desc: "Modified julian day" },
|
|
173
|
+
E: { field: "weekday", desc: "Day of week" },
|
|
174
|
+
e: { field: "weekday", desc: "Local day of week" },
|
|
175
|
+
c: { field: "weekday", desc: "Stand-alone local day of week" },
|
|
176
|
+
a: { field: "period", desc: "AM/PM marker" },
|
|
177
|
+
b: { field: "period", desc: "AM/PM/noon/midnight marker" },
|
|
178
|
+
B: { field: "period", desc: "Flexible day period" },
|
|
179
|
+
h: { field: "hour", desc: "Hour in AM/PM (1~12)" },
|
|
180
|
+
H: { field: "hour", desc: "Hour in day (0~23)" },
|
|
181
|
+
k: { field: "hour", desc: "Hour in day (1~24)" },
|
|
182
|
+
K: { field: "hour", desc: "Hour in AM/PM (0~11)" },
|
|
183
|
+
j: { field: "hour", desc: "Hour in preferred cycle" },
|
|
184
|
+
J: { field: "hour", desc: "Hour in preferred cycle without marker" },
|
|
185
|
+
C: { field: "hour", desc: "Hour in preferred cycle with flexible marker" },
|
|
186
|
+
m: { field: "min", desc: "Minute in hour" },
|
|
187
|
+
s: { field: "sec", desc: "Second in minute" },
|
|
188
|
+
S: { field: "sec-frac", desc: "Fractional second" },
|
|
189
|
+
A: { field: "ms", desc: "Milliseconds in day" },
|
|
190
|
+
z: { field: "tz", desc: "Time Zone: specific non-location" },
|
|
191
|
+
Z: { field: "tz", desc: "Time Zone" },
|
|
192
|
+
O: { field: "tz", desc: "Time Zone: localized" },
|
|
193
|
+
v: { field: "tz", desc: "Time Zone: generic non-location" },
|
|
194
|
+
V: { field: "tz", desc: "Time Zone: ID" },
|
|
195
|
+
X: { field: "tz", desc: "Time Zone: ISO8601 with Z" },
|
|
196
|
+
x: { field: "tz", desc: "Time Zone: ISO8601" }
|
|
197
|
+
};
|
|
198
|
+
const isLetter = (char) => char >= "A" && char <= "Z" || char >= "a" && char <= "z";
|
|
199
|
+
function readFieldToken(src, pos) {
|
|
200
|
+
const char = src[pos];
|
|
201
|
+
let width = 1;
|
|
202
|
+
while (src[++pos] === char)
|
|
203
|
+
++width;
|
|
204
|
+
const field = fields[char];
|
|
205
|
+
if (!field) {
|
|
206
|
+
const msg = `The letter ${char} is not a valid field identifier`;
|
|
207
|
+
return { char, error: new Error(msg), width };
|
|
208
|
+
}
|
|
209
|
+
return { char, field: field.field, desc: field.desc, width };
|
|
210
|
+
}
|
|
211
|
+
function readQuotedToken(src, pos) {
|
|
212
|
+
let str = src[++pos];
|
|
213
|
+
let width = 2;
|
|
214
|
+
if (str === "'")
|
|
215
|
+
return { char: "'", str, width };
|
|
216
|
+
while (true) {
|
|
217
|
+
const next = src[++pos];
|
|
218
|
+
++width;
|
|
219
|
+
if (next === void 0) {
|
|
220
|
+
const msg = `Unterminated quoted literal in pattern: ${str || src}`;
|
|
221
|
+
return { char: "'", error: new Error(msg), str, width };
|
|
222
|
+
} else if (next === "'") {
|
|
223
|
+
if (src[++pos] !== "'")
|
|
224
|
+
return { char: "'", str, width };
|
|
225
|
+
else
|
|
226
|
+
++width;
|
|
227
|
+
}
|
|
228
|
+
str += next;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
function readToken(src, pos) {
|
|
232
|
+
const char = src[pos];
|
|
233
|
+
if (!char)
|
|
234
|
+
return null;
|
|
235
|
+
if (isLetter(char))
|
|
236
|
+
return readFieldToken(src, pos);
|
|
237
|
+
if (char === "'")
|
|
238
|
+
return readQuotedToken(src, pos);
|
|
239
|
+
let str = char;
|
|
240
|
+
let width = 1;
|
|
241
|
+
while (true) {
|
|
242
|
+
const next = src[++pos];
|
|
243
|
+
if (!next || isLetter(next) || next === "'")
|
|
244
|
+
return { char, str, width };
|
|
245
|
+
str += next;
|
|
246
|
+
width += 1;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function parseDateTokens(src) {
|
|
250
|
+
const tokens = [];
|
|
251
|
+
let pos = 0;
|
|
252
|
+
while (true) {
|
|
253
|
+
const token = readToken(src, pos);
|
|
254
|
+
if (!token)
|
|
255
|
+
return tokens;
|
|
256
|
+
tokens.push(token);
|
|
257
|
+
pos += token.width;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
function processTokens(tokens, mapText) {
|
|
261
|
+
if (!tokens.filter((token) => token.type !== "content").length) {
|
|
262
|
+
return tokens.map((token) => mapText(token.value));
|
|
263
|
+
}
|
|
264
|
+
return tokens.map((token) => {
|
|
265
|
+
var _a;
|
|
266
|
+
if (token.type === "content") {
|
|
267
|
+
return mapText(token.value);
|
|
268
|
+
} else if (token.type === "octothorpe") {
|
|
269
|
+
return "#";
|
|
270
|
+
} else if (token.type === "argument") {
|
|
271
|
+
return [token.arg];
|
|
272
|
+
} else if (token.type === "function") {
|
|
273
|
+
const _param = (_a = token == null ? void 0 : token.param) == null ? void 0 : _a[0];
|
|
274
|
+
if (token.key === "date" && _param) {
|
|
275
|
+
const opts = compileDateExpression(_param.value.trim(), (e) => {
|
|
276
|
+
throw new Error(`Unable to compile date expression: ${e.message}`);
|
|
277
|
+
});
|
|
278
|
+
return [token.arg, token.key, opts];
|
|
279
|
+
}
|
|
280
|
+
if (_param) {
|
|
281
|
+
return [token.arg, token.key, _param.value.trim()];
|
|
282
|
+
} else {
|
|
283
|
+
return [token.arg, token.key];
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const offset = token.pluralOffset;
|
|
287
|
+
const formatProps = {};
|
|
288
|
+
token.cases.forEach(({ key, tokens: tokens2 }) => {
|
|
289
|
+
const prop = key[0] === "=" ? key.slice(1) : key;
|
|
290
|
+
formatProps[prop] = processTokens(tokens2, mapText);
|
|
291
|
+
});
|
|
292
|
+
return [
|
|
293
|
+
token.arg,
|
|
294
|
+
token.type,
|
|
295
|
+
{
|
|
296
|
+
offset,
|
|
297
|
+
...formatProps
|
|
298
|
+
}
|
|
299
|
+
];
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
function compileDateExpression(format, onError) {
|
|
303
|
+
if (/^::/.test(format)) {
|
|
304
|
+
const tokens = parseDateTokens(format.substring(2));
|
|
305
|
+
return getDateFormatOptions(tokens, void 0, onError);
|
|
306
|
+
}
|
|
307
|
+
return format;
|
|
308
|
+
}
|
|
309
|
+
function compileMessageOrThrow(message, mapText = (v) => v) {
|
|
310
|
+
return processTokens(parserExports.parse(message), mapText);
|
|
311
|
+
}
|
|
312
|
+
function compileMessage(message, mapText = (v) => v) {
|
|
313
|
+
try {
|
|
314
|
+
return compileMessageOrThrow(message, mapText);
|
|
315
|
+
} catch (e) {
|
|
316
|
+
console.error(`${e.message}
|
|
317
|
+
|
|
318
|
+
Message: ${message}`);
|
|
319
|
+
return [message];
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
export {
|
|
323
|
+
compileMessage,
|
|
324
|
+
compileMessageOrThrow
|
|
325
|
+
};
|
|
326
|
+
//# sourceMappingURL=compileMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compileMessage.js","sources":["../../../../../node_modules/@lingui/message-utils/dist/compileMessage.mjs"],"sourcesContent":["import { parse } from '@messageformat/parser';\n\n/**\n * Parent class for errors.\n *\n * @remarks\n * Errors with `type: \"warning\"` do not necessarily indicate that the parser\n * encountered an error. In addition to a human-friendly `message`, may also\n * includes the `token` at which the error was encountered.\n *\n * @public\n */\nclass DateFormatError extends Error {\n /** @internal */\n constructor(msg, token, type) {\n super(msg);\n this.token = token;\n this.type = type || 'error';\n }\n}\nconst alpha = (width) => width < 4 ? 'short' : width === 4 ? 'long' : 'narrow';\nconst numeric = (width) => (width % 2 === 0 ? '2-digit' : 'numeric');\nfunction yearOptions(token, onError) {\n switch (token.char) {\n case 'y':\n return { year: numeric(token.width) };\n case 'r':\n return { calendar: 'gregory', year: 'numeric' };\n case 'u':\n case 'U':\n case 'Y':\n default:\n onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING);\n return { year: 'numeric' };\n }\n}\nfunction monthStyle(token, onError) {\n switch (token.width) {\n case 1:\n return 'numeric';\n case 2:\n return '2-digit';\n case 3:\n return 'short';\n case 4:\n return 'long';\n case 5:\n return 'narrow';\n default:\n onError(`${token.desc} is not supported with width ${token.width}`);\n return undefined;\n }\n}\nfunction dayStyle(token, onError) {\n const { char, desc, width } = token;\n if (char === 'd') {\n return numeric(width);\n }\n else {\n onError(`${desc} is not supported`);\n return undefined;\n }\n}\nfunction weekdayStyle(token, onError) {\n const { char, desc, width } = token;\n if ((char === 'c' || char === 'e') && width < 3) {\n // ignoring stand-alone-ness\n const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`;\n onError(msg, DateFormatError.WARNING);\n }\n // merging narrow styles\n return alpha(width);\n}\nfunction hourOptions(token) {\n const hour = numeric(token.width);\n let hourCycle;\n switch (token.char) {\n case 'h':\n hourCycle = 'h12';\n break;\n case 'H':\n hourCycle = 'h23';\n break;\n case 'k':\n hourCycle = 'h24';\n break;\n case 'K':\n hourCycle = 'h11';\n break;\n }\n return hourCycle ? { hour, hourCycle } : { hour };\n}\nfunction timeZoneNameStyle(token, onError) {\n // so much fallback behaviour here\n const { char, desc, width } = token;\n switch (char) {\n case 'v':\n case 'z':\n return width === 4 ? 'long' : 'short';\n case 'V':\n if (width === 4)\n return 'long';\n onError(`${desc} is not supported with width ${width}`);\n return undefined;\n case 'X':\n onError(`${desc} is not supported`);\n return undefined;\n }\n return 'short';\n}\nfunction compileOptions(token, onError) {\n switch (token.field) {\n case 'era':\n return { era: alpha(token.width) };\n case 'year':\n return yearOptions(token, onError);\n case 'month':\n return { month: monthStyle(token, onError) };\n case 'day':\n return { day: dayStyle(token, onError) };\n case 'weekday':\n return { weekday: weekdayStyle(token, onError) };\n case 'period':\n return undefined;\n case 'hour':\n return hourOptions(token);\n case 'min':\n return { minute: numeric(token.width) };\n case 'sec':\n return { second: numeric(token.width) };\n case 'tz':\n return { timeZoneName: timeZoneNameStyle(token, onError) };\n case 'quarter':\n case 'week':\n case 'sec-frac':\n case 'ms':\n onError(`${token.desc} is not supported`);\n }\n return undefined;\n}\nfunction getDateFormatOptions(tokens, timeZone, onError = error => {\n throw error;\n}) {\n const options = {\n timeZone\n };\n const fields = [];\n for (const token of tokens) {\n const { error, field, str } = token;\n if (error) {\n const dte = new DateFormatError(error.message, token);\n dte.stack = error.stack;\n onError(dte);\n }\n if (str) {\n const msg = `Ignoring string part: ${str}`;\n onError(new DateFormatError(msg, token, DateFormatError.WARNING));\n }\n if (field) {\n if (fields.indexOf(field) === -1)\n fields.push(field);\n else\n onError(new DateFormatError(`Duplicate ${field} token`, token));\n }\n const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning)));\n if (opt)\n Object.assign(options, opt);\n }\n return options;\n}\n\nconst fields = {\n G: { field: 'era', desc: 'Era' },\n y: { field: 'year', desc: 'Year' },\n Y: { field: 'year', desc: 'Year of \"Week of Year\"' },\n u: { field: 'year', desc: 'Extended year' },\n U: { field: 'year', desc: 'Cyclic year name' },\n r: { field: 'year', desc: 'Related Gregorian year' },\n Q: { field: 'quarter', desc: 'Quarter' },\n q: { field: 'quarter', desc: 'Stand-alone quarter' },\n M: { field: 'month', desc: 'Month in year' },\n L: { field: 'month', desc: 'Stand-alone month in year' },\n w: { field: 'week', desc: 'Week of year' },\n W: { field: 'week', desc: 'Week of month' },\n d: { field: 'day', desc: 'Day in month' },\n D: { field: 'day', desc: 'Day of year' },\n F: { field: 'day', desc: 'Day of week in month' },\n g: { field: 'day', desc: 'Modified julian day' },\n E: { field: 'weekday', desc: 'Day of week' },\n e: { field: 'weekday', desc: 'Local day of week' },\n c: { field: 'weekday', desc: 'Stand-alone local day of week' },\n a: { field: 'period', desc: 'AM/PM marker' },\n b: { field: 'period', desc: 'AM/PM/noon/midnight marker' },\n B: { field: 'period', desc: 'Flexible day period' },\n h: { field: 'hour', desc: 'Hour in AM/PM (1~12)' },\n H: { field: 'hour', desc: 'Hour in day (0~23)' },\n k: { field: 'hour', desc: 'Hour in day (1~24)' },\n K: { field: 'hour', desc: 'Hour in AM/PM (0~11)' },\n j: { field: 'hour', desc: 'Hour in preferred cycle' },\n J: { field: 'hour', desc: 'Hour in preferred cycle without marker' },\n C: { field: 'hour', desc: 'Hour in preferred cycle with flexible marker' },\n m: { field: 'min', desc: 'Minute in hour' },\n s: { field: 'sec', desc: 'Second in minute' },\n S: { field: 'sec-frac', desc: 'Fractional second' },\n A: { field: 'ms', desc: 'Milliseconds in day' },\n z: { field: 'tz', desc: 'Time Zone: specific non-location' },\n Z: { field: 'tz', desc: 'Time Zone' },\n O: { field: 'tz', desc: 'Time Zone: localized' },\n v: { field: 'tz', desc: 'Time Zone: generic non-location' },\n V: { field: 'tz', desc: 'Time Zone: ID' },\n X: { field: 'tz', desc: 'Time Zone: ISO8601 with Z' },\n x: { field: 'tz', desc: 'Time Zone: ISO8601' }\n};\nconst isLetter = (char) => (char >= 'A' && char <= 'Z') || (char >= 'a' && char <= 'z');\nfunction readFieldToken(src, pos) {\n const char = src[pos];\n let width = 1;\n while (src[++pos] === char)\n ++width;\n const field = fields[char];\n if (!field) {\n const msg = `The letter ${char} is not a valid field identifier`;\n return { char, error: new Error(msg), width };\n }\n return { char, field: field.field, desc: field.desc, width };\n}\nfunction readQuotedToken(src, pos) {\n let str = src[++pos];\n let width = 2;\n if (str === \"'\")\n return { char: \"'\", str, width };\n while (true) {\n const next = src[++pos];\n ++width;\n if (next === undefined) {\n const msg = `Unterminated quoted literal in pattern: ${str || src}`;\n return { char: \"'\", error: new Error(msg), str, width };\n }\n else if (next === \"'\") {\n if (src[++pos] !== \"'\")\n return { char: \"'\", str, width };\n else\n ++width;\n }\n str += next;\n }\n}\nfunction readToken(src, pos) {\n const char = src[pos];\n if (!char)\n return null;\n if (isLetter(char))\n return readFieldToken(src, pos);\n if (char === \"'\")\n return readQuotedToken(src, pos);\n let str = char;\n let width = 1;\n while (true) {\n const next = src[++pos];\n if (!next || isLetter(next) || next === \"'\")\n return { char, str, width };\n str += next;\n width += 1;\n }\n}\n/**\n * Parse an {@link http://userguide.icu-project.org/formatparse/datetime | ICU\n * DateFormat skeleton} string into a {@link DateToken} array.\n *\n * @remarks\n * Errors will not be thrown, but if encountered are included as the relevant\n * token's `error` value.\n *\n * @public\n * @param src - The skeleton string\n *\n * @example\n * ```js\n * import { parseDateTokens } from '@messageformat/date-skeleton'\n *\n * parseDateTokens('GrMMMdd', console.error)\n * // [\n * // { char: 'G', field: 'era', desc: 'Era', width: 1 },\n * // { char: 'r', field: 'year', desc: 'Related Gregorian year', width: 1 },\n * // { char: 'M', field: 'month', desc: 'Month in year', width: 3 },\n * // { char: 'd', field: 'day', desc: 'Day in month', width: 2 }\n * // ]\n * ```\n */\nfunction parseDateTokens(src) {\n const tokens = [];\n let pos = 0;\n while (true) {\n const token = readToken(src, pos);\n if (!token)\n return tokens;\n tokens.push(token);\n pos += token.width;\n }\n}\n\nfunction processTokens(tokens, mapText) {\n if (!tokens.filter((token) => token.type !== \"content\").length) {\n return tokens.map((token) => mapText(token.value));\n }\n return tokens.map((token) => {\n if (token.type === \"content\") {\n return mapText(token.value);\n } else if (token.type === \"octothorpe\") {\n return \"#\";\n } else if (token.type === \"argument\") {\n return [token.arg];\n } else if (token.type === \"function\") {\n const _param = token?.param?.[0];\n if (token.key === \"date\" && _param) {\n const opts = compileDateExpression(_param.value.trim(), (e) => {\n throw new Error(`Unable to compile date expression: ${e.message}`);\n });\n return [token.arg, token.key, opts];\n }\n if (_param) {\n return [token.arg, token.key, _param.value.trim()];\n } else {\n return [token.arg, token.key];\n }\n }\n const offset = token.pluralOffset;\n const formatProps = {};\n token.cases.forEach(({ key, tokens: tokens2 }) => {\n const prop = key[0] === \"=\" ? key.slice(1) : key;\n formatProps[prop] = processTokens(tokens2, mapText);\n });\n return [\n token.arg,\n token.type,\n {\n offset,\n ...formatProps\n }\n ];\n });\n}\nfunction compileDateExpression(format, onError) {\n if (/^::/.test(format)) {\n const tokens = parseDateTokens(format.substring(2));\n return getDateFormatOptions(tokens, void 0, onError);\n }\n return format;\n}\nfunction compileMessageOrThrow(message, mapText = (v) => v) {\n return processTokens(parse(message), mapText);\n}\nfunction compileMessage(message, mapText = (v) => v) {\n try {\n return compileMessageOrThrow(message, mapText);\n } catch (e) {\n console.error(`${e.message} \n\nMessage: ${message}`);\n return [message];\n }\n}\n\nexport { compileMessage, compileMessageOrThrow };\n"],"names":["fields","parse"],"mappings":";AAYA,MAAM,wBAAwB,MAAM;AAAA;AAAA,EAEhC,YAAY,KAAK,OAAO,MAAM;AAC1B,UAAM,GAAG;AACT,SAAK,QAAQ;AACb,SAAK,OAAO,QAAQ;AAAA,EAC5B;AACA;AACA,MAAM,QAAQ,CAAC,UAAU,QAAQ,IAAI,UAAU,UAAU,IAAI,SAAS;AACtE,MAAM,UAAU,CAAC,UAAW,QAAQ,MAAM,IAAI,YAAY;AAC1D,SAAS,YAAY,OAAO,SAAS;AACjC,UAAQ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@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { getLineHeight, getFontSize } from "../../core/utils/get-size/get-size.js";
|
|
4
|
+
import { createVarsResolver } from "../../core/styles-api/create-vars-resolver/create-vars-resolver.js";
|
|
5
|
+
import { getThemeColor } from "../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.js";
|
|
6
|
+
import { getGradient } from "../../core/MantineProvider/color-functions/get-gradient/get-gradient.js";
|
|
7
|
+
import { useProps } from "../../core/MantineProvider/use-props/use-props.js";
|
|
8
|
+
import { useStyles } from "../../core/styles-api/use-styles/use-styles.js";
|
|
9
|
+
import { Box } from "../../core/Box/Box.js";
|
|
10
|
+
import { polymorphicFactory } from "../../core/factory/polymorphic-factory.js";
|
|
11
|
+
import __default__ from "./Text.module.css.js";
|
|
12
|
+
function getTextTruncate(truncate) {
|
|
13
|
+
if (truncate === "start") {
|
|
14
|
+
return "start";
|
|
15
|
+
}
|
|
16
|
+
if (truncate === "end" || truncate) {
|
|
17
|
+
return "end";
|
|
18
|
+
}
|
|
19
|
+
return void 0;
|
|
20
|
+
}
|
|
21
|
+
const defaultProps = {
|
|
22
|
+
inherit: false
|
|
23
|
+
};
|
|
24
|
+
const varsResolver = createVarsResolver(
|
|
25
|
+
(theme, { variant, lineClamp, gradient, size, color }) => ({
|
|
26
|
+
root: {
|
|
27
|
+
"--text-fz": getFontSize(size),
|
|
28
|
+
"--text-lh": getLineHeight(size),
|
|
29
|
+
"--text-gradient": variant === "gradient" ? getGradient(gradient, theme) : void 0,
|
|
30
|
+
"--text-line-clamp": typeof lineClamp === "number" ? lineClamp.toString() : void 0,
|
|
31
|
+
"--text-color": color ? getThemeColor(color, theme) : void 0
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
);
|
|
35
|
+
const Text = polymorphicFactory((_props, ref) => {
|
|
36
|
+
const props = useProps("Text", defaultProps, _props);
|
|
37
|
+
const {
|
|
38
|
+
lineClamp,
|
|
39
|
+
truncate,
|
|
40
|
+
inline,
|
|
41
|
+
inherit,
|
|
42
|
+
gradient,
|
|
43
|
+
span,
|
|
44
|
+
__staticSelector,
|
|
45
|
+
vars,
|
|
46
|
+
className,
|
|
47
|
+
style,
|
|
48
|
+
classNames,
|
|
49
|
+
styles,
|
|
50
|
+
unstyled,
|
|
51
|
+
variant,
|
|
52
|
+
mod,
|
|
53
|
+
size,
|
|
54
|
+
...others
|
|
55
|
+
} = props;
|
|
56
|
+
const getStyles = useStyles({
|
|
57
|
+
name: ["Text", __staticSelector],
|
|
58
|
+
props,
|
|
59
|
+
classes: __default__,
|
|
60
|
+
className,
|
|
61
|
+
style,
|
|
62
|
+
classNames,
|
|
63
|
+
styles,
|
|
64
|
+
unstyled,
|
|
65
|
+
vars,
|
|
66
|
+
varsResolver
|
|
67
|
+
});
|
|
68
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
69
|
+
Box,
|
|
70
|
+
{
|
|
71
|
+
...getStyles("root", { focusable: true }),
|
|
72
|
+
ref,
|
|
73
|
+
component: span ? "span" : "p",
|
|
74
|
+
variant,
|
|
75
|
+
mod: [
|
|
76
|
+
{
|
|
77
|
+
"data-truncate": getTextTruncate(truncate),
|
|
78
|
+
"data-line-clamp": typeof lineClamp === "number",
|
|
79
|
+
"data-inline": inline,
|
|
80
|
+
"data-inherit": inherit
|
|
81
|
+
},
|
|
82
|
+
mod
|
|
83
|
+
],
|
|
84
|
+
size,
|
|
85
|
+
...others
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
});
|
|
89
|
+
Text.classes = __default__;
|
|
90
|
+
Text.displayName = "@mantine/core/Text";
|
|
91
|
+
export {
|
|
92
|
+
Text
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.js","sources":["../../../../../../../node_modules/@mantine/core/esm/components/Text/Text.mjs"],"sourcesContent":["'use client';\nimport { jsx } from 'react/jsx-runtime';\nimport 'react';\nimport { getFontSize, getLineHeight } from '../../core/utils/get-size/get-size.mjs';\nimport '@mantine/hooks';\nimport { createVarsResolver } from '../../core/styles-api/create-vars-resolver/create-vars-resolver.mjs';\nimport 'clsx';\nimport { getThemeColor } from '../../core/MantineProvider/color-functions/get-theme-color/get-theme-color.mjs';\nimport { getGradient } from '../../core/MantineProvider/color-functions/get-gradient/get-gradient.mjs';\nimport '../../core/MantineProvider/Mantine.context.mjs';\nimport '../../core/MantineProvider/default-theme.mjs';\nimport '../../core/MantineProvider/MantineProvider.mjs';\nimport '../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs';\nimport { useProps } from '../../core/MantineProvider/use-props/use-props.mjs';\nimport '../../core/MantineProvider/MantineCssVariables/MantineCssVariables.mjs';\nimport { useStyles } from '../../core/styles-api/use-styles/use-styles.mjs';\nimport { Box } from '../../core/Box/Box.mjs';\nimport { polymorphicFactory } from '../../core/factory/polymorphic-factory.mjs';\nimport '../../core/DirectionProvider/DirectionProvider.mjs';\nimport classes from './Text.module.css.mjs';\n\nfunction getTextTruncate(truncate) {\n if (truncate === \"start\") {\n return \"start\";\n }\n if (truncate === \"end\" || truncate) {\n return \"end\";\n }\n return void 0;\n}\nconst defaultProps = {\n inherit: false\n};\nconst varsResolver = createVarsResolver(\n (theme, { variant, lineClamp, gradient, size, color }) => ({\n root: {\n \"--text-fz\": getFontSize(size),\n \"--text-lh\": getLineHeight(size),\n \"--text-gradient\": variant === \"gradient\" ? getGradient(gradient, theme) : void 0,\n \"--text-line-clamp\": typeof lineClamp === \"number\" ? lineClamp.toString() : void 0,\n \"--text-color\": color ? getThemeColor(color, theme) : void 0\n }\n })\n);\nconst Text = polymorphicFactory((_props, ref) => {\n const props = useProps(\"Text\", defaultProps, _props);\n const {\n lineClamp,\n truncate,\n inline,\n inherit,\n gradient,\n span,\n __staticSelector,\n vars,\n className,\n style,\n classNames,\n styles,\n unstyled,\n variant,\n mod,\n size,\n ...others\n } = props;\n const getStyles = useStyles({\n name: [\"Text\", __staticSelector],\n props,\n classes,\n className,\n style,\n classNames,\n styles,\n unstyled,\n vars,\n varsResolver\n });\n return /* @__PURE__ */ jsx(\n Box,\n {\n ...getStyles(\"root\", { focusable: true }),\n ref,\n component: span ? \"span\" : \"p\",\n variant,\n mod: [\n {\n \"data-truncate\": getTextTruncate(truncate),\n \"data-line-clamp\": typeof lineClamp === \"number\",\n \"data-inline\": inline,\n \"data-inherit\": inherit\n },\n mod\n ],\n size,\n ...others\n }\n );\n});\nText.classes = classes;\nText.displayName = \"@mantine/core/Text\";\n\nexport { Text };\n//# sourceMappingURL=Text.mjs.map\n"],"names":["classes","jsx"],"mappings":";;;;;;;;;;;AAqBA,SAAS,gBAAgB,UAAU;AACjC,MAAI,aAAa,SAAS;AACxB,WAAO;AAAA,EACX;AACE,MAAI,aAAa,SAAS,UAAU;AAClC,WAAO;AAAA,EACX;AACE,SAAO;AACT;AACA,MAAM,eAAe;AAAA,EACnB,SAAS;AACX;AACA,MAAM,eAAe;AAAA,EACnB,CAAC,OAAO,EAAE,SAAS,WAAW,UAAU,MAAM,aAAa;AAAA,IACzD,MAAM;AAAA,MACJ,aAAa,YAAY,IAAI;AAAA,MAC7B,aAAa,cAAc,IAAI;AAAA,MAC/B,mBAAmB,YAAY,aAAa,YAAY,UAAU,KAAK,IAAI;AAAA,MAC3E,qBAAqB,OAAO,cAAc,WAAW,UAAU,SAAU,IAAG;AAAA,MAC5E,gBAAgB,QAAQ,cAAc,OAAO,KAAK,IAAI;AAAA,IAC5D;AAAA,EACG;AACH;AACK,MAAC,OAAO,mBAAmB,CAAC,QAAQ,QAAQ;AAC/C,QAAM,QAAQ,SAAS,QAAQ,cAAc,MAAM;AACnD,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAM;AACJ,QAAM,YAAY,UAAU;AAAA,IAC1B,MAAM,CAAC,QAAQ,gBAAgB;AAAA,IAC/B;AAAA,IACJ,SAAIA;AAAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG;AACD,SAAuBC,kCAAG;AAAA,IACxB;AAAA,IACA;AAAA,MACE,GAAG,UAAU,QAAQ,EAAE,WAAW,KAAI,CAAE;AAAA,MACxC;AAAA,MACA,WAAW,OAAO,SAAS;AAAA,MAC3B;AAAA,MACA,KAAK;AAAA,QACH;AAAA,UACE,iBAAiB,gBAAgB,QAAQ;AAAA,UACzC,mBAAmB,OAAO,cAAc;AAAA,UACxC,eAAe;AAAA,UACf,gBAAgB;AAAA,QACjB;AAAA,QACD;AAAA,MACD;AAAA,MACD;AAAA,MACA,GAAG;AAAA,IACT;AAAA,EACG;AACH,CAAC;AACD,KAAK,UAAUD;AACf,KAAK,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.module.css.mjs.vanilla.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../../../../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { clsx } from "../../../../../clsx/dist/clsx.js";
|
|
4
|
+
import { createPolymorphicComponent } from "../factory/create-polymorphic-component.js";
|
|
5
|
+
import { InlineStyles } from "../InlineStyles/InlineStyles.js";
|
|
6
|
+
import { isNumberLike } from "../utils/is-number-like/is-number-like.js";
|
|
7
|
+
import { useMantineSxTransform } from "../MantineProvider/Mantine.context.js";
|
|
8
|
+
import { useMantineTheme } from "../MantineProvider/MantineThemeProvider/MantineThemeProvider.js";
|
|
9
|
+
import { getBoxMod } from "./get-box-mod/get-box-mod.js";
|
|
10
|
+
import { getBoxStyle } from "./get-box-style/get-box-style.js";
|
|
11
|
+
import { extractStyleProps } from "./style-props/extract-style-props/extract-style-props.js";
|
|
12
|
+
import { STYlE_PROPS_DATA } from "./style-props/style-props-data.js";
|
|
13
|
+
import { parseStyleProps } from "./style-props/parse-style-props/parse-style-props.js";
|
|
14
|
+
import { useRandomClassName } from "./use-random-classname/use-random-classname.js";
|
|
15
|
+
const _Box = forwardRef(
|
|
16
|
+
({
|
|
17
|
+
component,
|
|
18
|
+
style,
|
|
19
|
+
__vars,
|
|
20
|
+
className,
|
|
21
|
+
variant,
|
|
22
|
+
mod,
|
|
23
|
+
size,
|
|
24
|
+
hiddenFrom,
|
|
25
|
+
visibleFrom,
|
|
26
|
+
lightHidden,
|
|
27
|
+
darkHidden,
|
|
28
|
+
renderRoot,
|
|
29
|
+
__size,
|
|
30
|
+
...others
|
|
31
|
+
}, ref) => {
|
|
32
|
+
var _a;
|
|
33
|
+
const theme = useMantineTheme();
|
|
34
|
+
const Element = component || "div";
|
|
35
|
+
const { styleProps, rest } = extractStyleProps(others);
|
|
36
|
+
const useSxTransform = useMantineSxTransform();
|
|
37
|
+
const transformedSx = (_a = useSxTransform == null ? void 0 : useSxTransform()) == null ? void 0 : _a(styleProps.sx);
|
|
38
|
+
const responsiveClassName = useRandomClassName();
|
|
39
|
+
const parsedStyleProps = parseStyleProps({
|
|
40
|
+
styleProps,
|
|
41
|
+
theme,
|
|
42
|
+
data: STYlE_PROPS_DATA
|
|
43
|
+
});
|
|
44
|
+
const props = {
|
|
45
|
+
ref,
|
|
46
|
+
style: getBoxStyle({
|
|
47
|
+
theme,
|
|
48
|
+
style,
|
|
49
|
+
vars: __vars,
|
|
50
|
+
styleProps: parsedStyleProps.inlineStyles
|
|
51
|
+
}),
|
|
52
|
+
className: clsx(className, transformedSx, {
|
|
53
|
+
[responsiveClassName]: parsedStyleProps.hasResponsiveStyles,
|
|
54
|
+
"mantine-light-hidden": lightHidden,
|
|
55
|
+
"mantine-dark-hidden": darkHidden,
|
|
56
|
+
[`mantine-hidden-from-${hiddenFrom}`]: hiddenFrom,
|
|
57
|
+
[`mantine-visible-from-${visibleFrom}`]: visibleFrom
|
|
58
|
+
}),
|
|
59
|
+
"data-variant": variant,
|
|
60
|
+
"data-size": isNumberLike(size) ? void 0 : size || void 0,
|
|
61
|
+
size: __size,
|
|
62
|
+
...getBoxMod(mod),
|
|
63
|
+
...rest
|
|
64
|
+
};
|
|
65
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
66
|
+
parsedStyleProps.hasResponsiveStyles && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
67
|
+
InlineStyles,
|
|
68
|
+
{
|
|
69
|
+
selector: `.${responsiveClassName}`,
|
|
70
|
+
styles: parsedStyleProps.styles,
|
|
71
|
+
media: parsedStyleProps.media
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
typeof renderRoot === "function" ? renderRoot(props) : /* @__PURE__ */ jsxRuntimeExports.jsx(Element, { ...props })
|
|
75
|
+
] });
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
_Box.displayName = "@mantine/core/Box";
|
|
79
|
+
const Box = createPolymorphicComponent(_Box);
|
|
80
|
+
export {
|
|
81
|
+
Box
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=Box.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Box.js","sources":["../../../../../../../node_modules/@mantine/core/esm/core/Box/Box.mjs"],"sourcesContent":["'use client';\nimport { jsxs, Fragment, jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\nimport cx from 'clsx';\nimport { createPolymorphicComponent } from '../factory/create-polymorphic-component.mjs';\nimport { InlineStyles } from '../InlineStyles/InlineStyles.mjs';\nimport { isNumberLike } from '../utils/is-number-like/is-number-like.mjs';\nimport '@mantine/hooks';\nimport { useMantineSxTransform } from '../MantineProvider/Mantine.context.mjs';\nimport '../MantineProvider/default-theme.mjs';\nimport '../MantineProvider/MantineProvider.mjs';\nimport { useMantineTheme } from '../MantineProvider/MantineThemeProvider/MantineThemeProvider.mjs';\nimport '../MantineProvider/MantineCssVariables/MantineCssVariables.mjs';\nimport { getBoxMod } from './get-box-mod/get-box-mod.mjs';\nimport { getBoxStyle } from './get-box-style/get-box-style.mjs';\nimport { extractStyleProps } from './style-props/extract-style-props/extract-style-props.mjs';\nimport { STYlE_PROPS_DATA } from './style-props/style-props-data.mjs';\nimport { parseStyleProps } from './style-props/parse-style-props/parse-style-props.mjs';\nimport { useRandomClassName } from './use-random-classname/use-random-classname.mjs';\n\nconst _Box = forwardRef(\n ({\n component,\n style,\n __vars,\n className,\n variant,\n mod,\n size,\n hiddenFrom,\n visibleFrom,\n lightHidden,\n darkHidden,\n renderRoot,\n __size,\n ...others\n }, ref) => {\n const theme = useMantineTheme();\n const Element = component || \"div\";\n const { styleProps, rest } = extractStyleProps(others);\n const useSxTransform = useMantineSxTransform();\n const transformedSx = useSxTransform?.()?.(styleProps.sx);\n const responsiveClassName = useRandomClassName();\n const parsedStyleProps = parseStyleProps({\n styleProps,\n theme,\n data: STYlE_PROPS_DATA\n });\n const props = {\n ref,\n style: getBoxStyle({\n theme,\n style,\n vars: __vars,\n styleProps: parsedStyleProps.inlineStyles\n }),\n className: cx(className, transformedSx, {\n [responsiveClassName]: parsedStyleProps.hasResponsiveStyles,\n \"mantine-light-hidden\": lightHidden,\n \"mantine-dark-hidden\": darkHidden,\n [`mantine-hidden-from-${hiddenFrom}`]: hiddenFrom,\n [`mantine-visible-from-${visibleFrom}`]: visibleFrom\n }),\n \"data-variant\": variant,\n \"data-size\": isNumberLike(size) ? void 0 : size || void 0,\n size: __size,\n ...getBoxMod(mod),\n ...rest\n };\n return /* @__PURE__ */ jsxs(Fragment, { children: [\n parsedStyleProps.hasResponsiveStyles && /* @__PURE__ */ jsx(\n InlineStyles,\n {\n selector: `.${responsiveClassName}`,\n styles: parsedStyleProps.styles,\n media: parsedStyleProps.media\n }\n ),\n typeof renderRoot === \"function\" ? renderRoot(props) : /* @__PURE__ */ jsx(Element, { ...props })\n ] });\n }\n);\n_Box.displayName = \"@mantine/core/Box\";\nconst Box = createPolymorphicComponent(_Box);\n\nexport { Box };\n//# sourceMappingURL=Box.mjs.map\n"],"names":["cx","jsxs","Fragment","jsx"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAM,OAAO;AAAA,EACX,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACJ,GAAE,QAAQ;;AACT,UAAM,QAAQ,gBAAiB;AAC/B,UAAM,UAAU,aAAa;AAC7B,UAAM,EAAE,YAAY,SAAS,kBAAkB,MAAM;AACrD,UAAM,iBAAiB,sBAAuB;AAC9C,UAAM,iBAAgB,+EAAqB,WAAW;AACtD,UAAM,sBAAsB,mBAAoB;AAChD,UAAM,mBAAmB,gBAAgB;AAAA,MACvC;AAAA,MACA;AAAA,MACA,MAAM;AAAA,IACZ,CAAK;AACD,UAAM,QAAQ;AAAA,MACZ;AAAA,MACA,OAAO,YAAY;AAAA,QACjB;AAAA,QACA;AAAA,QACA,MAAM;AAAA,QACN,YAAY,iBAAiB;AAAA,MACrC,CAAO;AAAA,MACD,WAAWA,KAAG,WAAW,eAAe;AAAA,QACtC,CAAC,mBAAmB,GAAG,iBAAiB;AAAA,QACxC,wBAAwB;AAAA,QACxB,uBAAuB;AAAA,QACvB,CAAC,uBAAuB,UAAU,EAAE,GAAG;AAAA,QACvC,CAAC,wBAAwB,WAAW,EAAE,GAAG;AAAA,MACjD,CAAO;AAAA,MACD,gBAAgB;AAAA,MAChB,aAAa,aAAa,IAAI,IAAI,SAAS,QAAQ;AAAA,MACnD,MAAM;AAAA,MACN,GAAG,UAAU,GAAG;AAAA,MAChB,GAAG;AAAA,IACJ;AACD,WAAuBC,kCAAI,KAACC,4BAAU,EAAE,UAAU;AAAA,MAChD,iBAAiB,uBAAuCC,kCAAG;AAAA,QACzD;AAAA,QACA;AAAA,UACE,UAAU,IAAI,mBAAmB;AAAA,UACjC,QAAQ,iBAAiB;AAAA,UACzB,OAAO,iBAAiB;AAAA,QAClC;AAAA,MACO;AAAA,MACD,OAAO,eAAe,aAAa,WAAW,KAAK,IAAoBA,sCAAI,SAAS,EAAE,GAAG,MAAO,CAAA;AAAA,IACtG,GAAO;AAAA,EACP;AACA;AACA,KAAK,cAAc;AACd,MAAC,MAAM,2BAA2B,IAAI;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function transformModKey(key) {
|
|
2
|
+
return key.startsWith("data-") ? key : `data-${key}`;
|
|
3
|
+
}
|
|
4
|
+
function getMod(props) {
|
|
5
|
+
return Object.keys(props).reduce((acc, key) => {
|
|
6
|
+
const value = props[key];
|
|
7
|
+
if (value === void 0 || value === "" || value === false || value === null) {
|
|
8
|
+
return acc;
|
|
9
|
+
}
|
|
10
|
+
acc[transformModKey(key)] = props[key];
|
|
11
|
+
return acc;
|
|
12
|
+
}, {});
|
|
13
|
+
}
|
|
14
|
+
function getBoxMod(mod) {
|
|
15
|
+
if (!mod) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
if (typeof mod === "string") {
|
|
19
|
+
return { [transformModKey(mod)]: true };
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(mod)) {
|
|
22
|
+
return [...mod].reduce(
|
|
23
|
+
(acc, value) => ({ ...acc, ...getBoxMod(value) }),
|
|
24
|
+
{}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
return getMod(mod);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
getBoxMod,
|
|
31
|
+
getMod
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=get-box-mod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-box-mod.js","sources":["../../../../../../../../node_modules/@mantine/core/esm/core/Box/get-box-mod/get-box-mod.mjs"],"sourcesContent":["'use client';\nfunction transformModKey(key) {\n return key.startsWith(\"data-\") ? key : `data-${key}`;\n}\nfunction getMod(props) {\n return Object.keys(props).reduce((acc, key) => {\n const value = props[key];\n if (value === void 0 || value === \"\" || value === false || value === null) {\n return acc;\n }\n acc[transformModKey(key)] = props[key];\n return acc;\n }, {});\n}\nfunction getBoxMod(mod) {\n if (!mod) {\n return null;\n }\n if (typeof mod === \"string\") {\n return { [transformModKey(mod)]: true };\n }\n if (Array.isArray(mod)) {\n return [...mod].reduce(\n (acc, value) => ({ ...acc, ...getBoxMod(value) }),\n {}\n );\n }\n return getMod(mod);\n}\n\nexport { getBoxMod, getMod };\n//# sourceMappingURL=get-box-mod.mjs.map\n"],"names":[],"mappings":"AACA,SAAS,gBAAgB,KAAK;AAC5B,SAAO,IAAI,WAAW,OAAO,IAAI,MAAM,QAAQ,GAAG;AACpD;AACA,SAAS,OAAO,OAAO;AACrB,SAAO,OAAO,KAAK,KAAK,EAAE,OAAO,CAAC,KAAK,QAAQ;AAC7C,UAAM,QAAQ,MAAM,GAAG;AACvB,QAAI,UAAU,UAAU,UAAU,MAAM,UAAU,SAAS,UAAU,MAAM;AACzE,aAAO;AAAA,IACb;AACI,QAAI,gBAAgB,GAAG,CAAC,IAAI,MAAM,GAAG;AACrC,WAAO;AAAA,EACR,GAAE,EAAE;AACP;AACA,SAAS,UAAU,KAAK;AACtB,MAAI,CAAC,KAAK;AACR,WAAO;AAAA,EACX;AACE,MAAI,OAAO,QAAQ,UAAU;AAC3B,WAAO,EAAE,CAAC,gBAAgB,GAAG,CAAC,GAAG,KAAM;AAAA,EAC3C;AACE,MAAI,MAAM,QAAQ,GAAG,GAAG;AACtB,WAAO,CAAC,GAAG,GAAG,EAAE;AAAA,MACd,CAAC,KAAK,WAAW,EAAE,GAAG,KAAK,GAAG,UAAU,KAAK;MAC7C,CAAA;AAAA,IACD;AAAA,EACL;AACE,SAAO,OAAO,GAAG;AACnB;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function mergeStyles(styles, theme) {
|
|
2
|
+
if (Array.isArray(styles)) {
|
|
3
|
+
return [...styles].reduce(
|
|
4
|
+
(acc, item) => ({ ...acc, ...mergeStyles(item, theme) }),
|
|
5
|
+
{}
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
if (typeof styles === "function") {
|
|
9
|
+
return styles(theme);
|
|
10
|
+
}
|
|
11
|
+
if (styles == null) {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
return styles;
|
|
15
|
+
}
|
|
16
|
+
function getBoxStyle({
|
|
17
|
+
theme,
|
|
18
|
+
style,
|
|
19
|
+
vars,
|
|
20
|
+
styleProps
|
|
21
|
+
}) {
|
|
22
|
+
const _style = mergeStyles(style, theme);
|
|
23
|
+
const _vars = mergeStyles(vars, theme);
|
|
24
|
+
return { ..._style, ..._vars, ...styleProps };
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
getBoxStyle
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=get-box-style.js.map
|