@vritti/quantum-ui 0.3.27 → 0.4.1

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 (105) hide show
  1. package/dist/Avatar.js +5 -5
  2. package/dist/Checkbox.js +16 -11
  3. package/dist/Checkbox.js.map +1 -1
  4. package/dist/Checkbox2.js +4 -5
  5. package/dist/Checkbox2.js.map +1 -1
  6. package/dist/Combination.js +1 -1
  7. package/dist/Dialog.js +1 -1
  8. package/dist/Progress.js +2 -2
  9. package/dist/RadioGroup.js +4 -5
  10. package/dist/RadioGroup.js.map +1 -1
  11. package/dist/Sidebar.js +1 -1
  12. package/dist/Sonner.js +1 -1
  13. package/dist/Switch.js +19 -14
  14. package/dist/Switch.js.map +1 -1
  15. package/dist/TabsSkeleton.js +1 -1
  16. package/dist/Toggle.js +1 -1
  17. package/dist/assets/quantum-ui.css +1 -1
  18. package/dist/components/RichTextEditor.js +1 -1
  19. package/dist/components/TreeView.js +2 -3
  20. package/dist/components/TreeView.js.map +1 -1
  21. package/dist/disabledTip.js +13 -0
  22. package/dist/disabledTip.js.map +1 -0
  23. package/dist/dropdown-menu.js +5 -7
  24. package/dist/dropdown-menu.js.map +1 -1
  25. package/dist/image-component.js +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/index13.js +4 -6
  28. package/dist/index13.js.map +1 -1
  29. package/dist/index14.js +3 -5
  30. package/dist/index14.js.map +1 -1
  31. package/dist/index15.js +8 -9
  32. package/dist/index15.js.map +1 -1
  33. package/dist/index16.js +1 -1
  34. package/dist/index17.js +1 -1
  35. package/dist/index19.js +2 -4
  36. package/dist/index19.js.map +1 -1
  37. package/dist/index20.js +1 -1
  38. package/dist/index21.js +139 -1
  39. package/dist/index21.js.map +1 -1
  40. package/dist/index22.js +3 -4
  41. package/dist/index22.js.map +1 -1
  42. package/dist/index23.js +70 -122
  43. package/dist/index23.js.map +1 -1
  44. package/dist/index24.js +1128 -70
  45. package/dist/index24.js.map +1 -1
  46. package/dist/index25.js +231 -11
  47. package/dist/index25.js.map +1 -1
  48. package/dist/index26.js +2509 -1106
  49. package/dist/index26.js.map +1 -1
  50. package/dist/index27.js +23 -223
  51. package/dist/index27.js.map +1 -1
  52. package/dist/index28.js +3 -2535
  53. package/dist/index28.js.map +1 -1
  54. package/dist/index29.js +36 -31
  55. package/dist/index29.js.map +1 -1
  56. package/dist/index30.js +308 -3
  57. package/dist/index30.js.map +1 -1
  58. package/dist/index31.js +8 -36
  59. package/dist/index31.js.map +1 -1
  60. package/dist/index32.js +25 -305
  61. package/dist/index32.js.map +1 -1
  62. package/dist/index33.js +60 -8
  63. package/dist/index33.js.map +1 -1
  64. package/dist/index34.js +11 -30
  65. package/dist/index34.js.map +1 -1
  66. package/dist/index35.js +35 -59
  67. package/dist/index35.js.map +1 -1
  68. package/dist/index36.js +35348 -9
  69. package/dist/index36.js.map +1 -1
  70. package/dist/index37.js +79 -36
  71. package/dist/index37.js.map +1 -1
  72. package/dist/index38.js +184 -35341
  73. package/dist/index38.js.map +1 -1
  74. package/dist/index5.js +2 -4
  75. package/dist/index5.js.map +1 -1
  76. package/dist/index8.js +7 -0
  77. package/dist/index8.js.map +1 -1
  78. package/dist/lib/components/Checkbox/Checkbox.d.ts +1 -0
  79. package/dist/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  80. package/dist/lib/components/Switch/Switch.d.ts +4 -1
  81. package/dist/lib/components/Switch/Switch.d.ts.map +1 -1
  82. package/dist/lib/config/index.d.ts +5 -0
  83. package/dist/lib/config/index.d.ts.map +1 -1
  84. package/dist/lib/hooks/useSSE.d.ts.map +1 -1
  85. package/dist/lib/selects/permission-group/PermissionGroupSelector.d.ts +4 -0
  86. package/dist/lib/selects/permission-group/PermissionGroupSelector.d.ts.map +1 -0
  87. package/dist/lib/selects/permission-group/index.d.ts +2 -0
  88. package/dist/lib/selects/permission-group/index.d.ts.map +1 -0
  89. package/dist/lib/types/catalog-resolver.d.ts +18 -6
  90. package/dist/lib/types/catalog-resolver.d.ts.map +1 -1
  91. package/dist/lib/utils/disabledTip.d.ts +3 -0
  92. package/dist/lib/utils/disabledTip.d.ts.map +1 -0
  93. package/dist/selects/permission-group.js +21 -0
  94. package/dist/selects/permission-group.js.map +1 -0
  95. package/dist/types/catalog-resolver.js +1 -1
  96. package/dist/types/catalog-resolver.js.map +1 -1
  97. package/dist/useTimer.js +2 -1
  98. package/dist/useTimer.js.map +1 -1
  99. package/dist/utils/motion.js +2 -2
  100. package/dist/value.js +1 -1
  101. package/package.json +5 -1
  102. package/dist/index39.js +0 -84
  103. package/dist/index39.js.map +0 -1
  104. package/dist/index40.js +0 -199
  105. package/dist/index40.js.map +0 -1
package/dist/index35.js CHANGED
@@ -1,65 +1,41 @@
1
1
  import * as React from 'react';
2
- import { jsx } from 'react/jsx-runtime';
2
+ import { u as useLayoutEffect2 } from './index28.js';
3
3
 
4
- // src/create-context.tsx
5
- function createContextScope(scopeName, createContextScopeDeps = []) {
6
- let defaultContexts = [];
7
- function createContext3(rootComponentName, defaultContext) {
8
- const BaseContext = React.createContext(defaultContext);
9
- BaseContext.displayName = rootComponentName + "Context";
10
- const index = defaultContexts.length;
11
- defaultContexts = [...defaultContexts, defaultContext];
12
- const Provider = (props) => {
13
- const { scope, children, ...context } = props;
14
- const Context = scope?.[scopeName]?.[index] || BaseContext;
15
- const value = React.useMemo(() => context, Object.values(context));
16
- return /* @__PURE__ */ jsx(Context.Provider, { value, children });
17
- };
18
- Provider.displayName = rootComponentName + "Provider";
19
- function useContext2(consumerName, scope) {
20
- const Context = scope?.[scopeName]?.[index] || BaseContext;
21
- const context = React.useContext(Context);
22
- if (context) return context;
23
- if (defaultContext !== void 0) return defaultContext;
24
- throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
4
+ // packages/react/use-size/src/use-size.tsx
5
+ function useSize(element) {
6
+ const [size, setSize] = React.useState(void 0);
7
+ useLayoutEffect2(() => {
8
+ if (element) {
9
+ setSize({ width: element.offsetWidth, height: element.offsetHeight });
10
+ const resizeObserver = new ResizeObserver((entries) => {
11
+ if (!Array.isArray(entries)) {
12
+ return;
13
+ }
14
+ if (!entries.length) {
15
+ return;
16
+ }
17
+ const entry = entries[0];
18
+ let width;
19
+ let height;
20
+ if ("borderBoxSize" in entry) {
21
+ const borderSizeEntry = entry["borderBoxSize"];
22
+ const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
23
+ width = borderSize["inlineSize"];
24
+ height = borderSize["blockSize"];
25
+ } else {
26
+ width = element.offsetWidth;
27
+ height = element.offsetHeight;
28
+ }
29
+ setSize({ width, height });
30
+ });
31
+ resizeObserver.observe(element, { box: "border-box" });
32
+ return () => resizeObserver.unobserve(element);
33
+ } else {
34
+ setSize(void 0);
25
35
  }
26
- return [Provider, useContext2];
27
- }
28
- const createScope = () => {
29
- const scopeContexts = defaultContexts.map((defaultContext) => {
30
- return React.createContext(defaultContext);
31
- });
32
- return function useScope(scope) {
33
- const contexts = scope?.[scopeName] || scopeContexts;
34
- return React.useMemo(
35
- () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
36
- [scope, contexts]
37
- );
38
- };
39
- };
40
- createScope.scopeName = scopeName;
41
- return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
42
- }
43
- function composeContextScopes(...scopes) {
44
- const baseScope = scopes[0];
45
- if (scopes.length === 1) return baseScope;
46
- const createScope = () => {
47
- const scopeHooks = scopes.map((createScope2) => ({
48
- useScope: createScope2(),
49
- scopeName: createScope2.scopeName
50
- }));
51
- return function useComposedScopes(overrideScopes) {
52
- const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
53
- const scopeProps = useScope(overrideScopes);
54
- const currentScope = scopeProps[`__scope${scopeName}`];
55
- return { ...nextScopes2, ...currentScope };
56
- }, {});
57
- return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
58
- };
59
- };
60
- createScope.scopeName = baseScope.scopeName;
61
- return createScope;
36
+ }, [element]);
37
+ return size;
62
38
  }
63
39
 
64
- export { createContextScope as c };
40
+ export { useSize as u };
65
41
  //# sourceMappingURL=index35.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index35.js","sources":["../node_modules/.pnpm/@radix-ui+react-context@1.1.3_@types+react@19.2.14_react@19.2.3/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n Context.displayName = rootComponentName + \"Context\";\n const Provider = (props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n BaseContext.displayName = rootComponentName + \"Context\";\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":[],"mappings":";;;AAAA;AAoBA,SAAS,kBAAkB,CAAC,SAAS,EAAE,sBAAsB,GAAG,EAAE,EAAE;AACpE,EAAE,IAAI,eAAe,GAAG,EAAE;AAC1B,EAAE,SAAS,cAAc,CAAC,iBAAiB,EAAE,cAAc,EAAE;AAC7D,IAAI,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,cAAc,CAAC;AAC3D,IAAI,WAAW,CAAC,WAAW,GAAG,iBAAiB,GAAG,SAAS;AAC3D,IAAI,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM;AACxC,IAAI,eAAe,GAAG,CAAC,GAAG,eAAe,EAAE,cAAc,CAAC;AAC1D,IAAI,MAAM,QAAQ,GAAG,CAAC,KAAK,KAAK;AAChC,MAAM,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,EAAE,GAAG,KAAK;AACnD,MAAM,MAAM,O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U,CAAC,CAAC;AACnG,IAAI,CAAC;AACL,EAAE,CAAC;AACH,EAAE,WAAW,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS;AAC7C,EAAE,OAAO,WAAW;AACpB;;;;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index35.js","sources":["../node_modules/.pnpm/@radix-ui+react-use-size@1.1.1_@types+react@19.2.14_react@19.2.3/node_modules/@radix-ui/react-use-size/dist/index.mjs"],"sourcesContent":["// packages/react/use-size/src/use-size.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nfunction useSize(element) {\n const [size, setSize] = React.useState(void 0);\n useLayoutEffect(() => {\n if (element) {\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n if (!entries.length) {\n return;\n }\n const entry = entries[0];\n let width;\n let height;\n if (\"borderBoxSize\" in entry) {\n const borderSizeEntry = entry[\"borderBoxSize\"];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize[\"inlineSize\"];\n height = borderSize[\"blockSize\"];\n } else {\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n setSize({ width, height });\n });\n resizeObserver.observe(element, { box: \"border-box\" });\n return () => resizeObserver.unobserve(element);\n } else {\n setSize(void 0);\n }\n }, [element]);\n return size;\n}\nexport {\n useSize\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useLayoutEffect"],"mappings":";;;AAAA;AAGA,SAAS,OAAO,CAAC,OAAO,EAAE;AAC1B,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;AAChD,EAAEA,gBAAe,CAAC,MAAM;AACxB,IAAI,IAAI,OAAO,EAAE;AACjB,MAAM,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAA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