@krapwoo/ds-viewer 0.4.3 → 0.4.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krapwoo/ds-viewer",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "A browsable, always-current catalog for an Expo / React Native design system.",
@@ -8,6 +8,10 @@
8
8
  "type": "git",
9
9
  "url": "https://github.com/krapwoo/design-system-viewer.git"
10
10
  },
11
+ "bugs": {
12
+ "url": "https://github.com/krapwoo/design-system-viewer/issues"
13
+ },
14
+ "homepage": "https://github.com/krapwoo/design-system-viewer#readme",
11
15
  "engines": {
12
16
  "node": ">=20.19.0"
13
17
  },
@@ -57,6 +61,7 @@
57
61
  },
58
62
  "scripts": {
59
63
  "build": "tsc -p tsconfig.json",
64
+ "prepack": "npm run build",
60
65
  "test": "node --experimental-strip-types --test 'cli/**/*.test.ts' 'config/**/*.test.ts' 'native/catalog/__tests__/*.test.ts'",
61
66
  "typecheck": "tsc -p tsconfig.json --noEmit",
62
67
  "kit:dev": "npm run build && cd kit-host && node node_modules/@krapwoo/ds-viewer/dist/cli/main.js dev",
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { View, Text, StyleSheet } from 'react-native';
3
- import { defineCatalogPage, DividedStack, VariantGroup, TokenRow } from '@krapwoo/ds-viewer';
2
+ import { View, Text, StyleSheet, Easing } from 'react-native';
3
+ import { defineCatalogPage, DividedStack, VariantGroup, TokenRow, MotionSpecimen } from '@krapwoo/ds-viewer';
4
4
  import {
5
5
  DS_MOTION_DURATION,
6
6
  DS_MOTION_DURATION_STEPS,
@@ -21,6 +21,7 @@ import {
21
21
 
22
22
  const styles = StyleSheet.create({
23
23
  tokenStack: { gap: DS_SPACING[800] },
24
+ rowContent: { gap: DS_SPACING[400] },
24
25
  previewRow: { flexDirection: 'row', alignItems: 'center', gap: DS_SPACING[600] },
25
26
  previewLabel: { minWidth: 64, ...DS_TYPOGRAPHY.labelSm, color: DS_SEMANTIC.text.regular },
26
27
  previewValue: { ...DS_TYPOGRAPHY.bodyXs, color: DS_SEMANTIC.text.muted },
@@ -41,10 +42,18 @@ function MotionGallery() {
41
42
  <View style={styles.tokenStack}>
42
43
  {DS_MOTION_DURATION_STEPS.map((step, i) => (
43
44
  <TokenRow key={step} use={DS_MOTION_DURATION_USE[step]} last={i === DS_MOTION_DURATION_STEPS.length - 1}>
44
- <View style={styles.previewRow}>
45
- <Text style={styles.previewLabel}>{step}</Text>
46
- <View style={[styles.durationBar, { width: (DS_MOTION_DURATION[step] / maxDuration) * 120 }]} />
47
- <Text style={styles.previewValue}>{DS_MOTION_DURATION[step]}ms</Text>
45
+ <View style={styles.rowContent}>
46
+ <View style={styles.previewRow}>
47
+ <Text style={styles.previewLabel}>{step}</Text>
48
+ <View style={[styles.durationBar, { width: (DS_MOTION_DURATION[step] / maxDuration) * 120 }]} />
49
+ <Text style={styles.previewValue}>{DS_MOTION_DURATION[step]}ms</Text>
50
+ </View>
51
+ <MotionSpecimen
52
+ kind="timing"
53
+ duration={DS_MOTION_DURATION[step]}
54
+ easing={Easing.bezier(...DS_MOTION_EASING.standard)}
55
+ label={`${DS_MOTION_DURATION[step]}ms · standard easing`}
56
+ />
48
57
  </View>
49
58
  </TokenRow>
50
59
  ))}
@@ -54,10 +63,18 @@ function MotionGallery() {
54
63
  <View style={styles.tokenStack}>
55
64
  {DS_MOTION_LOOP_DURATION_STEPS.map((step, i) => (
56
65
  <TokenRow key={step} use={DS_MOTION_LOOP_DURATION_USE[step]} last={i === DS_MOTION_LOOP_DURATION_STEPS.length - 1}>
57
- <View style={styles.previewRow}>
58
- <Text style={styles.previewLabel}>{step}</Text>
59
- <View style={[styles.durationBar, { width: (DS_MOTION_LOOP_DURATION[step] / maxLoopDuration) * 120 }]} />
60
- <Text style={styles.previewValue}>{DS_MOTION_LOOP_DURATION[step]}ms</Text>
66
+ <View style={styles.rowContent}>
67
+ <View style={styles.previewRow}>
68
+ <Text style={styles.previewLabel}>{step}</Text>
69
+ <View style={[styles.durationBar, { width: (DS_MOTION_LOOP_DURATION[step] / maxLoopDuration) * 120 }]} />
70
+ <Text style={styles.previewValue}>{DS_MOTION_LOOP_DURATION[step]}ms</Text>
71
+ </View>
72
+ <MotionSpecimen
73
+ kind="timing"
74
+ duration={DS_MOTION_LOOP_DURATION[step]}
75
+ easing={Easing.bezier(...DS_MOTION_EASING.standard)}
76
+ label={`${DS_MOTION_LOOP_DURATION[step]}ms · one cycle`}
77
+ />
61
78
  </View>
62
79
  </TokenRow>
63
80
  ))}
@@ -67,9 +84,17 @@ function MotionGallery() {
67
84
  <View style={styles.tokenStack}>
68
85
  {DS_MOTION_EASING_STEPS.map((step, i) => (
69
86
  <TokenRow key={step} use={DS_MOTION_EASING_USE[step]} last={i === DS_MOTION_EASING_STEPS.length - 1}>
70
- <View style={styles.previewRow}>
71
- <Text style={styles.previewLabel}>{step}</Text>
72
- <Text style={styles.easingValue}>cubic-bezier({DS_MOTION_EASING[step].join(', ')})</Text>
87
+ <View style={styles.rowContent}>
88
+ <View style={styles.previewRow}>
89
+ <Text style={styles.previewLabel}>{step}</Text>
90
+ <Text style={styles.easingValue}>cubic-bezier({DS_MOTION_EASING[step].join(', ')})</Text>
91
+ </View>
92
+ <MotionSpecimen
93
+ kind="timing"
94
+ duration={DS_MOTION_DURATION.base}
95
+ easing={Easing.bezier(...DS_MOTION_EASING[step])}
96
+ label={`${DS_MOTION_DURATION.base}ms · ${step}`}
97
+ />
73
98
  </View>
74
99
  </TokenRow>
75
100
  ))}
@@ -78,13 +103,16 @@ function MotionGallery() {
78
103
  <VariantGroup name="Spring" desc="for Animated.spring(value, DS_MOTION_SPRING) — snap-point transitions, not fixed-duration timing">
79
104
  <View style={styles.tokenStack}>
80
105
  <TokenRow use={DS_MOTION_SPRING_USE} last>
81
- <View style={styles.springGrid}>
82
- {(Object.entries(DS_MOTION_SPRING) as [string, number | boolean][]).map(([key, value]) => (
83
- <View key={key} style={styles.springField}>
84
- <Text style={styles.previewLabel}>{key}</Text>
85
- <Text style={styles.previewValue}>{String(value)}</Text>
86
- </View>
87
- ))}
106
+ <View style={styles.rowContent}>
107
+ <View style={styles.springGrid}>
108
+ {(Object.entries(DS_MOTION_SPRING) as [string, number | boolean][]).map(([key, value]) => (
109
+ <View key={key} style={styles.springField}>
110
+ <Text style={styles.previewLabel}>{key}</Text>
111
+ <Text style={styles.previewValue}>{String(value)}</Text>
112
+ </View>
113
+ ))}
114
+ </View>
115
+ <MotionSpecimen kind="spring" spring={DS_MOTION_SPRING} label="Animated.spring(value, DS_MOTION_SPRING)" />
88
116
  </View>
89
117
  </TokenRow>
90
118
  </View>