app-studio 0.7.18 → 0.8.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.
- package/README.md +87 -33
- package/dist/native/index.cjs +3360 -0
- package/dist/native/index.cjs.map +1 -0
- package/dist/native/index.d.mts +251 -0
- package/dist/native/index.d.ts +251 -0
- package/dist/native/index.js +3268 -0
- package/dist/native/index.js.map +1 -0
- package/dist/viewAnimation-B4BIoOwQ.d.mts +2246 -0
- package/dist/viewAnimation-B4BIoOwQ.d.ts +2246 -0
- package/dist/web/app-studio.umd.production.min.global.js +28 -0
- package/dist/web/app-studio.umd.production.min.global.js.map +1 -0
- package/dist/web/index.cjs +6109 -0
- package/dist/web/index.cjs.map +1 -0
- package/dist/web/index.d.mts +638 -0
- package/dist/web/index.d.ts +638 -0
- package/dist/web/index.js +6008 -0
- package/dist/web/index.js.map +1 -0
- package/docs/Animation.md +2 -0
- package/docs/Components.md +12 -0
- package/docs/Design.md +2 -0
- package/docs/Events.md +2 -0
- package/docs/Hooks.md +2 -0
- package/docs/IframeSupport.md +2 -0
- package/docs/Native.md +428 -0
- package/docs/Providers.md +2 -0
- package/docs/README.md +14 -1
- package/docs/Responsive.md +2 -0
- package/docs/Styling.md +2 -0
- package/docs/Theming.md +53 -0
- package/package.json +76 -14
- package/dist/app-studio.cjs.development.js +0 -6754
- package/dist/app-studio.cjs.development.js.map +0 -1
- package/dist/app-studio.cjs.production.min.js +0 -2
- package/dist/app-studio.cjs.production.min.js.map +0 -1
- package/dist/app-studio.esm.js +0 -6650
- package/dist/app-studio.esm.js.map +0 -1
- package/dist/app-studio.umd.development.js +0 -6757
- package/dist/app-studio.umd.development.js.map +0 -1
- package/dist/app-studio.umd.production.min.js +0 -2
- package/dist/app-studio.umd.production.min.js.map +0 -1
- package/dist/components/Form.d.ts +0 -17
- package/dist/components/Image.d.ts +0 -7
- package/dist/components/Skeleton.d.ts +0 -3
- package/dist/components/Text/Text.props.d.ts +0 -27
- package/dist/components/Text/Text.type.d.ts +0 -3
- package/dist/components/Text/Text.utils.d.ts +0 -2
- package/dist/components/Text/Text.view.d.ts +0 -20
- package/dist/components/Text.d.ts +0 -5
- package/dist/components/View.d.ts +0 -16
- package/dist/components/Wrapper.d.ts +0 -4
- package/dist/element/Animation.d.ts +0 -1164
- package/dist/element/Element.d.ts +0 -4
- package/dist/element/Element.types.d.ts +0 -123
- package/dist/element/css.d.ts +0 -50
- package/dist/element/utils.d.ts +0 -4
- package/dist/hooks/useActive.d.ts +0 -2
- package/dist/hooks/useClickOutside.d.ts +0 -6
- package/dist/hooks/useElementPosition.d.ts +0 -39
- package/dist/hooks/useFocus.d.ts +0 -2
- package/dist/hooks/useHover.d.ts +0 -2
- package/dist/hooks/useIframeStyles.d.ts +0 -41
- package/dist/hooks/useInView.d.ts +0 -11
- package/dist/hooks/useKeyPress.d.ts +0 -1
- package/dist/hooks/useMount.d.ts +0 -1
- package/dist/hooks/useOnScreen.d.ts +0 -6
- package/dist/hooks/useResponsive.d.ts +0 -59
- package/dist/hooks/useScroll.d.ts +0 -49
- package/dist/hooks/useWindowSize.d.ts +0 -4
- package/dist/index.d.ts +0 -33
- package/dist/index.js +0 -8
- package/dist/providers/Analytics.d.ts +0 -9
- package/dist/providers/Responsive.d.ts +0 -58
- package/dist/providers/StyleRegistry.d.ts +0 -32
- package/dist/providers/Theme.d.ts +0 -46
- package/dist/providers/WindowSize.d.ts +0 -11
- package/dist/stories/AnimateOn.stories.d.ts +0 -30
- package/dist/stories/Animation.stories.d.ts +0 -35
- package/dist/stories/BorderColor.stories.d.ts +0 -4
- package/dist/stories/Color.stories.d.ts +0 -4
- package/dist/stories/ColorAlpha.stories.d.ts +0 -5
- package/dist/stories/Component.stories.d.ts +0 -7
- package/dist/stories/CrossBrowserCompatibility.stories.d.ts +0 -6
- package/dist/stories/CssCascadeOrder.stories.d.ts +0 -10
- package/dist/stories/EmptyBeforeExample.stories.d.ts +0 -7
- package/dist/stories/EventHandlers.stories.d.ts +0 -6
- package/dist/stories/GradientColors.stories.d.ts +0 -6
- package/dist/stories/GroupPeer.stories.d.ts +0 -7
- package/dist/stories/Hooks.stories.d.ts +0 -17
- package/dist/stories/IframeCSSSupport.stories.d.ts +0 -28
- package/dist/stories/IframeSupport.stories.d.ts +0 -20
- package/dist/stories/Image.stories.d.ts +0 -6
- package/dist/stories/Scroll.stories.d.ts +0 -9
- package/dist/stories/ScrollAnimation.stories.d.ts +0 -36
- package/dist/stories/ScrollTimeline.stories.d.ts +0 -6
- package/dist/stories/Skeleton.stories.d.ts +0 -5
- package/dist/stories/Text.stories.d.ts +0 -18
- package/dist/stories/VendorPrefix.stories.d.ts +0 -6
- package/dist/stories/View.stories.d.ts +0 -10
- package/dist/stories/ViewAnimation.stories.d.ts +0 -33
- package/dist/test/CssVariablesTest.d.ts +0 -3
- package/dist/test/LowercaseVendorPrefixTest.d.ts +0 -3
- package/dist/test/VendorPrefixTest.d.ts +0 -3
- package/dist/test/WebkitTextStrokeTest.d.ts +0 -3
- package/dist/types/scrollAnimation.types.d.ts +0 -75
- package/dist/utils/colors.d.ts +0 -21
- package/dist/utils/constants.d.ts +0 -24
- package/dist/utils/cssProperties.d.ts +0 -8
- package/dist/utils/env.d.ts +0 -15
- package/dist/utils/hash.d.ts +0 -4
- package/dist/utils/shadow.d.ts +0 -10
- package/dist/utils/style.d.ts +0 -22
- package/dist/utils/typography.d.ts +0 -45
- package/dist/utils/vendorPrefixes.d.ts +0 -19
- package/dist/utils/viewAnimation.d.ts +0 -138
package/docs/Theming.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Theming is an essential part of any application. It allows you to maintain a consistent look and feel across your app. With App-Studio, theming becomes effortless through its `ThemeProvider` component. This document shows you how to set up theming in App-Studio.
|
|
4
4
|
|
|
5
|
+
> **React Native:** the entire color system documented here (singletons, palettes, theme tokens, `light-`/`dark-` prefixes, alpha shorthand, component-level `theme` overrides) works identically on native. The only implementation difference: on web, alpha colors compile to `color-mix(...)` CSS; on native the theme provider returns concrete hex/rgba strings that get substituted into RN style props. See [Native.md → Theme & Color Resolution](Native.md#theme--color-resolution).
|
|
6
|
+
|
|
5
7
|
## Available Colors Reference
|
|
6
8
|
|
|
7
9
|
App-Studio provides an extensive color system with three types of colors:
|
|
@@ -413,6 +415,57 @@ function Example() {
|
|
|
413
415
|
|
|
414
416
|
This direct access syntax works with all color-related properties and can be used with both singleton colors (like `white`, `black`) and palette colors (like `red-200`, `blue-500`). It provides a convenient way to reference specific theme colors without having to use the `getColor` function from the `useTheme` hook.
|
|
415
417
|
|
|
418
|
+
### Component-Level Sub-Theming
|
|
419
|
+
|
|
420
|
+
Any component that extends `Element` (`View`, `Text`, `Button`, etc.) accepts a `theme` prop that remaps `theme-*` tokens **for that single component**, without touching the global `ThemeProvider`. Useful when a screen needs one "branded" element (a Startup Studio launch button, a special card, a colored chip) while the rest of the UI keeps the global palette.
|
|
421
|
+
|
|
422
|
+
```javascript
|
|
423
|
+
import { View, Text } from 'app-studio';
|
|
424
|
+
|
|
425
|
+
function Example() {
|
|
426
|
+
return (
|
|
427
|
+
<View>
|
|
428
|
+
{/* Global theme-primary (no override) */}
|
|
429
|
+
<View backgroundColor="theme-primary" padding={20}>
|
|
430
|
+
<Text color="color-white">Global primary</Text>
|
|
431
|
+
</View>
|
|
432
|
+
|
|
433
|
+
{/* Same component, locally remapped to red */}
|
|
434
|
+
<View
|
|
435
|
+
backgroundColor="theme-primary"
|
|
436
|
+
theme={{ primary: 'color-red-500' }}
|
|
437
|
+
padding={20}
|
|
438
|
+
>
|
|
439
|
+
<Text color="color-white">Local primary = red-500</Text>
|
|
440
|
+
</View>
|
|
441
|
+
|
|
442
|
+
{/* Multiple slots at once */}
|
|
443
|
+
<View
|
|
444
|
+
backgroundColor="theme-primary"
|
|
445
|
+
borderColor="theme-secondary"
|
|
446
|
+
borderWidth={2}
|
|
447
|
+
borderStyle="solid"
|
|
448
|
+
theme={{
|
|
449
|
+
primary: 'color-indigo-600',
|
|
450
|
+
secondary: 'color-yellow-400',
|
|
451
|
+
}}
|
|
452
|
+
padding={20}
|
|
453
|
+
>
|
|
454
|
+
<Text color="color-white">indigo bg, yellow border</Text>
|
|
455
|
+
</View>
|
|
456
|
+
</View>
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
```
|
|
460
|
+
|
|
461
|
+
**What the `theme` prop accepts**: a `Partial<Theme>` where each value is itself a color token (`'color-red-500'`, `'theme-secondary'`) or a direct color string (`'#ff0000'`). The keys match the global `Theme` shape (`primary`, `secondary`, `success`, `error`, `warning`, `disabled`, `loading`).
|
|
462
|
+
|
|
463
|
+
**Alpha suffix works**: `theme-primary-200` on a component with `theme={{ primary: 'color-red-500' }}` resolves to `color-red-500` at 20% opacity via `color-mix()`.
|
|
464
|
+
|
|
465
|
+
**Dark mode**: overrides that point at palette tokens (e.g., `'color-red-500'`) keep responding to global dark-mode switching, because the resolution returns the underlying CSS variable. Overrides that point at raw hex literals (`'#ff0000'`) bypass the palette and do **not** swap with dark mode — use palette tokens whenever you need dark-mode reactivity.
|
|
466
|
+
|
|
467
|
+
**Scope**: the override applies only to the Element receiving the `theme` prop. Children that re-use `theme-primary` resolve against the global theme, not the parent's override. To remap an entire subtree, wrap it in a nested `ThemeProvider` instead, or set the `theme` prop on each child.
|
|
468
|
+
|
|
416
469
|
### Smart Text Contrast
|
|
417
470
|
|
|
418
471
|
For text that needs to be visible on any background color (light, dark, or dynamic gradients), App-Studio provides a smart contrast feature.
|
package/package.json
CHANGED
|
@@ -1,14 +1,53 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.8.1",
|
|
3
3
|
"name": "app-studio",
|
|
4
4
|
"description": "App Studio is a responsive and themeable framework to build cross platform applications",
|
|
5
5
|
"repository": "git@github.com:rize-network/app-studio.git",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bugs": "https://github.com/rize-network/app-studio/issues",
|
|
8
|
-
"main": "dist/index.
|
|
9
|
-
"module": "dist/
|
|
10
|
-
"unpkg": "dist/app-studio.umd.production.min.js",
|
|
11
|
-
"typings": "dist/index.d.ts",
|
|
8
|
+
"main": "dist/web/index.cjs",
|
|
9
|
+
"module": "dist/web/index.js",
|
|
10
|
+
"unpkg": "dist/web/app-studio.umd.production.min.global.js",
|
|
11
|
+
"typings": "dist/web/index.d.ts",
|
|
12
|
+
"types": "dist/web/index.d.ts",
|
|
13
|
+
"react-native": "dist/native/index.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"react-native": {
|
|
17
|
+
"types": "./dist/native/index.d.ts",
|
|
18
|
+
"import": "./dist/native/index.js",
|
|
19
|
+
"require": "./dist/native/index.cjs",
|
|
20
|
+
"default": "./dist/native/index.js"
|
|
21
|
+
},
|
|
22
|
+
"browser": {
|
|
23
|
+
"types": "./dist/web/index.d.ts",
|
|
24
|
+
"import": "./dist/web/index.js",
|
|
25
|
+
"require": "./dist/web/index.cjs",
|
|
26
|
+
"default": "./dist/web/index.js"
|
|
27
|
+
},
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./dist/web/index.d.ts",
|
|
30
|
+
"default": "./dist/web/index.js"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./dist/web/index.d.ts",
|
|
34
|
+
"default": "./dist/web/index.cjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"./web": {
|
|
38
|
+
"types": "./dist/web/index.d.ts",
|
|
39
|
+
"import": "./dist/web/index.js",
|
|
40
|
+
"require": "./dist/web/index.cjs",
|
|
41
|
+
"default": "./dist/web/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./native": {
|
|
44
|
+
"types": "./dist/native/index.d.ts",
|
|
45
|
+
"import": "./dist/native/index.js",
|
|
46
|
+
"require": "./dist/native/index.cjs",
|
|
47
|
+
"default": "./dist/native/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./package.json": "./package.json"
|
|
50
|
+
},
|
|
12
51
|
"sideEffects": false,
|
|
13
52
|
"keywords": [
|
|
14
53
|
"react",
|
|
@@ -29,8 +68,11 @@
|
|
|
29
68
|
"node": ">=10"
|
|
30
69
|
},
|
|
31
70
|
"scripts": {
|
|
32
|
-
"start": "
|
|
33
|
-
"build": "
|
|
71
|
+
"start": "tsup --watch",
|
|
72
|
+
"build": "tsup",
|
|
73
|
+
"typecheck": "npm run typecheck:web && npm run typecheck:native",
|
|
74
|
+
"typecheck:web": "tsc -p tsconfig.web.json --noEmit",
|
|
75
|
+
"typecheck:native": "tsc -p tsconfig.native.json --noEmit",
|
|
34
76
|
"test": "tsdx test --passWithNoTests",
|
|
35
77
|
"test:e2e": "ts-node test/webdriver/data-testid.test.ts && ts-node test/webdriver/component-tests.test.ts && ts-node test/webdriver/form-components.test.ts",
|
|
36
78
|
"lint": "npm run eslint && npm run prettier",
|
|
@@ -53,6 +95,12 @@
|
|
|
53
95
|
"setupFilesAfterEnv": [
|
|
54
96
|
"./test/setupTests.ts"
|
|
55
97
|
],
|
|
98
|
+
"moduleNameMapper": {
|
|
99
|
+
"^react-native$": "<rootDir>/test/jest/native/reactNativeMock.tsx"
|
|
100
|
+
},
|
|
101
|
+
"transformIgnorePatterns": [
|
|
102
|
+
"node_modules/(?!(@react-native|react-native|@testing-library/react-native)/)"
|
|
103
|
+
],
|
|
56
104
|
"testMatch": [
|
|
57
105
|
"<rootDir>/test/jest/**/*.test.{ts,tsx}"
|
|
58
106
|
]
|
|
@@ -74,16 +122,16 @@
|
|
|
74
122
|
},
|
|
75
123
|
"size-limit": [
|
|
76
124
|
{
|
|
77
|
-
"path": "dist/
|
|
78
|
-
"limit": "
|
|
125
|
+
"path": "dist/web/index.cjs",
|
|
126
|
+
"limit": "180 KB"
|
|
79
127
|
},
|
|
80
128
|
{
|
|
81
|
-
"path": "dist/
|
|
82
|
-
"limit": "
|
|
129
|
+
"path": "dist/web/index.js",
|
|
130
|
+
"limit": "180 KB"
|
|
83
131
|
},
|
|
84
132
|
{
|
|
85
|
-
"path": "dist/app-studio.umd.production.min.js",
|
|
86
|
-
"limit": "
|
|
133
|
+
"path": "dist/web/app-studio.umd.production.min.global.js",
|
|
134
|
+
"limit": "125 KB"
|
|
87
135
|
}
|
|
88
136
|
],
|
|
89
137
|
"dependencies": {
|
|
@@ -112,7 +160,10 @@
|
|
|
112
160
|
"@testing-library/jest-dom": "^6.9.1",
|
|
113
161
|
"@testing-library/react": "^12.1.5",
|
|
114
162
|
"@testing-library/react-hooks": "^8.0.1",
|
|
163
|
+
"@testing-library/react-native": "^13.3.3",
|
|
115
164
|
"@types/color": "^3.0.6",
|
|
165
|
+
"@types/jest": "^30.0.0",
|
|
166
|
+
"@types/node": "^20.19.39",
|
|
116
167
|
"@types/react": "^17.0.0",
|
|
117
168
|
"@types/react-dom": "^17.0.0",
|
|
118
169
|
"@types/selenium-webdriver": "^4.35.5",
|
|
@@ -139,6 +190,7 @@
|
|
|
139
190
|
"prettier": "^3.0.3",
|
|
140
191
|
"react": "^17.0.2",
|
|
141
192
|
"react-dom": "^17.0.2",
|
|
193
|
+
"react-native": "^0.79.7",
|
|
142
194
|
"react-test-renderer": "^17.0.2",
|
|
143
195
|
"release-it": "^16.2.1",
|
|
144
196
|
"rollup-plugin-terser": "^7.0.2",
|
|
@@ -148,10 +200,20 @@
|
|
|
148
200
|
"ts-node": "^10.9.2",
|
|
149
201
|
"tsdx": "^0.14.1",
|
|
150
202
|
"tslib": "^2.6.2",
|
|
203
|
+
"tsup": "^8.5.1",
|
|
151
204
|
"typescript": "^5.2.2"
|
|
152
205
|
},
|
|
153
206
|
"peerDependencies": {
|
|
154
207
|
"react": ">=17",
|
|
155
|
-
"react-dom": ">=17"
|
|
208
|
+
"react-dom": ">=17",
|
|
209
|
+
"react-native": ">=0.79"
|
|
210
|
+
},
|
|
211
|
+
"peerDependenciesMeta": {
|
|
212
|
+
"react-dom": {
|
|
213
|
+
"optional": true
|
|
214
|
+
},
|
|
215
|
+
"react-native": {
|
|
216
|
+
"optional": true
|
|
217
|
+
}
|
|
156
218
|
}
|
|
157
219
|
}
|