creactive 0.0.68 → 0.0.70
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/build/classic.js +2 -5
- package/build/classic.js.LICENSE.txt +15 -0
- package/build/contexts/theme/wrapper.d.ts +2 -0
- package/build/default.js +1 -1
- package/build/default.js.LICENSE.txt +15 -0
- package/build/helpers/index.d.ts +3 -0
- package/build/helpers/storybook/constants/control.d.ts +22 -0
- package/build/helpers/storybook/constants/index.d.ts +1 -0
- package/build/helpers/storybook/control.d.ts +87 -0
- package/build/helpers/storybook/index.d.ts +1 -0
- package/build/helpers/style/index.d.ts +1 -1
- package/build/helpers/style/style.d.ts +2 -0
- package/build/helpers/style/style.types.d.ts +1 -1
- package/package.json +11 -5
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
object-assign
|
|
3
|
+
(c) Sindre Sorhus
|
|
4
|
+
@license MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/*!
|
|
8
|
+
* The buffer module from node.js, for the browser.
|
|
9
|
+
*
|
|
10
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
11
|
+
* @license MIT
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
15
|
+
|
|
1
16
|
/**
|
|
2
17
|
* @license React
|
|
3
18
|
* react-jsx-runtime.production.min.js
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storybook control type enum for control helper.
|
|
3
|
+
* Should be used to build control instead of literal values.
|
|
4
|
+
* Feel free to extend this enum with new control types if required.
|
|
5
|
+
*/
|
|
6
|
+
export declare const enum StorybookControlType {
|
|
7
|
+
SELECT = "select",
|
|
8
|
+
TEXT = "text",
|
|
9
|
+
NUMBER = "number"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Storybook control undefined option.
|
|
13
|
+
* Optional enum controls are supposed to have undefined value option.
|
|
14
|
+
* This option is supposed to be mapped to undefined value in control mapping.
|
|
15
|
+
*/
|
|
16
|
+
export declare const STORYBOOK_CONTROL_UNDEFINED_OPTION = "-";
|
|
17
|
+
/**
|
|
18
|
+
* Storybook control numeric enum flag.
|
|
19
|
+
* We pass this flag throug storybook inside control object.
|
|
20
|
+
* Allows to handle this flag later, inside decorator if we need.
|
|
21
|
+
*/
|
|
22
|
+
export declare const STORYBOOK_CONTROL_NUMERIC_ENUM_FLAG = "isCreactiveStorybookNumericEnum";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './control';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Decorator, StoryContext } from '@storybook/react';
|
|
2
|
+
import { StorybookControlType } from './constants';
|
|
3
|
+
/**
|
|
4
|
+
* Modifies context arguments to handle numeric enum controls.
|
|
5
|
+
* Numeric enum values are passed as strings by storybook controls.
|
|
6
|
+
* Seems like this happens because of select control implementation.
|
|
7
|
+
* This method is exported for test here, but should not be exported ouside.
|
|
8
|
+
*/
|
|
9
|
+
export declare const modifyContextNumericEnumControls: (context: StoryContext) => {
|
|
10
|
+
args: {
|
|
11
|
+
[x: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
loaded: Record<string, any>;
|
|
14
|
+
abortSignal: AbortSignal;
|
|
15
|
+
canvasElement: HTMLElement;
|
|
16
|
+
hooks: unknown;
|
|
17
|
+
originalStoryFn: import("@storybook/csf").StoryFn<import("@storybook/react").ReactRenderer, import("@storybook/csf").Args>;
|
|
18
|
+
viewMode: import("@storybook/csf").ViewMode;
|
|
19
|
+
step: import("@storybook/csf").StepFunction<import("@storybook/react").ReactRenderer, import("@storybook/csf").StrictArgs>;
|
|
20
|
+
context: StoryContext;
|
|
21
|
+
canvas: import("@storybook/csf").Canvas;
|
|
22
|
+
mount: (ui?: JSX.Element) => Promise<import("@storybook/csf").Canvas>;
|
|
23
|
+
component?: import("react").ComponentType<any>;
|
|
24
|
+
subcomponents?: Record<string, import("react").ComponentType<any>>;
|
|
25
|
+
parameters: import("@storybook/csf").Parameters;
|
|
26
|
+
initialArgs: import("@storybook/csf").StrictArgs;
|
|
27
|
+
argTypes: import("@storybook/csf").StrictArgTypes<import("@storybook/csf").StrictArgs>;
|
|
28
|
+
componentId: import("@storybook/csf").ComponentId;
|
|
29
|
+
title: import("@storybook/csf").ComponentTitle;
|
|
30
|
+
kind: import("@storybook/csf").ComponentTitle;
|
|
31
|
+
id: import("@storybook/csf").StoryId;
|
|
32
|
+
name: import("@storybook/csf").StoryName;
|
|
33
|
+
story: import("@storybook/csf").StoryName;
|
|
34
|
+
tags: import("@storybook/csf").Tag[];
|
|
35
|
+
globals: import("@storybook/csf").Globals;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Storybook control helpers.
|
|
39
|
+
* Collected into a single class for convenient import.
|
|
40
|
+
* Helps to build storybook control objects for components stories.
|
|
41
|
+
*/
|
|
42
|
+
export declare const StorybookControl: {
|
|
43
|
+
/**
|
|
44
|
+
* Builds a story object form provided numeric enum.
|
|
45
|
+
* Numeric enum will be mapped to storybook select control.
|
|
46
|
+
*
|
|
47
|
+
* @param target - target numeric enum for control
|
|
48
|
+
* @param isOptional - whether control is optional
|
|
49
|
+
*/
|
|
50
|
+
fromNumericEnum(target: Record<string, number>, isOptional?: boolean): {
|
|
51
|
+
control: {
|
|
52
|
+
isCreactiveStorybookNumericEnum: boolean;
|
|
53
|
+
type: StorybookControlType;
|
|
54
|
+
labels: Record<number, string>;
|
|
55
|
+
};
|
|
56
|
+
options: number[];
|
|
57
|
+
defaultValue: number;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Builds a story object for numeric input control.
|
|
61
|
+
* Numeric input will be mapped to storybook number control.
|
|
62
|
+
*
|
|
63
|
+
* @param defaultValue - can be provided to set default value
|
|
64
|
+
*/
|
|
65
|
+
forNumber(defaultValue?: number): {
|
|
66
|
+
control: {
|
|
67
|
+
type: StorybookControlType;
|
|
68
|
+
};
|
|
69
|
+
defaultValue: number;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Returns default children control.
|
|
73
|
+
* Keeps storybook control factory logic together.
|
|
74
|
+
* Also allows to avoid faker import in every story file.
|
|
75
|
+
*/
|
|
76
|
+
forChildren(): {
|
|
77
|
+
control: {
|
|
78
|
+
type: StorybookControlType;
|
|
79
|
+
};
|
|
80
|
+
defaultValue: string;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Returns decorator for storybook stories.
|
|
84
|
+
* This decorator should apply some context modifications.
|
|
85
|
+
*/
|
|
86
|
+
getDecorator(): Decorator;
|
|
87
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StorybookControl } from './control';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { renderStyle } from './style';
|
|
1
|
+
export { getStyleCache, renderStyle } from './style';
|
|
2
2
|
export type { RenderStyleHelper } from './style.types';
|
|
@@ -7,4 +7,4 @@ import type { ComponentType, JSX } from 'react';
|
|
|
7
7
|
* @see https://necolas.github.io/react-native-web/docs/rendering/
|
|
8
8
|
* @see https://docs.expo.dev/guides/using-nextjs/
|
|
9
9
|
*/
|
|
10
|
-
export type RenderStyleHelper = (component: ComponentType,
|
|
10
|
+
export type RenderStyleHelper = (component: ComponentType, html: string) => JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "creactive",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.70",
|
|
4
4
|
"main": "build/default.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"build/**"
|
|
@@ -14,25 +14,31 @@
|
|
|
14
14
|
"test:ios": "jest",
|
|
15
15
|
"test:web": "jest",
|
|
16
16
|
"lint": "expo lint",
|
|
17
|
-
"build": "npm run build:default && npm run build:
|
|
17
|
+
"build": "npm run build:default && npm run build:classic && npm run build:types",
|
|
18
18
|
"build:default": "webpack --mode production",
|
|
19
|
-
"build:
|
|
19
|
+
"build:classic": "webpack --mode production",
|
|
20
20
|
"build:types": "tsc -p tsconfig.types.json && tsc-alias -p tsconfig.types.json",
|
|
21
21
|
"prepublishOnly": "npm run build && node scripts/update-package.js build/default.js",
|
|
22
22
|
"postpublish": "node scripts/update-package.js .storybook"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
+
"@emotion/cache": ">= 11 < 12",
|
|
26
|
+
"@emotion/react": ">= 11 < 12",
|
|
27
|
+
"@emotion/server": ">= 11 < 12",
|
|
28
|
+
"@emotion/styled": ">= 11 < 12",
|
|
25
29
|
"react": ">= 18 < 19",
|
|
26
30
|
"react-dom": ">= 18 < 19",
|
|
27
31
|
"react-native": ">= 0.68 < 0.78",
|
|
28
|
-
"react-native-web": ">= 0.18"
|
|
29
|
-
"@emotion/styled": ">= 11 < 12"
|
|
32
|
+
"react-native-web": ">= 0.18"
|
|
30
33
|
},
|
|
31
34
|
"devDependencies": {
|
|
32
35
|
"@babel/core": "^7.25.2",
|
|
33
36
|
"@babel/preset-env": "^7.26.9",
|
|
34
37
|
"@babel/preset-react": "^7.26.3",
|
|
35
38
|
"@babel/preset-typescript": "^7.27.0",
|
|
39
|
+
"@emotion/cache": "^11.14.0",
|
|
40
|
+
"@emotion/react": "^11.14.0",
|
|
41
|
+
"@emotion/server": "^11.11.0",
|
|
36
42
|
"@emotion/styled": "^11.14.0",
|
|
37
43
|
"@faker-js/faker": "^9.2.0",
|
|
38
44
|
"@react-native-async-storage/async-storage": "^1.23.1",
|