@inventreedb/ui 0.0.4 → 0.0.6

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.
Files changed (152) hide show
  1. package/dist/.vite/manifest.json +1 -547
  2. package/dist/index.d.ts +0 -1
  3. package/dist/index.js +0 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/types/Plugins.d.ts +4 -0
  6. package/dist/types/Plugins.js +1 -1
  7. package/dist/types/Plugins.js.map +1 -1
  8. package/lib/index.ts +0 -3
  9. package/lib/types/Plugins.tsx +4 -0
  10. package/package.json +2 -2
  11. package/dist/_virtual/jsx-runtime.js +0 -6
  12. package/dist/_virtual/jsx-runtime.js.map +0 -1
  13. package/dist/_virtual/jsx-runtime2.js +0 -5
  14. package/dist/_virtual/jsx-runtime2.js.map +0 -1
  15. package/dist/_virtual/react-jsx-runtime.development.js +0 -5
  16. package/dist/_virtual/react-jsx-runtime.development.js.map +0 -1
  17. package/dist/_virtual/react-jsx-runtime.production.min.js +0 -5
  18. package/dist/_virtual/react-jsx-runtime.production.min.js.map +0 -1
  19. package/dist/components/StylishText.d.ts +0 -5
  20. package/dist/components/StylishText.js +0 -36
  21. package/dist/components/StylishText.js.map +0 -1
  22. package/dist/node_modules/@mantine/core/esm/components/Text/Text.js +0 -94
  23. package/dist/node_modules/@mantine/core/esm/components/Text/Text.js.map +0 -1
  24. package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.js +0 -6
  25. package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.js.map +0 -1
  26. package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js +0 -2
  27. package/dist/node_modules/@mantine/core/esm/components/Text/Text.module.css.mjs.vanilla.css.js.map +0 -1
  28. package/dist/node_modules/@mantine/core/esm/core/Box/Box.js +0 -83
  29. package/dist/node_modules/@mantine/core/esm/core/Box/Box.js.map +0 -1
  30. package/dist/node_modules/@mantine/core/esm/core/Box/get-box-mod/get-box-mod.js +0 -33
  31. package/dist/node_modules/@mantine/core/esm/core/Box/get-box-mod/get-box-mod.js.map +0 -1
  32. package/dist/node_modules/@mantine/core/esm/core/Box/get-box-style/get-box-style.js +0 -29
  33. package/dist/node_modules/@mantine/core/esm/core/Box/get-box-style/get-box-style.js.map +0 -1
  34. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/extract-style-props/extract-style-props.js +0 -123
  35. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/extract-style-props/extract-style-props.js.map +0 -1
  36. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/parse-style-props.js +0 -88
  37. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/parse-style-props.js.map +0 -1
  38. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/sort-media-queries.js +0 -15
  39. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/parse-style-props/sort-media-queries.js.map +0 -1
  40. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.js +0 -21
  41. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/border-resolver/border-resolver.js.map +0 -1
  42. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/color-resolver/color-resolver.js +0 -25
  43. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/color-resolver/color-resolver.js.map +0 -1
  44. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-family-resolver/font-family-resolver.js +0 -17
  45. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-family-resolver/font-family-resolver.js.map +0 -1
  46. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js +0 -23
  47. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/font-size-resolver/font-size-resolver.js.map +0 -1
  48. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/identity-resolver/identity-resolver.js +0 -7
  49. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/identity-resolver/identity-resolver.js.map +0 -1
  50. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/index.js +0 -23
  51. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/index.js.map +0 -1
  52. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/line-height-resolver/line-height-resolver.js +0 -14
  53. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/line-height-resolver/line-height-resolver.js.map +0 -1
  54. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/size-resolver/size-resolver.js +0 -13
  55. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/size-resolver/size-resolver.js.map +0 -1
  56. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js +0 -21
  57. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/resolvers/spacing-resolver/spacing-resolver.js.map +0 -1
  58. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/style-props-data.js +0 -55
  59. package/dist/node_modules/@mantine/core/esm/core/Box/style-props/style-props-data.js.map +0 -1
  60. package/dist/node_modules/@mantine/core/esm/core/Box/use-random-classname/use-random-classname.js +0 -9
  61. package/dist/node_modules/@mantine/core/esm/core/Box/use-random-classname/use-random-classname.js.map +0 -1
  62. package/dist/node_modules/@mantine/core/esm/core/InlineStyles/InlineStyles.js +0 -19
  63. package/dist/node_modules/@mantine/core/esm/core/InlineStyles/InlineStyles.js.map +0 -1
  64. package/dist/node_modules/@mantine/core/esm/core/InlineStyles/css-object-to-string/css-object-to-string.js +0 -14
  65. package/dist/node_modules/@mantine/core/esm/core/InlineStyles/css-object-to-string/css-object-to-string.js.map +0 -1
  66. package/dist/node_modules/@mantine/core/esm/core/InlineStyles/styles-to-string/styles-to-string.js +0 -13
  67. package/dist/node_modules/@mantine/core/esm/core/InlineStyles/styles-to-string/styles-to-string.js.map +0 -1
  68. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/Mantine.context.js +0 -40
  69. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/Mantine.context.js.map +0 -1
  70. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js +0 -17
  71. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/MantineThemeProvider/MantineThemeProvider.js.map +0 -1
  72. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/darken/darken.js +0 -14
  73. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/darken/darken.js.map +0 -1
  74. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-gradient/get-gradient.js +0 -15
  75. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-gradient/get-gradient.js.map +0 -1
  76. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-primary-shade/get-primary-shade.js +0 -13
  77. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-primary-shade/get-primary-shade.js.map +0 -1
  78. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-theme-color/get-theme-color.js +0 -9
  79. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/get-theme-color/get-theme-color.js.map +0 -1
  80. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/luminance/luminance.js +0 -32
  81. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/luminance/luminance.js.map +0 -1
  82. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.js +0 -78
  83. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/parse-theme-color/parse-theme-color.js.map +0 -1
  84. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/to-rgba/to-rgba.js +0 -116
  85. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/color-functions/to-rgba/to-rgba.js.map +0 -1
  86. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.js +0 -15
  87. package/dist/node_modules/@mantine/core/esm/core/MantineProvider/use-props/use-props.js.map +0 -1
  88. package/dist/node_modules/@mantine/core/esm/core/factory/create-polymorphic-component.js +0 -7
  89. package/dist/node_modules/@mantine/core/esm/core/factory/create-polymorphic-component.js.map +0 -1
  90. package/dist/node_modules/@mantine/core/esm/core/factory/factory.js +0 -9
  91. package/dist/node_modules/@mantine/core/esm/core/factory/factory.js.map +0 -1
  92. package/dist/node_modules/@mantine/core/esm/core/factory/polymorphic-factory.js +0 -18
  93. package/dist/node_modules/@mantine/core/esm/core/factory/polymorphic-factory.js.map +0 -1
  94. package/dist/node_modules/@mantine/core/esm/core/styles-api/create-vars-resolver/create-vars-resolver.js +0 -7
  95. package/dist/node_modules/@mantine/core/esm/core/styles-api/create-vars-resolver/create-vars-resolver.js.map +0 -1
  96. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-class-name.js +0 -48
  97. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-class-name.js.map +0 -1
  98. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-global-class-names/get-global-class-names.js +0 -17
  99. 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 +0 -1
  100. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-options-class-names/get-options-class-names.js +0 -19
  101. 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 +0 -1
  102. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-resolved-class-names/get-resolved-class-names.js +0 -14
  103. 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 +0 -1
  104. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-root-class-name/get-root-class-name.js +0 -7
  105. 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 +0 -1
  106. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-selector-class-name/get-selector-class-name.js +0 -7
  107. 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 +0 -1
  108. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-static-class-names/get-static-class-names.js +0 -15
  109. 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 +0 -1
  110. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-theme-class-names/get-theme-class-names.js +0 -24
  111. 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 +0 -1
  112. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/get-variant-class-name/get-variant-class-name.js +0 -12
  113. 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 +0 -1
  114. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.js +0 -26
  115. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-class-name/resolve-class-names/resolve-class-names.js.map +0 -1
  116. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-style.js +0 -32
  117. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-style.js.map +0 -1
  118. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-theme-styles/get-theme-styles.js +0 -24
  119. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/get-theme-styles/get-theme-styles.js.map +0 -1
  120. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-style/resolve-style.js +0 -19
  121. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-style/resolve-style.js.map +0 -1
  122. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js +0 -13
  123. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-styles/resolve-styles.js.map +0 -1
  124. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.js +0 -17
  125. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/merge-vars.js.map +0 -1
  126. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/resolve-vars.js +0 -25
  127. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/get-style/resolve-vars/resolve-vars.js.map +0 -1
  128. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-styles.js +0 -70
  129. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-styles.js.map +0 -1
  130. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-transformed-styles.js +0 -34
  131. package/dist/node_modules/@mantine/core/esm/core/styles-api/use-styles/use-transformed-styles.js.map +0 -1
  132. package/dist/node_modules/@mantine/core/esm/core/utils/camel-to-kebab-case/camel-to-kebab-case.js +0 -7
  133. package/dist/node_modules/@mantine/core/esm/core/utils/camel-to-kebab-case/camel-to-kebab-case.js.map +0 -1
  134. package/dist/node_modules/@mantine/core/esm/core/utils/filter-props/filter-props.js +0 -12
  135. package/dist/node_modules/@mantine/core/esm/core/utils/filter-props/filter-props.js.map +0 -1
  136. package/dist/node_modules/@mantine/core/esm/core/utils/get-size/get-size.js +0 -20
  137. package/dist/node_modules/@mantine/core/esm/core/utils/get-size/get-size.js.map +0 -1
  138. package/dist/node_modules/@mantine/core/esm/core/utils/is-number-like/is-number-like.js +0 -18
  139. package/dist/node_modules/@mantine/core/esm/core/utils/is-number-like/is-number-like.js.map +0 -1
  140. package/dist/node_modules/@mantine/core/esm/core/utils/keys/keys.js +0 -7
  141. package/dist/node_modules/@mantine/core/esm/core/utils/keys/keys.js.map +0 -1
  142. package/dist/node_modules/@mantine/core/esm/core/utils/units-converters/rem.js +0 -47
  143. package/dist/node_modules/@mantine/core/esm/core/utils/units-converters/rem.js.map +0 -1
  144. package/dist/node_modules/clsx/dist/clsx.js +0 -18
  145. package/dist/node_modules/clsx/dist/clsx.js.map +0 -1
  146. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -891
  147. package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +0 -1
  148. package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -34
  149. package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.js.map +0 -1
  150. package/dist/node_modules/react/jsx-runtime.js +0 -18
  151. package/dist/node_modules/react/jsx-runtime.js.map +0 -1
  152. package/lib/components/StylishText.tsx +0 -45
package/dist/index.js CHANGED
@@ -4,12 +4,10 @@ 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";
8
7
  export {
9
8
  ApiEndpoints,
10
9
  INVENTREE_PLUGIN_VERSION,
11
10
  ModelType,
12
- StylishText,
13
11
  apiUrl,
14
12
  checkPluginVersion,
15
13
  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":";;;;;;"}
@@ -35,6 +35,8 @@ export type InvenTreeFormsContext = {
35
35
  * @param model - The model type associated with the rendered component (if applicable)
36
36
  * @param id - The ID (primary key) of the model instance for the plugin (if applicable)
37
37
  * @param instance - The model instance data (if available)
38
+ * @param reloadContent - A function which can be called to reload the plugin content
39
+ * @param reloadInstance - A function which can be called to reload the model instance
38
40
  * @param context - Any additional context data which may be passed to the plugin
39
41
  */
40
42
  export type InvenTreePluginContext = {
@@ -53,6 +55,8 @@ export type InvenTreePluginContext = {
53
55
  model?: ModelType | string;
54
56
  id?: string | number | null;
55
57
  instance?: any;
58
+ reloadContent?: () => void;
59
+ reloadInstance?: () => void;
56
60
  context?: any;
57
61
  };
58
62
  export declare const INVENTREE_PLUGIN_VERSION: string;
@@ -1,4 +1,4 @@
1
- const INVENTREE_PLUGIN_VERSION = "0.0.3";
1
+ const INVENTREE_PLUGIN_VERSION = "0.0.6";
2
2
  export {
3
3
  INVENTREE_PLUGIN_VERSION
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Plugins.js","sources":["../../lib/types/Plugins.tsx"],"sourcesContent":["import type { MantineColorScheme, MantineTheme } from '@mantine/core';\nimport type { QueryClient } from '@tanstack/react-query';\nimport type { AxiosInstance } from 'axios';\nimport type { NavigateFunction } from 'react-router-dom';\nimport type { ModelType } from '../enums/ModelType';\nimport type { ApiFormModalProps, BulkEditApiFormModalProps } from './Forms';\nimport type { UseModalReturn } from './Modals';\nimport type { SettingsStateProps } from './Settings';\nimport type { UserStateProps } from './User';\n\nexport interface PluginProps {\n name: string;\n slug: string;\n version: null | string;\n}\n\nexport type InvenTreeFormsContext = {\n bulkEdit: (props: BulkEditApiFormModalProps) => UseModalReturn;\n create: (props: ApiFormModalProps) => UseModalReturn;\n delete: (props: ApiFormModalProps) => UseModalReturn;\n edit: (props: ApiFormModalProps) => UseModalReturn;\n};\n\n/**\n * A set of properties which are passed to a plugin,\n * for rendering an element in the user interface.\n *\n * @param version - The version of the running InvenTree software stack\n * @param api - The Axios API instance (see ../states/ApiState.tsx)\n * @param user - The current user instance (see ../states/UserState.tsx)\n * @param userSettings - The current user settings (see ../states/SettingsState.tsx)\n * @param globalSettings - The global settings (see ../states/SettingsState.tsx)\n * @param navigate - The navigation function (see react-router-dom)\n * @param theme - The current Mantine theme\n * @param colorScheme - The current Mantine color scheme (e.g. 'light' / 'dark')\n * @param host - The current host URL\n * @param locale - The current locale string (e.g. 'en' / 'de')\n * @param model - The model type associated with the rendered component (if applicable)\n * @param id - The ID (primary key) of the model instance for the plugin (if applicable)\n * @param instance - The model instance data (if available)\n * @param context - Any additional context data which may be passed to the plugin\n */\nexport type InvenTreePluginContext = {\n version: string;\n api: AxiosInstance;\n queryClient: QueryClient;\n user: UserStateProps;\n userSettings: SettingsStateProps;\n globalSettings: SettingsStateProps;\n host: string;\n locale: string;\n navigate: NavigateFunction;\n theme: MantineTheme;\n forms: InvenTreeFormsContext;\n colorScheme: MantineColorScheme;\n model?: ModelType | string;\n id?: string | number | null;\n instance?: any;\n context?: any;\n};\n\n/*\n * The version of the InvenTree plugin context interface.\n * This number should be incremented if the interface changes.\n */\n\n// @ts-ignore\nexport const INVENTREE_PLUGIN_VERSION: string = __INVENTREE_LIB_VERSION__;\n"],"names":["INVENTREE_PLUGIN_VERSION","__INVENTREE_LIB_VERSION__"],"mappings":"AAmEO,MAAMA,2BAAmCC;"}
1
+ {"version":3,"file":"Plugins.js","sources":["../../lib/types/Plugins.tsx"],"sourcesContent":["import type { MantineColorScheme, MantineTheme } from '@mantine/core';\nimport type { QueryClient } from '@tanstack/react-query';\nimport type { AxiosInstance } from 'axios';\nimport type { NavigateFunction } from 'react-router-dom';\nimport type { ModelType } from '../enums/ModelType';\nimport type { ApiFormModalProps, BulkEditApiFormModalProps } from './Forms';\nimport type { UseModalReturn } from './Modals';\nimport type { SettingsStateProps } from './Settings';\nimport type { UserStateProps } from './User';\n\nexport interface PluginProps {\n name: string;\n slug: string;\n version: null | string;\n}\n\nexport type InvenTreeFormsContext = {\n bulkEdit: (props: BulkEditApiFormModalProps) => UseModalReturn;\n create: (props: ApiFormModalProps) => UseModalReturn;\n delete: (props: ApiFormModalProps) => UseModalReturn;\n edit: (props: ApiFormModalProps) => UseModalReturn;\n};\n\n/**\n * A set of properties which are passed to a plugin,\n * for rendering an element in the user interface.\n *\n * @param version - The version of the running InvenTree software stack\n * @param api - The Axios API instance (see ../states/ApiState.tsx)\n * @param user - The current user instance (see ../states/UserState.tsx)\n * @param userSettings - The current user settings (see ../states/SettingsState.tsx)\n * @param globalSettings - The global settings (see ../states/SettingsState.tsx)\n * @param navigate - The navigation function (see react-router-dom)\n * @param theme - The current Mantine theme\n * @param colorScheme - The current Mantine color scheme (e.g. 'light' / 'dark')\n * @param host - The current host URL\n * @param locale - The current locale string (e.g. 'en' / 'de')\n * @param model - The model type associated with the rendered component (if applicable)\n * @param id - The ID (primary key) of the model instance for the plugin (if applicable)\n * @param instance - The model instance data (if available)\n * @param reloadContent - A function which can be called to reload the plugin content\n * @param reloadInstance - A function which can be called to reload the model instance\n * @param context - Any additional context data which may be passed to the plugin\n */\nexport type InvenTreePluginContext = {\n version: string;\n api: AxiosInstance;\n queryClient: QueryClient;\n user: UserStateProps;\n userSettings: SettingsStateProps;\n globalSettings: SettingsStateProps;\n host: string;\n locale: string;\n navigate: NavigateFunction;\n theme: MantineTheme;\n forms: InvenTreeFormsContext;\n colorScheme: MantineColorScheme;\n model?: ModelType | string;\n id?: string | number | null;\n instance?: any;\n reloadContent?: () => void;\n reloadInstance?: () => void;\n context?: any;\n};\n\n/*\n * The version of the InvenTree plugin context interface.\n * This number should be incremented if the interface changes.\n */\n\n// @ts-ignore\nexport const INVENTREE_PLUGIN_VERSION: string = __INVENTREE_LIB_VERSION__;\n"],"names":["INVENTREE_PLUGIN_VERSION","__INVENTREE_LIB_VERSION__"],"mappings":"AAuEO,MAAMA,2BAAmCC;"}
package/lib/index.ts CHANGED
@@ -15,6 +15,3 @@ export {
15
15
  navigateToLink
16
16
  } from './functions/Navigation';
17
17
  export { checkPluginVersion } from './functions/Plugins';
18
-
19
- // UI components
20
- export { StylishText } from './components/StylishText';
@@ -38,6 +38,8 @@ export type InvenTreeFormsContext = {
38
38
  * @param model - The model type associated with the rendered component (if applicable)
39
39
  * @param id - The ID (primary key) of the model instance for the plugin (if applicable)
40
40
  * @param instance - The model instance data (if available)
41
+ * @param reloadContent - A function which can be called to reload the plugin content
42
+ * @param reloadInstance - A function which can be called to reload the model instance
41
43
  * @param context - Any additional context data which may be passed to the plugin
42
44
  */
43
45
  export type InvenTreePluginContext = {
@@ -56,6 +58,8 @@ export type InvenTreePluginContext = {
56
58
  model?: ModelType | string;
57
59
  id?: string | number | null;
58
60
  instance?: any;
61
+ reloadContent?: () => void;
62
+ reloadInstance?: () => void;
59
63
  context?: any;
60
64
  };
61
65
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@inventreedb/ui",
3
3
  "description": "UI components for the InvenTree project",
4
- "version": "0.0.4",
4
+ "version": "0.0.6",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -128,7 +128,7 @@
128
128
  "rollup": "^4.0.0",
129
129
  "rollup-plugin-license": "^3.5.3",
130
130
  "typescript": "^5.8.2",
131
- "vite": "^6.2.4",
131
+ "vite": "^6.2.5",
132
132
  "vite-plugin-babel-macros": "^1.0.6",
133
133
  "vite-plugin-dts": "^4.5.3",
134
134
  "vite-plugin-istanbul": "^6.0.2"
@@ -1,6 +0,0 @@
1
- import { __require as requireJsxRuntime } from "../node_modules/react/jsx-runtime.js";
2
- var jsxRuntimeExports = requireJsxRuntime();
3
- export {
4
- jsxRuntimeExports as j
5
- };
6
- //# sourceMappingURL=jsx-runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsx-runtime.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,5 +0,0 @@
1
- var jsxRuntime = { exports: {} };
2
- export {
3
- jsxRuntime as __module
4
- };
5
- //# sourceMappingURL=jsx-runtime2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsx-runtime2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- var reactJsxRuntime_development = {};
2
- export {
3
- reactJsxRuntime_development as __exports
4
- };
5
- //# sourceMappingURL=react-jsx-runtime.development.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-jsx-runtime.development.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- var reactJsxRuntime_production_min = {};
2
- export {
3
- reactJsxRuntime_production_min as __exports
4
- };
5
- //# sourceMappingURL=react-jsx-runtime.production.min.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"react-jsx-runtime.production.min.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -1,5 +0,0 @@
1
- import { MantineSize } from '@mantine/core';
2
- export declare function StylishText({ children, size }: Readonly<{
3
- children: JSX.Element | string;
4
- size?: MantineSize;
5
- }>): import("react/jsx-runtime").JSX.Element;
@@ -1,36 +0,0 @@
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
@@ -1 +0,0 @@
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;"}
@@ -1,94 +0,0 @@
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
@@ -1 +0,0 @@
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]}
@@ -1,6 +0,0 @@
1
- import "./Text.module.css.mjs.vanilla.css.js";
2
- var __default__ = { root: "m_b6d8b162" };
3
- export {
4
- __default__ as default
5
- };
6
- //# sourceMappingURL=Text.module.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=Text.module.css.mjs.vanilla.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Text.module.css.mjs.vanilla.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,83 +0,0 @@
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
@@ -1 +0,0 @@
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]}
@@ -1,33 +0,0 @@
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
@@ -1 +0,0 @@
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]}
@@ -1,29 +0,0 @@
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
@@ -1 +0,0 @@
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]}
@@ -1,123 +0,0 @@
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
@@ -1 +0,0 @@
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]}