@hh.ru/magritte-ui-trigger 4.3.46 → 4.3.47
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/Trigger.d.ts +2 -2
- package/Trigger.js +230 -102
- package/Trigger.js.map +1 -1
- package/index.css +276 -276
- package/index.d.ts +3 -3
- package/index.mock.d.ts +1 -1
- package/index.mock.js +27 -26
- package/index.mock.js.map +1 -1
- package/package.json +6 -6
- package/types.d.ts +1 -1
package/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from '
|
|
2
|
-
export * from '
|
|
3
|
-
export * from '
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './Trigger';
|
|
3
|
+
export * from './BaseTrigger';
|
package/index.mock.d.ts
CHANGED
package/index.mock.js
CHANGED
|
@@ -2,37 +2,38 @@ import './index.css';
|
|
|
2
2
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
4
|
|
|
5
|
-
function enhance(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
5
|
+
function enhance(mockComponent2, staticProps) {
|
|
6
|
+
delete staticProps.type;
|
|
7
|
+
delete staticProps.$$typeof;
|
|
8
|
+
delete staticProps.render;
|
|
9
|
+
for (const prop in staticProps) {
|
|
10
|
+
mockComponent2[prop] = staticProps[prop];
|
|
11
|
+
}
|
|
13
12
|
}
|
|
14
13
|
const MockComponent = ({ style, ...props }) => (
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
16
|
-
// @ts-ignore
|
|
17
|
-
// eslint-disable-next-line react/jsx-no-undef
|
|
18
|
-
jsx("magritte-component-mock", { "style-data": style, ...props })
|
|
19
|
-
|
|
20
|
-
* Возвращает mock React компонента
|
|
21
|
-
*/
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
// eslint-disable-next-line react/jsx-no-undef
|
|
17
|
+
/* @__PURE__ */ jsx("magritte-component-mock", { "style-data": style, ...props })
|
|
18
|
+
);
|
|
22
19
|
const mockComponent = (componentName, staticProps = {}, { withChildren, innerDependence, WrapperComponent } = {}) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return
|
|
20
|
+
const mockWrapper = forwardRef(({ children, ...props }, ref) => {
|
|
21
|
+
const mock = (
|
|
22
|
+
// eslint-disable-next-line react/jsx-no-undef
|
|
23
|
+
/* @__PURE__ */ jsxs(MockComponent, { ...props, _component: componentName, children: [
|
|
24
|
+
innerDependence ? innerDependence(props, ref) : null,
|
|
25
|
+
withChildren ? children : null
|
|
26
|
+
] })
|
|
27
|
+
);
|
|
28
|
+
return WrapperComponent ? /* @__PURE__ */ jsx(WrapperComponent, { ...props, children: mock }) : mock;
|
|
29
|
+
});
|
|
30
|
+
staticProps && enhance(mockWrapper, staticProps);
|
|
31
|
+
mockWrapper.displayName = "magritte-ref";
|
|
32
|
+
return mockWrapper;
|
|
32
33
|
};
|
|
33
34
|
|
|
34
|
-
const Trigger = mockComponent(
|
|
35
|
-
|
|
35
|
+
const Trigger = mockComponent("Trigger", void 0, {
|
|
36
|
+
withChildren: false
|
|
36
37
|
});
|
|
37
38
|
|
|
38
39
|
export { Trigger };
|
package/index.mock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mock.js","sources":["../mock-component/lib/setupMockComponent.js","src/index.mock.ts"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\n\nfunction enhance(
|
|
1
|
+
{"version":3,"file":"index.mock.js","sources":["../mock-component/lib/setupMockComponent.js","src/index.mock.ts"],"sourcesContent":["import { jsxs, jsx } from 'react/jsx-runtime';\nimport { forwardRef } from 'react';\n\nfunction enhance(mockComponent2, staticProps) {\n delete staticProps.type;\n delete staticProps.$$typeof;\n delete staticProps.render;\n for (const prop in staticProps) {\n mockComponent2[prop] = staticProps[prop];\n }\n}\nconst MockComponent = ({ style, ...props }) => (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line react/jsx-no-undef\n /* @__PURE__ */ jsx(\"magritte-component-mock\", { \"style-data\": style, ...props })\n);\nconst MockComponentRenderProp = ({ style, ...props }) => (\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n // eslint-disable-next-line react/jsx-no-undef\n /* @__PURE__ */ jsx(\"magritte-component-mock-render-prop\", { \"style-data\": style, ...props })\n);\nconst mockComponent = (componentName, staticProps = {}, { withChildren, innerDependence, WrapperComponent } = {}) => {\n const mockWrapper = forwardRef(({ children, ...props }, ref) => {\n const mock = (\n // eslint-disable-next-line react/jsx-no-undef\n /* @__PURE__ */ jsxs(MockComponent, { ...props, _component: componentName, children: [\n innerDependence ? innerDependence(props, ref) : null,\n withChildren ? children : null\n ] })\n );\n return WrapperComponent ? /* @__PURE__ */ jsx(WrapperComponent, { ...props, children: mock }) : mock;\n });\n staticProps && enhance(mockWrapper, staticProps);\n mockWrapper.displayName = \"magritte-ref\";\n return mockWrapper;\n};\nconst mockComponentRenderProp = (componentName, staticProps, { withChildren, innerDependence, renderArguments } = { renderArguments: [] }) => {\n const mockWrapper = ({\n render,\n children,\n ...props\n }) => /* @__PURE__ */ jsxs(MockComponentRenderProp, { ...props, _component: componentName, children: [\n innerDependence ? innerDependence(props) : null,\n withChildren ? children : null,\n render?.(...renderArguments || [])\n ] });\n staticProps && enhance(mockWrapper, staticProps);\n mockWrapper.displayName = \"magritte-component-mock-render-prop\";\n return mockWrapper;\n};\n\nexport { mockComponent, mockComponentRenderProp };\n//# sourceMappingURL=setupMockComponent.js.map\n","import { ForwardRefExoticComponent } from 'react';\n\nimport { mockComponent } from '@hh.ru/magritte-ui-mock-component';\n\nexport type * from '@hh.ru/magritte-ui-trigger/types';\n\nexport const Trigger: ForwardRefExoticComponent<Record<string, unknown>> = mockComponent('Trigger', undefined, {\n withChildren: false,\n});\n"],"names":[],"mappings":";;;AAGA,SAAS,OAAO,CAAC,cAAc,EAAE,WAAW,EAAE;AAC9C,EAAE,OAAO,WAAW,CAAC,IAAI,CAAC;AAC1B,EAAE,OAAO,WAAW,CAAC,QAAQ,CAAC;AAC9B,EAAE,OAAO,WAAW,CAAC,MAAM,CAAC;AAC5B,EAAE,KAAK,MAAM,IAAI,IAAI,WAAW,EAAE;AAClC,IAAI,cAAc,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;AAC7C,GAAG;AACH,CAAC;AACD,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;AAC1C;AACA;AACA;AACA,kBAAkB,GAAG,CAAC,yBAAyB,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAAC;AACnF,CAAC,CAAC;AAOF,MAAM,aAAa,GAAG,CAAC,aAAa,EAAE,WAAW,GAAG,EAAE,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,GAAG,EAAE,KAAK;AACrH,EAAE,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK;AAClE,IAAI,MAAM,IAAI;AACd;AACA,sBAAsB,IAAI,CAAC,aAAa,EAAE,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE;AAC3F,QAAQ,eAAe,GAAG,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,IAAI;AAC5D,QAAQ,YAAY,GAAG,QAAQ,GAAG,IAAI;AACtC,OAAO,EAAE,CAAC;AACV,KAAK,CAAC;AACN,IAAI,OAAO,gBAAgB,mBAAmB,GAAG,CAAC,gBAAgB,EAAE,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC;AACzG,GAAG,CAAC,CAAC;AACL,EAAE,WAAW,IAAI,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AACnD,EAAE,WAAW,CAAC,WAAW,GAAG,cAAc,CAAC;AAC3C,EAAE,OAAO,WAAW,CAAC;AACrB,CAAC;;AC/BY,MAAA,OAAA,GAA8D,aAAc,CAAA,SAAA,EAAW,KAAW,CAAA,EAAA;AAAA,EAC3G,YAAc,EAAA,KAAA;AAClB,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hh.ru/magritte-ui-trigger",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.47",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"sideEffects": [
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"@hh.ru/magritte-common-keyboard": "4.3.6",
|
|
30
30
|
"@hh.ru/magritte-common-resize": "0.2.3",
|
|
31
31
|
"@hh.ru/magritte-common-use-multiple-refs": "1.1.12",
|
|
32
|
-
"@hh.ru/magritte-design-tokens": "26.0.
|
|
33
|
-
"@hh.ru/magritte-ui-button": "7.3.
|
|
34
|
-
"@hh.ru/magritte-ui-form-helper": "2.1.
|
|
35
|
-
"@hh.ru/magritte-ui-icon": "15.1.
|
|
32
|
+
"@hh.ru/magritte-design-tokens": "26.0.1",
|
|
33
|
+
"@hh.ru/magritte-ui-button": "7.3.7",
|
|
34
|
+
"@hh.ru/magritte-ui-form-helper": "2.1.25",
|
|
35
|
+
"@hh.ru/magritte-ui-icon": "15.1.5"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "f6539d7a0e7cd42dd851458db1de04a748bbee03"
|
|
38
38
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, KeyboardEventHandler, AriaAttributes, AriaRole } from 'react';
|
|
2
|
-
import { BaseTrigger } from '
|
|
2
|
+
import { BaseTrigger } from './BaseTrigger';
|
|
3
3
|
export type LargeTriggerSize = 'large';
|
|
4
4
|
export type OtherTriggerSizes = 'medium' | 'small' | 'xsmall';
|
|
5
5
|
export type TriggerSize = LargeTriggerSize | OtherTriggerSizes;
|