@inventreedb/ui 0.0.3 → 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/dist/.vite/manifest.json +547 -1
- 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/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/functions/Navigation.js +10 -2
- package/dist/functions/Navigation.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- 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/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.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/lib/components/StylishText.tsx +45 -0
- package/lib/functions/Navigation.tsx +14 -2
- package/lib/index.ts +3 -0
- package/package.json +4 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-jsx-runtime.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-jsx-runtime.production.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports } from "../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Text } from "../node_modules/@mantine/core/esm/components/Text/Text.js";
|
|
4
|
+
import { useMantineTheme } from "../node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js";
|
|
5
|
+
import { getThemeColor } from "../node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-theme-color/get-theme-color.js";
|
|
6
|
+
import { darken } from "../node_modules/@mantine/core/esm/core/MantineProvider/color-functions/darken/darken.js";
|
|
7
|
+
const useThematicGradient = () => {
|
|
8
|
+
const theme = useMantineTheme();
|
|
9
|
+
const primary = useMemo(() => {
|
|
10
|
+
return getThemeColor(theme.primaryColor, theme);
|
|
11
|
+
}, [theme]);
|
|
12
|
+
const secondary = useMemo(() => darken(primary, 0.25), [primary]);
|
|
13
|
+
return useMemo(() => {
|
|
14
|
+
return {
|
|
15
|
+
primary,
|
|
16
|
+
secondary
|
|
17
|
+
};
|
|
18
|
+
}, [primary, secondary]);
|
|
19
|
+
};
|
|
20
|
+
function StylishText({
|
|
21
|
+
children,
|
|
22
|
+
size
|
|
23
|
+
}) {
|
|
24
|
+
const {
|
|
25
|
+
primary,
|
|
26
|
+
secondary
|
|
27
|
+
} = useThematicGradient();
|
|
28
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Text, { fw: 700, size: size ?? "xl", variant: "gradient", gradient: {
|
|
29
|
+
from: primary.toString(),
|
|
30
|
+
to: secondary.toString()
|
|
31
|
+
}, children });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
StylishText
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=StylishText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StylishText.js","sources":["../../lib/components/StylishText.tsx"],"sourcesContent":["import {\n type MantineSize,\n Text,\n darken,\n getThemeColor,\n useMantineTheme\n} from '@mantine/core';\nimport { useMemo } from 'react';\n\n// Hook that memoizes the gradient color based on the primary color of the theme\nconst useThematicGradient = () => {\n const theme = useMantineTheme();\n\n const primary = useMemo(() => {\n return getThemeColor(theme.primaryColor, theme);\n }, [theme]);\n\n const secondary = useMemo(() => darken(primary, 0.25), [primary]);\n\n return useMemo(() => {\n return { primary, secondary };\n }, [primary, secondary]);\n};\n\n// A stylish text component that uses the primary color of the theme\nexport function StylishText({\n children,\n size\n}: Readonly<{\n children: JSX.Element | string;\n size?: MantineSize;\n}>) {\n const { primary, secondary } = useThematicGradient();\n\n return (\n <Text\n fw={700}\n size={size ?? 'xl'}\n variant='gradient'\n gradient={{ from: primary.toString(), to: secondary.toString() }}\n >\n {children}\n </Text>\n );\n}\n"],"names":["useThematicGradient","theme","useMantineTheme","primary","useMemo","getThemeColor","primaryColor","secondary","darken","StylishText","children","size","jsx","from","toString","to"],"mappings":";;;;;;AAUA,MAAMA,sBAAsBA,MAAM;AAChC,QAAMC,QAAQC,gBAAgB;AAExBC,QAAAA,UAAUC,QAAQ,MAAM;AACrBC,WAAAA,cAAcJ,MAAMK,cAAcL,KAAK;AAAA,EAAA,GAC7C,CAACA,KAAK,CAAC;AAEJM,QAAAA,YAAYH,QAAQ,MAAMI,OAAOL,SAAS,IAAI,GAAG,CAACA,OAAO,CAAC;AAEhE,SAAOC,QAAQ,MAAM;AACZ,WAAA;AAAA,MAAED;AAAAA,MAASI;AAAAA,IAAU;AAAA,EAAA,GAC3B,CAACJ,SAASI,SAAS,CAAC;AACzB;AAGO,SAASE,YAAY;AAAA,EAC1BC;AAAAA,EACAC;AAID,GAAG;AACI,QAAA;AAAA,IAAER;AAAAA,IAASI;AAAAA,MAAcP,oBAAoB;AAGjD,SAAAY,sCAAC,QACC,IAAI,KACJ,MAAMD,QAAQ,MACd,SAAQ,YACR,UAAU;AAAA,IAAEE,MAAMV,QAAQW,SAAS;AAAA,IAAGC,IAAIR,UAAUO,SAAS;AAAA,KAE5DJ,SACH,CAAA;AAEJ;"}
|
|
@@ -23,11 +23,19 @@ function getDetailUrl(model, pk, absolute) {
|
|
|
23
23
|
}
|
|
24
24
|
const navigateToLink = (link, navigate, event) => {
|
|
25
25
|
cancelEvent(event);
|
|
26
|
+
const base = `/${getBaseUrl()}`;
|
|
26
27
|
if ((event == null ? void 0 : event.ctrlKey) || (event == null ? void 0 : event.shiftKey)) {
|
|
27
|
-
|
|
28
|
+
let url = link;
|
|
29
|
+
if (link.startsWith("/") && !link.startsWith(base)) {
|
|
30
|
+
url = `${base}${link}`;
|
|
31
|
+
}
|
|
28
32
|
window.open(url, "_blank");
|
|
29
33
|
} else {
|
|
30
|
-
|
|
34
|
+
let url = link;
|
|
35
|
+
if (link.startsWith(base)) {
|
|
36
|
+
url = link.replace(base, "");
|
|
37
|
+
}
|
|
38
|
+
navigate(url);
|
|
31
39
|
}
|
|
32
40
|
};
|
|
33
41
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navigation.js","sources":["../../lib/functions/Navigation.tsx"],"sourcesContent":["import type { NavigateFunction } from 'react-router-dom';\nimport { ModelInformationDict } from '../enums/ModelInformation';\nimport type { ModelType } from '../enums/ModelType';\nimport { cancelEvent } from './Events';\n\nexport const getBaseUrl = (): string =>\n (window as any).INVENTREE_SETTINGS?.base_url || 'web';\n\n/**\n * Returns the detail view URL for a given model type\n */\nexport function getDetailUrl(\n model: ModelType,\n pk: number | string,\n absolute?: boolean\n): string {\n const modelInfo = ModelInformationDict[model];\n\n if (pk === undefined || pk === null) {\n return '';\n }\n\n if (!!pk && modelInfo && modelInfo.url_detail) {\n const url = modelInfo.url_detail.replace(':pk', pk.toString());\n const base = getBaseUrl();\n\n if (absolute && base) {\n return `/${base}${url}`;\n } else {\n return url;\n }\n }\n\n console.error(`No detail URL found for model ${model} <${pk}>`);\n return '';\n}\n\n/*\n * Navigate to a provided link.\n * - If the link is to be opened externally, open it in a new tab.\n * - Otherwise, navigate using the provided navigate function.\n */\nexport const navigateToLink = (\n link: string,\n navigate: NavigateFunction,\n event: any\n) => {\n cancelEvent(event);\n\n if (event?.ctrlKey || event?.shiftKey) {\n // Open the link in a new tab\n
|
|
1
|
+
{"version":3,"file":"Navigation.js","sources":["../../lib/functions/Navigation.tsx"],"sourcesContent":["import type { NavigateFunction } from 'react-router-dom';\nimport { ModelInformationDict } from '../enums/ModelInformation';\nimport type { ModelType } from '../enums/ModelType';\nimport { cancelEvent } from './Events';\n\nexport const getBaseUrl = (): string =>\n (window as any).INVENTREE_SETTINGS?.base_url || 'web';\n\n/**\n * Returns the detail view URL for a given model type\n */\nexport function getDetailUrl(\n model: ModelType,\n pk: number | string,\n absolute?: boolean\n): string {\n const modelInfo = ModelInformationDict[model];\n\n if (pk === undefined || pk === null) {\n return '';\n }\n\n if (!!pk && modelInfo && modelInfo.url_detail) {\n const url = modelInfo.url_detail.replace(':pk', pk.toString());\n const base = getBaseUrl();\n\n if (absolute && base) {\n return `/${base}${url}`;\n } else {\n return url;\n }\n }\n\n console.error(`No detail URL found for model ${model} <${pk}>`);\n return '';\n}\n\n/*\n * Navigate to a provided link.\n * - If the link is to be opened externally, open it in a new tab.\n * - Otherwise, navigate using the provided navigate function.\n */\nexport const navigateToLink = (\n link: string,\n navigate: NavigateFunction,\n event: any\n) => {\n cancelEvent(event);\n\n const base = `/${getBaseUrl()}`;\n\n if (event?.ctrlKey || event?.shiftKey) {\n // Open the link in a new tab\n let url = link;\n if (link.startsWith('/') && !link.startsWith(base)) {\n url = `${base}${link}`;\n }\n window.open(url, '_blank');\n } else {\n // Navigate internally\n let url = link;\n\n if (link.startsWith(base)) {\n // Strip the base URL from the link\n url = link.replace(base, '');\n }\n\n navigate(url);\n }\n};\n"],"names":["getBaseUrl","window","INVENTREE_SETTINGS","base_url","getDetailUrl","model","pk","absolute","modelInfo","ModelInformationDict","undefined","url_detail","url","replace","toString","base","console","error","navigateToLink","link","navigate","event","cancelEvent","ctrlKey","shiftKey","startsWith","open"],"mappings":";;AAKO,MAAMA,aAAaA,MACvBC;;AAAAA,uBAAeC,uBAAfD,mBAAmCE,aAAY;AAAA;AAKlCC,SAAAA,aACdC,OACAC,IACAC,UACQ;AACFC,QAAAA,YAAYC,qBAAqBJ,KAAK;AAExCC,MAAAA,OAAOI,UAAaJ,OAAO,MAAM;AAC5B,WAAA;AAAA,EAAA;AAGT,MAAI,CAAC,CAACA,MAAME,aAAaA,UAAUG,YAAY;AAC7C,UAAMC,MAAMJ,UAAUG,WAAWE,QAAQ,OAAOP,GAAGQ,UAAU;AAC7D,UAAMC,OAAOf,WAAW;AAExB,QAAIO,YAAYQ,MAAM;AACb,aAAA,IAAIA,IAAI,GAAGH,GAAG;AAAA,IAAA,OAChB;AACEA,aAAAA;AAAAA,IAAAA;AAAAA,EACT;AAGFI,UAAQC,MAAM,iCAAiCZ,KAAK,KAAKC,EAAE,GAAG;AACvD,SAAA;AACT;AAOO,MAAMY,iBAAiBA,CAC5BC,MACAC,UACAC,UACG;AACHC,cAAYD,KAAK;AAEXN,QAAAA,OAAO,IAAIf,WAAY,CAAA;AAEzBqB,OAAAA,+BAAOE,aAAWF,+BAAOG,WAAU;AAErC,QAAIZ,MAAMO;AACNA,QAAAA,KAAKM,WAAW,GAAG,KAAK,CAACN,KAAKM,WAAWV,IAAI,GAAG;AAC5C,YAAA,GAAGA,IAAI,GAAGI,IAAI;AAAA,IAAA;AAEfO,WAAAA,KAAKd,KAAK,QAAQ;AAAA,EAAA,OACpB;AAEL,QAAIA,MAAMO;AAENA,QAAAA,KAAKM,WAAWV,IAAI,GAAG;AAEnBI,YAAAA,KAAKN,QAAQE,MAAM,EAAE;AAAA,IAAA;AAG7BK,aAASR,GAAG;AAAA,EAAA;AAEhB;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export type { InvenTreePluginContext } from './types/Plugins';
|
|
|
5
5
|
export { apiUrl } from './functions/Api';
|
|
6
6
|
export { getBaseUrl, getDetailUrl, navigateToLink } from './functions/Navigation';
|
|
7
7
|
export { checkPluginVersion } from './functions/Plugins';
|
|
8
|
+
export { StylishText } from './components/StylishText';
|
package/dist/index.js
CHANGED
|
@@ -4,10 +4,12 @@ import { ModelType } from "./enums/ModelType.js";
|
|
|
4
4
|
import { apiUrl } from "./functions/Api.js";
|
|
5
5
|
import { getBaseUrl, getDetailUrl, navigateToLink } from "./functions/Navigation.js";
|
|
6
6
|
import { checkPluginVersion } from "./functions/Plugins.js";
|
|
7
|
+
import { StylishText } from "./components/StylishText.js";
|
|
7
8
|
export {
|
|
8
9
|
ApiEndpoints,
|
|
9
10
|
INVENTREE_PLUGIN_VERSION,
|
|
10
11
|
ModelType,
|
|
12
|
+
StylishText,
|
|
11
13
|
apiUrl,
|
|
12
14
|
checkPluginVersion,
|
|
13
15
|
getBaseUrl,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-box-style.js","sources":["../../../../../../../../node_modules/@mantine/core/esm/core/Box/get-box-style/get-box-style.mjs"],"sourcesContent":["'use client';\nfunction mergeStyles(styles, theme) {\n if (Array.isArray(styles)) {\n return [...styles].reduce(\n (acc, item) => ({ ...acc, ...mergeStyles(item, theme) }),\n {}\n );\n }\n if (typeof styles === \"function\") {\n return styles(theme);\n }\n if (styles == null) {\n return {};\n }\n return styles;\n}\nfunction getBoxStyle({\n theme,\n style,\n vars,\n styleProps\n}) {\n const _style = mergeStyles(style, theme);\n const _vars = mergeStyles(vars, theme);\n return { ..._style, ..._vars, ...styleProps };\n}\n\nexport { getBoxStyle };\n//# sourceMappingURL=get-box-style.mjs.map\n"],"names":[],"mappings":"AACA,SAAS,YAAY,QAAQ,OAAO;AAClC,MAAI,MAAM,QAAQ,MAAM,GAAG;AACzB,WAAO,CAAC,GAAG,MAAM,EAAE;AAAA,MACjB,CAAC,KAAK,UAAU,EAAE,GAAG,KAAK,GAAG,YAAY,MAAM,KAAK;MACpD,CAAA;AAAA,IACD;AAAA,EACL;AACE,MAAI,OAAO,WAAW,YAAY;AAChC,WAAO,OAAO,KAAK;AAAA,EACvB;AACE,MAAI,UAAU,MAAM;AAClB,WAAO,CAAE;AAAA,EACb;AACE,SAAO;AACT;AACA,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM,SAAS,YAAY,OAAO,KAAK;AACvC,QAAM,QAAQ,YAAY,MAAM,KAAK;AACrC,SAAO,EAAE,GAAG,QAAQ,GAAG,OAAO,GAAG,WAAY;AAC/C;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { filterProps } from "../../../utils/filter-props/filter-props.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import "../../../../../../../../_virtual/jsx-runtime.js";
|
|
4
|
+
function extractStyleProps(others) {
|
|
5
|
+
const {
|
|
6
|
+
m,
|
|
7
|
+
mx,
|
|
8
|
+
my,
|
|
9
|
+
mt,
|
|
10
|
+
mb,
|
|
11
|
+
ml,
|
|
12
|
+
mr,
|
|
13
|
+
me,
|
|
14
|
+
ms,
|
|
15
|
+
p,
|
|
16
|
+
px,
|
|
17
|
+
py,
|
|
18
|
+
pt,
|
|
19
|
+
pb,
|
|
20
|
+
pl,
|
|
21
|
+
pr,
|
|
22
|
+
pe,
|
|
23
|
+
ps,
|
|
24
|
+
bd,
|
|
25
|
+
bg,
|
|
26
|
+
c,
|
|
27
|
+
opacity,
|
|
28
|
+
ff,
|
|
29
|
+
fz,
|
|
30
|
+
fw,
|
|
31
|
+
lts,
|
|
32
|
+
ta,
|
|
33
|
+
lh,
|
|
34
|
+
fs,
|
|
35
|
+
tt,
|
|
36
|
+
td,
|
|
37
|
+
w,
|
|
38
|
+
miw,
|
|
39
|
+
maw,
|
|
40
|
+
h,
|
|
41
|
+
mih,
|
|
42
|
+
mah,
|
|
43
|
+
bgsz,
|
|
44
|
+
bgp,
|
|
45
|
+
bgr,
|
|
46
|
+
bga,
|
|
47
|
+
pos,
|
|
48
|
+
top,
|
|
49
|
+
left,
|
|
50
|
+
bottom,
|
|
51
|
+
right,
|
|
52
|
+
inset,
|
|
53
|
+
display,
|
|
54
|
+
flex,
|
|
55
|
+
hiddenFrom,
|
|
56
|
+
visibleFrom,
|
|
57
|
+
lightHidden,
|
|
58
|
+
darkHidden,
|
|
59
|
+
sx,
|
|
60
|
+
...rest
|
|
61
|
+
} = others;
|
|
62
|
+
const styleProps = filterProps({
|
|
63
|
+
m,
|
|
64
|
+
mx,
|
|
65
|
+
my,
|
|
66
|
+
mt,
|
|
67
|
+
mb,
|
|
68
|
+
ml,
|
|
69
|
+
mr,
|
|
70
|
+
me,
|
|
71
|
+
ms,
|
|
72
|
+
p,
|
|
73
|
+
px,
|
|
74
|
+
py,
|
|
75
|
+
pt,
|
|
76
|
+
pb,
|
|
77
|
+
pl,
|
|
78
|
+
pr,
|
|
79
|
+
pe,
|
|
80
|
+
ps,
|
|
81
|
+
bd,
|
|
82
|
+
bg,
|
|
83
|
+
c,
|
|
84
|
+
opacity,
|
|
85
|
+
ff,
|
|
86
|
+
fz,
|
|
87
|
+
fw,
|
|
88
|
+
lts,
|
|
89
|
+
ta,
|
|
90
|
+
lh,
|
|
91
|
+
fs,
|
|
92
|
+
tt,
|
|
93
|
+
td,
|
|
94
|
+
w,
|
|
95
|
+
miw,
|
|
96
|
+
maw,
|
|
97
|
+
h,
|
|
98
|
+
mih,
|
|
99
|
+
mah,
|
|
100
|
+
bgsz,
|
|
101
|
+
bgp,
|
|
102
|
+
bgr,
|
|
103
|
+
bga,
|
|
104
|
+
pos,
|
|
105
|
+
top,
|
|
106
|
+
left,
|
|
107
|
+
bottom,
|
|
108
|
+
right,
|
|
109
|
+
inset,
|
|
110
|
+
display,
|
|
111
|
+
flex,
|
|
112
|
+
hiddenFrom,
|
|
113
|
+
visibleFrom,
|
|
114
|
+
lightHidden,
|
|
115
|
+
darkHidden,
|
|
116
|
+
sx
|
|
117
|
+
});
|
|
118
|
+
return { styleProps, rest };
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
extractStyleProps
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=extract-style-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-style-props.js","sources":["../../../../../../../../../node_modules/@mantine/core/esm/core/Box/style-props/extract-style-props/extract-style-props.mjs"],"sourcesContent":["'use client';\nimport { filterProps } from '../../../utils/filter-props/filter-props.mjs';\nimport 'react';\nimport 'react/jsx-runtime';\nimport '@mantine/hooks';\n\nfunction extractStyleProps(others) {\n const {\n m,\n mx,\n my,\n mt,\n mb,\n ml,\n mr,\n me,\n ms,\n p,\n px,\n py,\n pt,\n pb,\n pl,\n pr,\n pe,\n ps,\n bd,\n bg,\n c,\n opacity,\n ff,\n fz,\n fw,\n lts,\n ta,\n lh,\n fs,\n tt,\n td,\n w,\n miw,\n maw,\n h,\n mih,\n mah,\n bgsz,\n bgp,\n bgr,\n bga,\n pos,\n top,\n left,\n bottom,\n right,\n inset,\n display,\n flex,\n hiddenFrom,\n visibleFrom,\n lightHidden,\n darkHidden,\n sx,\n ...rest\n } = others;\n const styleProps = filterProps({\n m,\n mx,\n my,\n mt,\n mb,\n ml,\n mr,\n me,\n ms,\n p,\n px,\n py,\n pt,\n pb,\n pl,\n pr,\n pe,\n ps,\n bd,\n bg,\n c,\n opacity,\n ff,\n fz,\n fw,\n lts,\n ta,\n lh,\n fs,\n tt,\n td,\n w,\n miw,\n maw,\n h,\n mih,\n mah,\n bgsz,\n bgp,\n bgr,\n bga,\n pos,\n top,\n left,\n bottom,\n right,\n inset,\n display,\n flex,\n hiddenFrom,\n visibleFrom,\n lightHidden,\n darkHidden,\n sx\n });\n return { styleProps, rest };\n}\n\nexport { extractStyleProps };\n//# sourceMappingURL=extract-style-props.mjs.map\n"],"names":[],"mappings":";;;AAMA,SAAS,kBAAkB,QAAQ;AACjC,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;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;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;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACP,IAAM;AACJ,QAAM,aAAa,YAAY;AAAA,IAC7B;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;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;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;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG;AACD,SAAO,EAAE,YAAY,KAAM;AAC7B;","x_google_ignoreList":[0]}
|