@sublime-ui/ui 0.1.0 → 0.1.2

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/dist/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./layout";
1
+ export * from "./layout/index.js";
@@ -1,6 +1,6 @@
1
- export * from "./Screen";
2
- export * from "./Screen.types";
3
- export * from "./Stack";
4
- export * from "./Row";
5
- export * from "./Spacer";
6
- export * from "./Stack.types";
1
+ export * from "./Screen.js";
2
+ export * from "./Screen.types.js";
3
+ export * from "./Stack.js";
4
+ export * from "./Row.js";
5
+ export * from "./Spacer.js";
6
+ export * from "./Stack.types.js";
@@ -1,4 +1,4 @@
1
- export * from "./book";
2
- export * from "./use-nav";
3
- export * from "./types";
4
- export * from "./nav.types";
1
+ export * from "./book.js";
2
+ export * from "./use-nav.js";
3
+ export * from "./types.js";
4
+ export * from "./nav.types.js";
package/package.json CHANGED
@@ -1,61 +1,105 @@
1
- {
2
- "name": "@sublime-ui/ui",
3
- "version": "0.1.0",
4
- "description": "Cross-platform navigation (storybook → React Navigation / react-router) and layout primitives for Sublime UI.",
5
- "keywords": ["sublime-ui", "navigation", "react-navigation", "react-router", "layout", "storybook", "cross-platform", "typescript"],
6
- "homepage": "https://sublime-ui.github.io/sublime-ui/",
7
- "bugs": "https://github.com/sublime-ui/sublime-ui/issues",
8
- "repository": { "type": "git", "url": "git+https://github.com/sublime-ui/sublime-ui.git", "directory": "ui" },
9
- "license": "MIT",
10
- "author": "Aaron Mkandawire",
11
- "publishConfig": { "access": "public" },
12
- "type": "module",
13
- "exports": {
14
- ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
15
- "./navigation": { "types": "./dist/navigation/index.d.ts", "import": "./dist/navigation/index.js" },
16
- "./navigation/bridge.native": { "types": "./dist/navigation/bridge.native.d.ts", "import": "./dist/navigation/bridge.native.js" },
17
- "./navigation/bridge.web": { "types": "./dist/navigation/bridge.web.d.ts", "import": "./dist/navigation/bridge.web.js" }
18
- },
19
- "react-native": "./src/index.ts",
20
- "files": ["dist", "src"],
21
- "scripts": {
22
- "build": "tsup",
23
- "typecheck": "tsc --noEmit",
24
- "test": "vitest run --passWithNoTests",
25
- "lint": "eslint src"
26
- },
27
- "peerDependencies": {
28
- "react": ">=18",
29
- "react-native": ">=0.74",
30
- "@react-navigation/native": ">=6",
31
- "@react-navigation/native-stack": ">=6",
32
- "@react-navigation/bottom-tabs": ">=6",
33
- "@react-navigation/drawer": ">=6",
34
- "react-native-safe-area-context": ">=4",
35
- "react-router-dom": ">=6"
36
- },
37
- "peerDependenciesMeta": {
38
- "react-native": { "optional": true },
39
- "@react-navigation/native": { "optional": true },
40
- "@react-navigation/native-stack": { "optional": true },
41
- "@react-navigation/bottom-tabs": { "optional": true },
42
- "@react-navigation/drawer": { "optional": true },
43
- "react-native-safe-area-context": { "optional": true },
44
- "react-router-dom": { "optional": true }
45
- },
46
- "devDependencies": {
47
- "@react-navigation/native": "^6.1.18",
48
- "@react-navigation/native-stack": "^6.11.0",
49
- "@react-navigation/bottom-tabs": "^6.6.1",
50
- "@react-navigation/drawer": "^6.7.2",
51
- "@testing-library/react": "^16.0.1",
52
- "@types/node": "^22",
53
- "@types/react": "^18.3.12",
54
- "jsdom": "^25.0.1",
55
- "react": "^18.3.1",
56
- "react-dom": "^18.3.1",
57
- "react-native": "^0.76.1",
58
- "react-native-safe-area-context": "^4.14.0",
59
- "react-router-dom": "^6.27.0"
60
- }
61
- }
1
+ {
2
+ "name": "@sublime-ui/ui",
3
+ "version": "0.1.2",
4
+ "description": "Cross-platform navigation (storybook → React Navigation / react-router) and layout primitives for Sublime UI.",
5
+ "keywords": [
6
+ "sublime-ui",
7
+ "navigation",
8
+ "react-navigation",
9
+ "react-router",
10
+ "layout",
11
+ "storybook",
12
+ "cross-platform",
13
+ "typescript"
14
+ ],
15
+ "homepage": "https://sublime-ui.github.io/sublime-ui/",
16
+ "bugs": "https://github.com/sublime-ui/sublime-ui/issues",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/sublime-ui/sublime-ui.git",
20
+ "directory": "ui"
21
+ },
22
+ "license": "MIT",
23
+ "author": "Aaron Mkandawire",
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "type": "module",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/index.d.ts",
31
+ "import": "./dist/index.js"
32
+ },
33
+ "./navigation": {
34
+ "types": "./dist/navigation/index.d.ts",
35
+ "import": "./dist/navigation/index.js"
36
+ },
37
+ "./navigation/bridge.native": {
38
+ "types": "./dist/navigation/bridge.native.d.ts",
39
+ "import": "./dist/navigation/bridge.native.js"
40
+ },
41
+ "./navigation/bridge.web": {
42
+ "types": "./dist/navigation/bridge.web.d.ts",
43
+ "import": "./dist/navigation/bridge.web.js"
44
+ }
45
+ },
46
+ "react-native": "./src/index.ts",
47
+ "files": [
48
+ "dist",
49
+ "src"
50
+ ],
51
+ "scripts": {
52
+ "build": "tsup",
53
+ "typecheck": "tsc --noEmit",
54
+ "test": "vitest run --passWithNoTests",
55
+ "lint": "eslint src"
56
+ },
57
+ "peerDependencies": {
58
+ "react": ">=18",
59
+ "react-native": ">=0.74",
60
+ "@react-navigation/native": ">=6",
61
+ "@react-navigation/native-stack": ">=6",
62
+ "@react-navigation/bottom-tabs": ">=6",
63
+ "@react-navigation/drawer": ">=6",
64
+ "react-native-safe-area-context": ">=4",
65
+ "react-router-dom": ">=6"
66
+ },
67
+ "peerDependenciesMeta": {
68
+ "react-native": {
69
+ "optional": true
70
+ },
71
+ "@react-navigation/native": {
72
+ "optional": true
73
+ },
74
+ "@react-navigation/native-stack": {
75
+ "optional": true
76
+ },
77
+ "@react-navigation/bottom-tabs": {
78
+ "optional": true
79
+ },
80
+ "@react-navigation/drawer": {
81
+ "optional": true
82
+ },
83
+ "react-native-safe-area-context": {
84
+ "optional": true
85
+ },
86
+ "react-router-dom": {
87
+ "optional": true
88
+ }
89
+ },
90
+ "devDependencies": {
91
+ "@react-navigation/native": "^6.1.18",
92
+ "@react-navigation/native-stack": "^6.11.0",
93
+ "@react-navigation/bottom-tabs": "^6.6.1",
94
+ "@react-navigation/drawer": "^6.7.2",
95
+ "@testing-library/react": "^16.0.1",
96
+ "@types/node": "^22",
97
+ "@types/react": "^18.3.12",
98
+ "jsdom": "^25.0.1",
99
+ "react": "^18.3.1",
100
+ "react-dom": "^18.3.1",
101
+ "react-native": "^0.76.1",
102
+ "react-native-safe-area-context": "^4.14.0",
103
+ "react-router-dom": "^6.27.0"
104
+ }
105
+ }
package/src/index.ts CHANGED
@@ -1 +1 @@
1
- export * from './layout';
1
+ export * from './layout/index.js';
@@ -1,6 +1,6 @@
1
1
  import { View } from 'react-native';
2
2
  import type { ViewStyle } from 'react-native';
3
- import type { FlexAlign, FlexJustify, RowProps } from './Stack.types';
3
+ import type { FlexAlign, FlexJustify, RowProps } from './Stack.types.js';
4
4
 
5
5
  const ALIGN: Record<FlexAlign, ViewStyle['alignItems']> = {
6
6
  start: 'flex-start',
@@ -1,5 +1,5 @@
1
1
  import type { CSSProperties } from 'react';
2
- import type { FlexAlign, FlexJustify, RowProps } from './Stack.types';
2
+ import type { FlexAlign, FlexJustify, RowProps } from './Stack.types.js';
3
3
 
4
4
  const ALIGN: Record<FlexAlign, CSSProperties['alignItems']> = {
5
5
  start: 'flex-start',
@@ -1,6 +1,6 @@
1
1
  import { SafeAreaView } from 'react-native-safe-area-context';
2
2
  import { ScrollView, View } from 'react-native';
3
- import type { ScreenProps } from './Screen.types';
3
+ import type { ScreenProps } from './Screen.types.js';
4
4
 
5
5
  export function Screen({ children, scroll, padded = true, testID }: ScreenProps) {
6
6
  const inner = <View style={{ padding: padded ? 16 : 0, flex: 1 }}>{children}</View>;
@@ -1,4 +1,4 @@
1
- import type { ScreenProps } from './Screen.types';
1
+ import type { ScreenProps } from './Screen.types.js';
2
2
 
3
3
  export function Screen({ children, padded = true, testID }: ScreenProps) {
4
4
  return (
@@ -1,6 +1,6 @@
1
1
  import { View } from 'react-native';
2
2
  import type { ViewStyle } from 'react-native';
3
- import type { SpacerProps } from './Stack.types';
3
+ import type { SpacerProps } from './Stack.types.js';
4
4
 
5
5
  export function Spacer({ size }: SpacerProps) {
6
6
  const style: ViewStyle = {
@@ -1,5 +1,5 @@
1
1
  import type { CSSProperties } from 'react';
2
- import type { SpacerProps } from './Stack.types';
2
+ import type { SpacerProps } from './Stack.types.js';
3
3
 
4
4
  export function Spacer({ size }: SpacerProps) {
5
5
  const style: CSSProperties = {
@@ -1,6 +1,6 @@
1
1
  import { View } from 'react-native';
2
2
  import type { ViewStyle } from 'react-native';
3
- import type { FlexAlign, FlexJustify, FlexProps } from './Stack.types';
3
+ import type { FlexAlign, FlexJustify, FlexProps } from './Stack.types.js';
4
4
 
5
5
  const ALIGN: Record<FlexAlign, ViewStyle['alignItems']> = {
6
6
  start: 'flex-start',
@@ -1,5 +1,5 @@
1
1
  import type { CSSProperties } from 'react';
2
- import type { FlexAlign, FlexJustify, FlexProps } from './Stack.types';
2
+ import type { FlexAlign, FlexJustify, FlexProps } from './Stack.types.js';
3
3
 
4
4
  const ALIGN: Record<FlexAlign, CSSProperties['alignItems']> = {
5
5
  start: 'flex-start',
@@ -1,6 +1,6 @@
1
- export * from './Screen';
2
- export * from './Screen.types';
3
- export * from './Stack';
4
- export * from './Row';
5
- export * from './Spacer';
6
- export * from './Stack.types';
1
+ export * from './Screen.js';
2
+ export * from './Screen.types.js';
3
+ export * from './Stack.js';
4
+ export * from './Row.js';
5
+ export * from './Spacer.js';
6
+ export * from './Stack.types.js';
@@ -1,6 +1,6 @@
1
1
  import type {
2
2
  BookDef, Entry, LinkDef, PageDef, PageOptions, PrintFormat, RouteMap,
3
- } from './types';
3
+ } from './types.js';
4
4
 
5
5
  export function page<P = void>(component: unknown, options: PageOptions = {}): PageDef<P> {
6
6
  return { kind: 'page', component, options };
@@ -1,5 +1,5 @@
1
1
  import { useNavigation, useRoute } from '@react-navigation/native';
2
- import type { Nav } from './nav.types';
2
+ import type { Nav } from './nav.types.js';
3
3
 
4
4
  export function useNativeNav(): Nav {
5
5
  // react-navigation's hook is generic over the app's param list, which is only
@@ -1,5 +1,5 @@
1
1
  import { useNavigate, useLocation, useParams } from 'react-router-dom';
2
- import type { Nav } from './nav.types';
2
+ import type { Nav } from './nav.types.js';
3
3
 
4
4
  export function useWebNav(
5
5
  pathOf: (name: string, params?: unknown) => string,
@@ -1,4 +1,4 @@
1
- export * from './book';
2
- export * from './use-nav';
3
- export * from './types';
4
- export * from './nav.types';
1
+ export * from './book.js';
2
+ export * from './use-nav.js';
3
+ export * from './types.js';
4
+ export * from './nav.types.js';
@@ -1,6 +1,6 @@
1
1
  import { createContext, createElement, useContext, type ReactNode } from 'react';
2
- import type { Nav, TypedNav } from './nav.types';
3
- import type { RouteMap } from './types';
2
+ import type { Nav, TypedNav } from './nav.types.js';
3
+ import type { RouteMap } from './types.js';
4
4
 
5
5
  export const NavContext = createContext<Nav | null>(null);
6
6