@krapwoo/ds-viewer 0.4.7 → 0.4.9

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.
Files changed (62) hide show
  1. package/README.md +21 -6
  2. package/dist/cli/dev.js +66 -37
  3. package/dist/cli/doctor.js +4 -2
  4. package/dist/cli/endpoint.js +33 -0
  5. package/dist/cli/init.js +5 -8
  6. package/dist/native/catalog/comparison.js +17 -8
  7. package/native/catalog/CatalogShell.tsx +5 -1
  8. package/native/catalog/ComparisonGrid.tsx +5 -1
  9. package/native/catalog/ComparisonGroups.tsx +7 -1
  10. package/native/catalog/ComparisonList.tsx +7 -1
  11. package/native/catalog/PhoneFrame.tsx +108 -24
  12. package/native/catalog/ReferenceDetails.tsx +8 -0
  13. package/native/catalog/SectionBlock.tsx +10 -4
  14. package/native/catalog/SpecimenAddress.tsx +15 -0
  15. package/native/catalog/SpecimenSurface.tsx +66 -4
  16. package/native/catalog/UpdatePanel.tsx +114 -103
  17. package/native/catalog/comparison.ts +21 -8
  18. package/native/catalog/deviceFrame.ts +14 -0
  19. package/native/catalog/overlayViewport.ts +4 -2
  20. package/native/catalog/specimenSurfaceStyle.ts +54 -0
  21. package/native/catalog/updatePanelState.ts +68 -1
  22. package/package.json +5 -4
  23. package/starter-kit/components/AnimatedChevron/AnimatedChevron.catalog.tsx +1 -1
  24. package/starter-kit/components/Avatar/Avatar.catalog.tsx +1 -1
  25. package/starter-kit/components/Badge/Badge.catalog.tsx +1 -1
  26. package/starter-kit/components/Banner/Banner.catalog.tsx +2 -1
  27. package/starter-kit/components/BottomSheet/BottomSheet.catalog.tsx +5 -1
  28. package/starter-kit/components/Button/Button.catalog.tsx +1 -1
  29. package/starter-kit/components/ButtonGroup/ButtonGroup.catalog.tsx +8 -1
  30. package/starter-kit/components/Card/Card.catalog.tsx +2 -1
  31. package/starter-kit/components/Checkbox/Checkbox.catalog.tsx +2 -2
  32. package/starter-kit/components/Dialog/Dialog.catalog.tsx +1 -1
  33. package/starter-kit/components/Divider/Divider.catalog.tsx +2 -1
  34. package/starter-kit/components/Dock/Dock.catalog.tsx +4 -1
  35. package/starter-kit/components/Dropdown/Dropdown.catalog.tsx +1 -1
  36. package/starter-kit/components/EmptyState/EmptyState.catalog.tsx +2 -1
  37. package/starter-kit/components/FieldContainer/FieldContainer.catalog.tsx +5 -1
  38. package/starter-kit/components/InputClearButton/InputClearButton.catalog.tsx +1 -1
  39. package/starter-kit/components/InputField/InputField.catalog.tsx +3 -1
  40. package/starter-kit/components/List/List.catalog.tsx +2 -1
  41. package/starter-kit/components/ListItem/ListItem.catalog.tsx +7 -1
  42. package/starter-kit/components/Loading/Loading.catalog.tsx +2 -1
  43. package/starter-kit/components/Pill/Pill.catalog.tsx +1 -1
  44. package/starter-kit/components/PillRow/PillRow.catalog.tsx +1 -1
  45. package/starter-kit/components/ProgressDots/ProgressDots.catalog.tsx +1 -1
  46. package/starter-kit/components/Radio/Radio.catalog.tsx +2 -2
  47. package/starter-kit/components/SearchField/SearchField.catalog.tsx +2 -1
  48. package/starter-kit/components/SectionHeader/SectionHeader.catalog.tsx +2 -1
  49. package/starter-kit/components/SegmentedToggle/SegmentedToggle.catalog.tsx +1 -3
  50. package/starter-kit/components/Shimmer/Breathing.catalog.tsx +2 -1
  51. package/starter-kit/components/Shimmer/Shimmer.catalog.tsx +2 -1
  52. package/starter-kit/components/Shimmer/SkeletonGroup.catalog.tsx +5 -1
  53. package/starter-kit/components/Surface/Surface.catalog.tsx +2 -1
  54. package/starter-kit/components/Switch/Switch.catalog.tsx +2 -2
  55. package/starter-kit/components/TextArea/TextArea.catalog.tsx +2 -1
  56. package/starter-kit/components/Toast/Toast.catalog.tsx +2 -1
  57. package/starter-kit/components/Tooltip/Tooltip.catalog.tsx +2 -1
  58. package/starter-kit/components/TopNav/TopNav.catalog.tsx +4 -1
  59. package/starter-kit/components/UnderlineTabs/UnderlineTabs.catalog.tsx +1 -3
  60. package/starter-kit/pages/ReportIssue.catalog.tsx +18 -1
  61. package/starter-kit/pages/SavedTrips.catalog.tsx +27 -6
  62. package/starter-kit/pages/TripPlannerForm.catalog.tsx +7 -1
@@ -27,10 +27,11 @@ const styles = StyleSheet.create({
27
27
  // fixed TopNav header and Dock footer around a scrollable middle, the same fixed-header/
28
28
  // scrollable-body/fixed-footer shape a real screen would use.
29
29
  savedTripsScreen: { flex: 1, alignSelf: 'stretch' },
30
- // A fixed cap (not `flex: 1`) — sidesteps a web-only flexbox quirk where a `flex: 1` ScrollView
31
- // nested inside PhoneFrame's own fixed height doesn't actually shrink to the space left after
32
- // TopNav/Dock, and grows PhoneFrame itself past its intended 480px instead of scrolling.
33
- savedTripsScroll: { maxHeight: 320 },
30
+ // Takes the space between the TopNav and the Dock and scrolls (`minHeight: 0` lets a flex child
31
+ // shrink below its content on the web).
32
+ savedTripsScroll: { flex: 1, minHeight: 0 },
33
+ // The muted area between TopNav and Dock takes the remaining height, so the list scrolls there.
34
+ savedTripsBody: { flex: 1, minHeight: 0 },
34
35
  savedTripsScrollContent: { padding: DS_SPACING[800], gap: DS_SPACING[600] },
35
36
  // Shared by SavedTrips' small inline rows — the "Updating arrival times…" loading row and each
36
37
  // list row's trailing badge+button cluster (identical layout, one key).
@@ -127,7 +128,7 @@ function SavedTripsDemo() {
127
128
  </Tooltip>
128
129
  }
129
130
  />
130
- <Surface tone="muted">
131
+ <Surface tone="muted" style={styles.savedTripsBody}>
131
132
  <ScrollView style={styles.savedTripsScroll} contentContainerStyle={styles.savedTripsScrollContent}>
132
133
  <SearchField value={query} onChangeText={setQuery} placeholder="Search stations" />
133
134
  <SegmentedToggle
@@ -239,7 +240,27 @@ function SavedTripsDemo() {
239
240
  }
240
241
 
241
242
  export default defineCatalogPage({
242
- group: 'Recipes',
243
+ group: 'Patterns',
244
+ composedOf: [
245
+ { component: 'TopNav', role: "The screen header, titled Saved trips, with a Filters button.", relationship: 'built-in' },
246
+ { component: 'Tooltip', role: "The Filter by mode hint on the Filters button.", relationship: 'built-in' },
247
+ { component: 'Surface', role: "The muted background behind the search, toggles and list.", relationship: 'built-in' },
248
+ { component: 'SearchField', role: "Searches stations.", relationship: 'built-in' },
249
+ { component: 'SegmentedToggle', role: "Switches between List and Map views.", relationship: 'built-in' },
250
+ { component: 'UnderlineTabs', role: "The All, Nearby and Favorites tabs.", relationship: 'built-in' },
251
+ { component: 'PillRow', role: "Mode filter pills.", relationship: 'built-in' },
252
+ { component: 'Loading', role: "The small spinner beside Updating arrival times.", relationship: 'built-in' },
253
+ { component: 'Dropdown', role: "The Sort by picker.", relationship: 'built-in' },
254
+ { component: 'SectionHeader', role: "The Nearby stations heading.", relationship: 'built-in' },
255
+ { component: 'List', role: "Holds the saved-trip rows with dividers.", relationship: 'built-in' },
256
+ { component: 'ListItem', role: "Each saved trip row.", relationship: 'built-in' },
257
+ { component: 'Avatar', role: "Each row's mode icon.", relationship: 'built-in' },
258
+ { component: 'Badge', role: "Each row's status, e.g. delays.", relationship: 'built-in' },
259
+ { component: 'Button', role: "The Filters button, each row's remove button, and Plan a new trip.", relationship: 'built-in' },
260
+ { component: 'EmptyState', role: "Shown instead of the list on an empty tab (Favorites, or after removing every row).", relationship: 'built-in' },
261
+ { component: 'Toast', role: "Confirms a removed trip, with Undo.", relationship: 'built-in' },
262
+ { component: 'Dock', role: "The bottom bar holding Plan a new trip.", relationship: 'built-in' },
263
+ ],
243
264
  description: 'A composed real screen — a saved-trips list with a search bar, tab switcher, mode filter pills, a sort Dropdown, and a bottom action bar. Switch to the "Favorites" tab (or remove every row) to see the EmptyState alternative to the list; tap the header icon to see its Tooltip; tap a row\'s trailing × to see the Toast, which only appears after that real action and auto-dismisses (or Undo) — remove two rows back-to-back and each removal gets its own stacked toast on its own clock.',
244
265
  tokenGallery: true,
245
266
  fullWidthLabel: 'Preview',
@@ -40,7 +40,13 @@ function TripPlannerFormDemo() {
40
40
  }
41
41
 
42
42
  export default defineCatalogPage({
43
- group: 'Recipes',
43
+ group: 'Patterns',
44
+ composedOf: [
45
+ { component: 'Card', role: "Frames the whole form.", relationship: 'built-in' },
46
+ { component: 'InputField', role: "The From and To fields.", relationship: 'built-in' },
47
+ { component: 'Divider', role: "Separates the fields from the actions.", relationship: 'built-in' },
48
+ { component: 'Button', role: "Add stop (tertiary) and Continue (primary, disabled until To is filled).", relationship: 'built-in' },
49
+ ],
44
50
  description: 'A composed real screen — not one component in isolation — showing how Card, InputField, Divider, and Button actually fit together: a From/To trip form with a secondary "Add stop" action and a primary "Continue" that\'s disabled until a destination is entered.',
45
51
  tokenGallery: true,
46
52
  fullWidthLabel: 'Preview',